Subject: | dTRACE is nothing but ";" unless __ENABLE_TRACING__ is defined. |
Hi Laye,
dTRACE is nothing but ";" unless __ENABLE_TRACING__ is defined. ";" is,
however, an empty statement! That is, the compilation unsupporting C99
should be failed. Also, besides there is a couple of ";;", which is of
course an empty statement.
As such, I made a diff which is attached.
Regards,
Taro
Subject: | diff.txt |
--- AI-MaxEntropy.xs.org Fri Mar 7 12:24:51 2008
+++ AI-MaxEntropy.xs Fri Mar 7 12:56:09 2008
@@ -69,7 +69,6 @@
SV* step
SV* self
PREINIT:
- dTRACE("_neg_log_likelihood");
/* fetch the pre-cached samples and f_map */
SV* _c = *hvref_fetch(self, "_c");
struct samples_t* samples =
@@ -85,12 +84,14 @@
/* intermediate variables */
AV* av_d_log_lh;
char* smoother_type;
- int i, j, x, y, lambda_i;
+ int i, j, y, lambda_i;
double log_lh, sum_exp_lambda_f, sigma, fxy;
double* lambda_f = (double*)malloc(sizeof(double) * y_num);
double* exp_lambda_f = (double*)malloc(sizeof(double) * y_num);
double* d_log_lh = (double*)malloc(sizeof(double) * f_num);
double* lambda = (double*)malloc(sizeof(double) * f_num);
+ INIT:
+ dTRACE("_neg_log_likelihood");
CODE:
/* initialize */
TRACE("enter");
@@ -158,7 +159,6 @@
double epsilon
PREINIT:
dSP;
- dTRACE("_apply_gis");
/* fetch the pre-cached samples and f_map */
SV* _c = *hvref_fetch(self, "_c");
struct samples_t* samples =
@@ -183,6 +183,8 @@
double* lambda = (double*)malloc(sizeof(double) * f_num);
double* d_lambda = (double*)malloc(sizeof(double) * f_num);
double* exp_lambda_f = (double*)malloc(sizeof(double) * y_num);
+ INIT:
+ dTRACE("_apply_gis");
CODE:
TRACE("enter");
/* initiate lambda */
@@ -288,7 +290,7 @@
AV* samples = (AV*)SvRV(*hvref_fetch(self, "samples"));
AV *sample, *x;
struct samples_t* ss =
- (struct samples_t*)malloc(sizeof(struct samples_t));;
+ (struct samples_t*)malloc(sizeof(struct samples_t));
int i, j;
CODE:
ss->s_num = av_len(samples) + 1;
@@ -333,7 +335,7 @@
AV* f_map = (AV*)SvRV(*hvref_fetch(self, "f_map"));
AV* f_map_y;
struct f_map_t* fm =
- (struct f_map_t*)malloc(sizeof(struct f_map_t));;
+ (struct f_map_t*)malloc(sizeof(struct f_map_t));
int i, j, x_num;
CODE:
fm->y_num = av_len(f_map) + 1;