From 48d5ae46835d03d8daa7dd3dcd775c3e89830c94 Mon Sep 17 00:00:00 2001 From: Vincent Danjean <Vincent.Danjean@ens-lyon.org> Date: Wed, 31 Oct 2012 23:07:11 +0000 Subject: [PATCH] Fix some compilation warnings and protect debugging code git-svn-id: svn+ssh://imag/users/huron/danjean/svnroot/claire/altree/trunk@468 cf695345-040a-0410-a956-b889e835fe2e --- CUtils/c_sources/myrand.c | 1 + CUtils/c_sources/resampling.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CUtils/c_sources/myrand.c b/CUtils/c_sources/myrand.c index 4590e9a..8585afd 100644 --- a/CUtils/c_sources/myrand.c +++ b/CUtils/c_sources/myrand.c @@ -21,6 +21,7 @@ int myrand_init(unsigned long value) { #ifdef MT init_genrand_mt(&rdata, value); #endif + return 0; } static void init() __attribute__((constructor)); diff --git a/CUtils/c_sources/resampling.c b/CUtils/c_sources/resampling.c index d9d5b88..2525d9d 100644 --- a/CUtils/c_sources/resampling.c +++ b/CUtils/c_sources/resampling.c @@ -4,6 +4,8 @@ #include <strings.h> #include <stdlib.h> #include <pthread.h> +#include <sys/types.h> +#include <unistd.h> #include "myrand.h" struct chi2s { @@ -163,7 +165,7 @@ static void *resampling_worker(void* param) { int resampling_chi2(const struct tree *tree, const struct cc *lcc, int prolonge, int nb_permutations, datatype_t *results, int parallel) { - +#if defined(DEBUG) && 0 FILE* dump=fopen("/tmp/dump", "w+"); fwrite(tree, sizeof(struct tree), 1, dump); fwrite(tree->ld, sizeof(int), tree->nb_leaves, dump); @@ -173,7 +175,7 @@ int resampling_chi2(const struct tree *tree, const struct cc *lcc, int prolonge, fwrite(&prolonge, sizeof(int), 1, dump); fwrite(&nb_permutations, sizeof(int), 1, dump); fclose(dump); - +#endif char* envvar=getenv("ALTREE_PARALLEL"); if (envvar) { parallel=atoi(envvar); -- GitLab