From 5a59b3331acf8ba4b86eb3c513147d186bf8fc6c Mon Sep 17 00:00:00 2001 From: alegrand Date: Wed, 19 Oct 2005 14:28:53 +0000 Subject: [PATCH] make g++ happy git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1760 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/dynar.h | 2 +- src/xbt/dynar.c | 10 +++++----- src/xbt/ex.c | 2 +- src/xbt/log.c | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 2f426037c8..2b5fa44ac3 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -89,7 +89,7 @@ SG_BEGIN_DECL() void xbt_dynar_pop (xbt_dynar_t dynar, void *const dst); void xbt_dynar_unshift (xbt_dynar_t dynar, const void *src); void xbt_dynar_shift (xbt_dynar_t dynar, void *const dst); - void xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t *operator); + void xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t *op); /** @} */ /** @name 3. Manipulating pointers to the content diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index b231ea1cbd..aece933663 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -52,7 +52,7 @@ _xbt_dynar_expand(xbt_dynar_t const dynar, const unsigned long old_size = dynar->size; if (nb > old_size) { - char * const old_data = dynar->data; + char * const old_data = (char *) dynar->data; const unsigned long elmsize = dynar->elmsize; const unsigned long old_length = old_size*elmsize; @@ -62,7 +62,7 @@ _xbt_dynar_expand(xbt_dynar_t const dynar, const unsigned long new_size = nb > (2*(old_size+1)) ? nb : (2*(old_size+1)); const unsigned long new_length = new_size*elmsize; - char * const new_data = xbt_malloc0(elmsize*new_size); + char * const new_data = (char *) xbt_malloc0(elmsize*new_size); DEBUG3("expend %p from %lu to %d elements", (void*)dynar, (unsigned long)old_size, nb); @@ -83,7 +83,7 @@ static _XBT_INLINE void * _xbt_dynar_elm(const xbt_dynar_t dynar, const unsigned long idx) { - char * const data = dynar->data; + char * const data = (char*) dynar->data; const unsigned long elmsize = dynar->elmsize; return data + idx*elmsize; @@ -459,7 +459,7 @@ xbt_dynar_shift(xbt_dynar_t const dynar, */ void xbt_dynar_map(const xbt_dynar_t dynar, - void_f_pvoid_t * const operator) { + void_f_pvoid_t * const op) { __sanity_check_dynar(dynar); @@ -470,7 +470,7 @@ xbt_dynar_map(const xbt_dynar_t dynar, for (i = 0; i < used; i++) { _xbt_dynar_get_elm(elm, dynar, i); - operator(elm); + op(elm); } } } diff --git a/src/xbt/ex.c b/src/xbt/ex.c index 5a9ad015fe..7e53f12fd8 100644 --- a/src/xbt/ex.c +++ b/src/xbt/ex.c @@ -56,7 +56,7 @@ void xbt_ex_display(xbt_ex_t *e) { #ifdef HAVE_EXECINFO_H { char **strings; - size_t i; + int i; fprintf(stderr,"** Backtrace:\n"); strings = backtrace_symbols (e->bt, e->used); diff --git a/src/xbt/log.c b/src/xbt/log.c index 3cf1ceb5f0..e80332ab41 100644 --- a/src/xbt/log.c +++ b/src/xbt/log.c @@ -13,6 +13,7 @@ #include /* snprintf */ #include /* snprintf */ #include "gras_config.h" /* to get a working stdarg.h */ +#include "portable.h" /* to get a working stdarg.h */ #include "xbt_modinter.h" @@ -547,7 +548,7 @@ static void _xbt_log_parse_setting(const char* control_string, xbt_assert1(*dot == '.' && *eq == '=', "Invalid control string '%s'",control_string); - if (!strncmp(dot + 1, "thresh", min(eq - dot - 1,strlen("thresh")))) { + if (!strncmp(dot + 1, "thresh", min((size_t)(eq - dot - 1),strlen("thresh")))) { int i; char *neweq=xbt_strdup(eq+1); char *p=neweq-1; @@ -566,7 +567,7 @@ static void _xbt_log_parse_setting(const char* control_string, } } if (ithresh=i; + set->thresh= (e_xbt_log_priority_t) i; } else { xbt_assert1(FALSE,"Unknown priority name: %s",eq+1); } -- 2.20.1