From c94ebf727d3bac66028b7130aab3ee668b1949c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20B=C3=A9daride?= Date: Mon, 6 May 2013 14:36:15 +0200 Subject: [PATCH] Fix to handle warnings+optimizations on CI [#15544] --- include/surf/surfxml_parse.h | 4 ++++ src/bindings/java/smx_context_cojava.c | 3 ++- src/simdag/sd_dotloader.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/surf/surfxml_parse.h b/include/surf/surfxml_parse.h index 3564ab7bf6..ee4b4d98d9 100644 --- a/include/surf/surfxml_parse.h +++ b/include/surf/surfxml_parse.h @@ -24,6 +24,10 @@ XBT_PUBLIC(void) surf_parse_error(const char *msg,...) _XBT_GNUC_PRINTF(1,2) _XB XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) _XBT_GNUC_PRINTF(1,2); XBT_PUBLIC(double) surf_parse_get_double(const char *string); XBT_PUBLIC(int) surf_parse_get_int(const char *string); +XBT_PUBLIC(double) surf_parse_get_time(const char *string); +XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string); +XBT_PUBLIC(double) surf_parse_get_power(const char *string); + /* Prototypes of the functions offered by flex */ XBT_PUBLIC(int) surf_parse_lex(void); XBT_PUBLIC(int) surf_parse_get_lineno(void); diff --git a/src/bindings/java/smx_context_cojava.c b/src/bindings/java/smx_context_cojava.c index 5e135f21f3..6ecaca17bb 100644 --- a/src/bindings/java/smx_context_cojava.c +++ b/src/bindings/java/smx_context_cojava.c @@ -264,7 +264,8 @@ static void smx_ctx_cojava_create_coroutine(smx_ctx_cojava_t context) { FILE *conf= fopen("/proc/sys/vm/max_map_count","r"); if (conf) { int limit=-1; - fscanf(conf,"%d",&limit); + if(!fscanf(conf,"%d",&limit)) + xbt_die("Error while creating a new coroutine. Parse error."); fclose(conf); if (limit!=-1 && SIMIX_process_count() > (limit - 100) /2) xbt_die("Error while creating a new coroutine. " diff --git a/src/simdag/sd_dotloader.c b/src/simdag/sd_dotloader.c index 29c7b945e8..7842834a9a 100644 --- a/src/simdag/sd_dotloader.c +++ b/src/simdag/sd_dotloader.c @@ -170,7 +170,7 @@ xbt_dynar_t SD_dotload_generic(const char * filename, seq_par_t seq_or_par){ char *name = agnameof(node); double amount = atof(agget(node, (char *) "size")); - double alpha; + double alpha = 0.0; if (seq_or_par == sequential){ XBT_DEBUG("See ", name, amount); -- 2.20.1