Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Better fix to the comparison between signed and unsigned int around dynar size: chang...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Nov 2007 14:11:54 +0000 (14:11 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 8 Nov 2007 14:11:54 +0000 (14:11 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5004 48e7efb5-ca39-0410-a469-dd3cf9ba447f

41 files changed:
configure
examples/amok/saturate/saturate.c
examples/gras/all2all/all2all.c
include/surf/surfxml.h
include/xbt/dynar.h
src/amok/Bandwidth/bandwidth.c
src/amok/PeerManagement/peermanagement.c
src/config_unit.c
src/dynar_unit.c
src/ex_unit.c
src/gras/DataDesc/cbps.c
src/gras/DataDesc/datadesc.c
src/gras/DataDesc/ddt_create.c
src/gras/DataDesc/ddt_exchange.c
src/gras/DataDesc/ddt_parse.c
src/gras/Msg/gras_msg_exchange.c
src/gras/Msg/gras_msg_types.c
src/gras/Msg/rpc.c
src/gras/Msg/timer.c
src/gras/Transport/rl_transport.c
src/gras/Transport/sg_transport.c
src/gras/Transport/transport.c
src/gras/Transport/transport_plugin_sg.c
src/gras/Virtu/process.c
src/gras/Virtu/sg_process.c
src/include/surf/trace_mgr.h
src/simdag/sd_global.c
src/simix/smx_global.c
src/surf/surf.c
src/surf/surfxml_parse.c
src/surf/trace_mgr.c
src/surf/trace_mgr_private.h
src/surf/workstation_KCCFLN05.c
src/xbt/config.c
src/xbt/cunit.c
src/xbt/dynar.c
src/xbt/ex.c
src/xbt/graph.c
src/xbt/log.c
src/xbt/xbt_str.c
testsuite/surf/surf_usage2.c

index f038506..750c1cd 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 4930 .
+# From configure.ac Revision: 4976 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for simgrid 3.3-svn.
 #
index 6f9e110..909b132 100644 (file)
@@ -178,7 +178,7 @@ static void full_fledged_saturation(int argc, char*argv[]) {
   double *bw_sat;
 
   /* iterators */
-  int i,j,k,l;
+  unsigned int i,j,k,l;
   xbt_peer_t h1,h2,h3,h4;
 
   /* Init the group */
index 63015fb..bafd273 100644 (file)
@@ -77,7 +77,7 @@ int receiver (int argc,char *argv[]) {
 
 int sender (int argc,char *argv[]) {
 
-  int i; /* iterator */
+  unsigned int iter; /* iterator */
   char *data; /* data exchanged */
   int datasize; /* size of message */
   xbt_peer_t h; /* iterator */
@@ -93,8 +93,8 @@ int sender (int argc,char *argv[]) {
   gras_init(&argc,argv);
  
   /* Get the node location from argc/argv */
-  for (i=1; i<argc-1; i++){
-    xbt_peer_t peer = xbt_peer_from_string(argv[i]);
+  for (iter=1; iter<argc-1; iter++){
+    xbt_peer_t peer = xbt_peer_from_string(argv[iter]);
     xbt_dynar_push(peers,&peer);
   }
   
@@ -111,7 +111,7 @@ int sender (int argc,char *argv[]) {
 
 
   /* write to the receivers */
-  xbt_dynar_foreach(peers,i,h) {
+  xbt_dynar_foreach(peers,iter,h) {
      connected = 0;
      while (!connected) {
        xbt_ex_t e;
index b622657..20a08ad 100644 (file)
@@ -1,10 +1,10 @@
 /* XML processor/application API for surf/surfxml.dtd.
- * Generated 2007/10/31 10:34:28.
+ * Generated 2007/11/08 11:56:21.
  *
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2006 Martin Quinson.  All rights reserved.
- * (Id: flexml.pl,v 1.61 2006/09/13 16:34:33 wdowling Exp).
+ * (Id: flexml.pl,v 1.63 2007/10/11 14:46:08 mquinson Exp).
  * 
  * There are two, intertwined parts to this program, part A and part B.
  *
index 74aed4e..7b9b53f 100644 (file)
@@ -174,12 +174,12 @@ SG_BEGIN_DECL()
  *  @{
  */
 
-  XBT_PUBLIC(void) _xbt_dynar_cursor_first (const xbt_dynar_t dynar, int * const cursor);
-  XBT_PUBLIC(void) _xbt_dynar_cursor_step  (const xbt_dynar_t dynar, int * const cursor);
-  XBT_PUBLIC(int)  _xbt_dynar_cursor_get   (const xbt_dynar_t dynar, int * const cursor, 
+  XBT_PUBLIC(void) _xbt_dynar_cursor_first (const xbt_dynar_t dynar, unsigned int * const cursor);
+  XBT_PUBLIC(void) _xbt_dynar_cursor_step  (const xbt_dynar_t dynar, unsigned int * const cursor);
+  XBT_PUBLIC(int)  _xbt_dynar_cursor_get   (const xbt_dynar_t dynar, unsigned int * const cursor, 
                                            void *whereto);
   XBT_PUBLIC(void) xbt_dynar_cursor_rm(xbt_dynar_t dynar,
-                                      int         *const cursor);
+                                      unsigned int *const cursor);
   XBT_PUBLIC(void) xbt_dynar_cursor_unlock(xbt_dynar_t dynar);
 
 /** @brief Iterates over the whole dynar. 
@@ -192,7 +192,7 @@ SG_BEGIN_DECL()
  * \note An example of usage:
  * \code
 xbt_dynar_t dyn;
-int cpt;
+unsigned int cpt;
 string *str;
 xbt_dynar_foreach (dyn,cpt,str) {
   printf("Seen %s\n",str);
index a1a8623..f8ea7b7 100644 (file)
@@ -490,7 +490,8 @@ double * amok_bw_matrix(xbt_dynar_t peers,
   /* construction of matrices for bandwith and latency */
 
 
-  int i,j,len=xbt_dynar_length(peers);
+  unsigned int i,j;
+  int len=xbt_dynar_length(peers);
 
   double *matrix_res = xbt_new0(double, len*len);
   xbt_peer_t p1,p2;
index 3eb0164..88b73ab 100644 (file)
@@ -75,7 +75,7 @@ static int amok_pm_cb_leave(gras_msg_cb_ctx_t ctx, void *payload) {
   xbt_peer_t dude = xbt_peer_new(gras_socket_peer_name(exp),
                                 gras_socket_peer_port(exp));
 
-  int cpt;
+  unsigned int cpt;
   xbt_peer_t peer_it;
 
   xbt_dynar_foreach(group, cpt, peer_it) {
@@ -178,7 +178,7 @@ void amok_pm_group_shutdown(const char *group_name) {
   amok_pm_moddata_t g=gras_moddata_by_id(amok_pm_moddata_id);
   xbt_dynar_t group = xbt_dict_get(g->groups, group_name);
   
-  int cpt;
+  unsigned int cpt;
   xbt_peer_t peer_it;
 
   xbt_dynar_foreach(group, cpt, peer_it) {
index c0aa092..67e4f2f 100644 (file)
@@ -8,7 +8,7 @@
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
-# 1144 "xbt/config.c" 
+# 1145 "xbt/config.c" 
 #include "xbt.h"
 #include "xbt/ex.h"
 
index 1b0245e..7c451b5 100644 (file)
@@ -18,7 +18,8 @@ XBT_LOG_DEFAULT_CATEGORY(xbt_dyn);
 XBT_TEST_UNIT("int",test_dynar_int,"Dynars of integers") {
    /* Vars_decl [doxygen cruft] */
    xbt_dynar_t d;
-   int i,cpt,cursor;
+   int i,cpt;
+   unsigned int cursor;
    int *iptr;
    
    xbt_test_add0("==== Traverse the empty dynar");
@@ -163,7 +164,8 @@ XBT_TEST_UNIT("int",test_dynar_int,"Dynars of integers") {
 /*******************************************************************************/
 XBT_TEST_UNIT("double",test_dynar_double,"Dynars of doubles") {
    xbt_dynar_t d;
-   int cpt,cursor;
+   int cpt;
+   unsigned int cursor;
    double d1,d2;
    
    xbt_test_add0("==== Traverse the empty dynar");
@@ -284,12 +286,13 @@ static void free_string(void *d){
 XBT_TEST_UNIT("string",test_dynar_string,"Dyars of strings") {
    xbt_dynar_t d;
    int cpt;
+   unsigned int iter;
    char buf[1024];
    char *s1,*s2;
    
    xbt_test_add0("==== Traverse the empty dynar");
    d=xbt_dynar_new(sizeof(char *),&free_string);
-   xbt_dynar_foreach(d,cpt,s1){
+   xbt_dynar_foreach(d,iter,s1){
      xbt_test_assert0(FALSE,
                  "Damnit, there is something in the empty dynar");
    }
@@ -340,8 +343,8 @@ XBT_TEST_UNIT("string",test_dynar_string,"Dyars of strings") {
      xbt_dynar_unshift(d,&s1);
    }
    /* 2. Traverse the dynar with the macro */
-   xbt_dynar_foreach(d,cpt,s1) {
-     sprintf(buf,"%d",NB_ELEM - cpt -1);
+   xbt_dynar_foreach(d,iter,s1) {
+     sprintf(buf,"%d",NB_ELEM - iter -1);
      xbt_test_assert2 (!strcmp(buf,s1),
            "The retrieved value is not the same than the injected one (%s!=%s)",
               buf,s1);
index 9a2c365..261a8d9 100644 (file)
@@ -8,7 +8,7 @@
 /* GENERATED FILE, DO NOT EDIT */
 /*******************************/
 
-# 417 "xbt/ex.c" 
+# 419 "xbt/ex.c" 
 #include <stdio.h>
 #include "xbt/ex.h"
 
index 649bb1a..c3f7e4c 100644 (file)
@@ -265,7 +265,7 @@ void
 gras_cbps_block_end(gras_cbps_t ps) {
 
   xbt_dynar_t  frame        = NULL;
-  int           cursor       =    0;
+  unsigned int cursor       =    0;
   char         *name         = NULL;
 
   xbt_assert0(xbt_dynar_length(ps->frames),
index 1f99e5f..adf8f76 100644 (file)
@@ -196,7 +196,7 @@ int gras_datadesc_size(gras_datadesc_type_t type) {
  * For debugging purpose
  */
 void gras_datadesc_type_dump(const gras_datadesc_type_t ddt){
-  int cpt;
+  unsigned int cpt;
 
   printf("DataDesc dump:");
   if(!ddt) {
index 0495574..1866b1b 100644 (file)
@@ -771,7 +771,7 @@ static gras_dd_cat_field_t
    xbt_dynar_t         field_array;
    
    gras_dd_cat_field_t  field=NULL;
-   int                  field_num;
+   unsigned int         field_num;
    
    if (type->category_code == e_gras_datadesc_type_cat_union) {
       field_array = type->category.union_data.fields;
@@ -916,7 +916,8 @@ void gras_datadesc_free(gras_datadesc_type_t *type) {
  */
 int gras_datadesc_type_cmp(const gras_datadesc_type_t d1,
                           const gras_datadesc_type_t d2) {
-  int ret,cpt;
+  int ret;
+  unsigned int cpt;
   gras_dd_cat_field_t field1,field2;
   gras_datadesc_type_t field_desc_1,field_desc_2;
 
index 3f3015f..0ec2722 100644 (file)
@@ -20,42 +20,42 @@ const char *gras_datadesc_cat_names[9] = {
   "scalar", "struct", "union", "ref", "array", "ignored",
   "invalid"};
 
-static gras_datadesc_type_t int_type = NULL;
+static gras_datadesc_type_t uint_type = NULL;
 static gras_datadesc_type_t pointer_type = NULL;    
 
 static XBT_INLINE void
-gras_dd_send_int(gras_socket_t sock,int *i, int stable) {
+gras_dd_send_uint(gras_socket_t sock,unsigned int *i, int stable) {
 
-  if (!int_type) {
-    int_type = gras_datadesc_by_name("int");
-     xbt_assert(int_type);  
+  if (!uint_type) {
+    uint_type = gras_datadesc_by_name("unsigned int");
+    xbt_assert(uint_type);  
   }
    
-  DEBUG1("send_int(%d)",*i);
-  gras_trp_send(sock, (char*)i, int_type->size[GRAS_THISARCH], stable);
+  DEBUG1("send_uint(%u)",*i);
+  gras_trp_send(sock, (char*)i, uint_type->size[GRAS_THISARCH], stable);
 }
 
 static XBT_INLINE void
-gras_dd_recv_int(gras_socket_t sock, int r_arch, int *i) {
+gras_dd_recv_uint(gras_socket_t sock, int r_arch, unsigned int *i) {
 
-  if (!int_type) {
-     int_type = gras_datadesc_by_name("int");
-     xbt_assert(int_type);
+  if (!uint_type) {
+     uint_type = gras_datadesc_by_name("unsigned int");
+     xbt_assert(uint_type);
   }
 
-  if (int_type->size[GRAS_THISARCH] >= int_type->size[r_arch]) {
-    gras_trp_recv(sock, (char*)i, int_type->size[r_arch]);
+  if (uint_type->size[GRAS_THISARCH] >= uint_type->size[r_arch]) {
+    gras_trp_recv(sock, (char*)i, uint_type->size[r_arch]);
     if (r_arch != GRAS_THISARCH)
-      gras_dd_convert_elm(int_type,1,r_arch, i,i);
+      gras_dd_convert_elm(uint_type,1,r_arch, i,i);
   } else {
-    void *ptr = xbt_malloc(int_type->size[r_arch]);
+    void *ptr = xbt_malloc(uint_type->size[r_arch]);
 
-    gras_trp_recv(sock, (char*)ptr, int_type->size[r_arch]);
+    gras_trp_recv(sock, (char*)ptr, uint_type->size[r_arch]);
     if (r_arch != GRAS_THISARCH)
-      gras_dd_convert_elm(int_type,1,r_arch, ptr,i);
+      gras_dd_convert_elm(uint_type,1,r_arch, ptr,i);
     free(ptr);
   }
-  DEBUG1("recv_int(%d)",*i);
+  DEBUG1("recv_uint(%u)",*i);
 }
 
 /*
@@ -115,7 +115,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t           state,
 
 
   xbt_ex_t             e;
-  int                  cpt;
+  unsigned int         cpt;
   gras_datadesc_type_t sub_type; /* type on which we recurse */
   int count = 0;
 
@@ -184,7 +184,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t           state,
   case e_gras_datadesc_type_cat_union: {
     gras_dd_cat_union_t union_data;
     gras_dd_cat_field_t field=NULL;
-    int                 field_num;
+    unsigned int        field_num;
     
     union_data = type->category.union_data;
     
@@ -198,7 +198,7 @@ gras_datadesc_memcpy_rec(gras_cbps_t           state,
                "union field selector of %s gave a negative value", 
                type->name);
     
-    xbt_assert3(field_num < (int)xbt_dynar_length(union_data.fields),
+    xbt_assert3(field_num < xbt_dynar_length(union_data.fields),
         "union field selector of %s returned %d but there is only %lu fields",
                 type->name, field_num, xbt_dynar_length(union_data.fields));
     
@@ -405,7 +405,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
                       int                   detect_cycle) {
 
   xbt_ex_t             e;
-  int                  cpt;
+  unsigned int         cpt;
   gras_datadesc_type_t sub_type; /* type on which we recurse */
   
   VERB2("Send a %s (%s)", 
@@ -458,7 +458,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
   case e_gras_datadesc_type_cat_union: {
     gras_dd_cat_union_t union_data;
     gras_dd_cat_field_t field=NULL;
-    int                 field_num;
+    unsigned int        field_num;
     
     union_data = type->category.union_data;
     
@@ -472,12 +472,12 @@ gras_datadesc_send_rec(gras_socket_t         sock,
                 "union field selector of %s gave a negative value", 
                 type->name);
     
-    xbt_assert3(field_num < (int)xbt_dynar_length(union_data.fields),
+    xbt_assert3(field_num < xbt_dynar_length(union_data.fields),
         "union field selector of %s returned %d but there is only %lu fields",
                 type->name, field_num, xbt_dynar_length(union_data.fields));
 
     /* Send the field number */
-    gras_dd_send_int(sock, &field_num, 0 /* not stable */);
+    gras_dd_send_uint(sock, &field_num, 0 /* not stable */);
     
     /* Send the content */
     field = xbt_dynar_get_as(union_data.fields, field_num, gras_dd_cat_field_t);
@@ -503,7 +503,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
     sub_type = ref_data.type;
     if (sub_type == NULL) {
       sub_type = (*ref_data.selector)(type,state,data);
-      gras_dd_send_int(sock, (int*) &(sub_type->code),1 /*stable*/);
+      gras_dd_send_uint(sock, &(sub_type->code),1 /*stable*/);
     }
     
     /* Send the actual value of the pointer for cycle handling */
@@ -551,7 +551,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
 
   case e_gras_datadesc_type_cat_array: {
     gras_dd_cat_array_t    array_data;
-    int                    count;
+    unsigned int           count;
     char                  *ptr=data;
     long int               elm_size;
     
@@ -563,7 +563,7 @@ gras_datadesc_send_rec(gras_socket_t         sock,
       count = array_data.dynamic_size(type,state,data);
       xbt_assert1(count >=0,
                   "Invalid (negative) array size for type %s",type->name);
-      gras_dd_send_int(sock, &count, 0/*non-stable*/);
+      gras_dd_send_uint(sock, &count, 0/*non-stable*/);
     }
     
     /* send the content */
@@ -654,7 +654,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
                       int                   subsize,
                       int                   detect_cycle) {
 
-  int                  cpt;
+  unsigned int         cpt;
   gras_datadesc_type_t sub_type;
   xbt_ex_t e;
 
@@ -711,7 +711,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
   case e_gras_datadesc_type_cat_union: {
     gras_dd_cat_union_t union_data;
     gras_dd_cat_field_t field=NULL;
-    int                 field_num;
+    unsigned int        field_num;
 
     union_data = type->category.union_data;
 
@@ -719,11 +719,11 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
                "Please call gras_datadesc_declare_union_close on %s before receiving it",
                type->name);
     /* retrieve the field number */
-    gras_dd_recv_int(sock, r_arch, &field_num);
+    gras_dd_recv_uint(sock, r_arch, &field_num);
     if (field_num < 0)
       THROW1(mismatch_error,0,
             "Received union field for %s is negative", type->name);
-    if (field_num > (int)xbt_dynar_length(union_data.fields)) 
+    if (field_num > xbt_dynar_length(union_data.fields)) 
       THROW3(mismatch_error,0,
             "Received union field for %s is said to be #%d but there is only %lu fields",
             type->name, field_num, xbt_dynar_length(union_data.fields));
@@ -753,8 +753,8 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
     /* Get the referenced type locally or from peer */
     sub_type = ref_data.type;
     if (sub_type == NULL) {
-      int ref_code;
-      gras_dd_recv_int(sock, r_arch, &ref_code);
+      unsigned int ref_code;
+      gras_dd_recv_uint(sock, r_arch, &ref_code);
       sub_type = gras_datadesc_by_id(ref_code);
     }
 
@@ -793,7 +793,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
     }
 
     if (reference_is_to_recv) {
-      int subsubcount = 0;
+      unsigned int subsubcount = 0;
       void *l_referenced=NULL;
 
       VERB2("Receiving a ref to '%s', remotely @%p",
@@ -806,7 +806,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
 
        subsubcount = array_data.fixed_size;
        if (subsubcount == 0)
-         gras_dd_recv_int(sock, r_arch, &subsubcount);
+         gras_dd_recv_uint(sock, r_arch, &subsubcount);
 
        subsub_type = array_data.type;
 
@@ -845,7 +845,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
 
   case e_gras_datadesc_type_cat_array: {
     gras_dd_cat_array_t    array_data;
-    int       count;
+    unsigned int count;
     char     *ptr;
     long int  elm_size;
 
@@ -855,7 +855,7 @@ gras_datadesc_recv_rec(gras_socket_t         sock,
     if (count == 0)
       count = subsize;
     if (count == 0)
-      gras_dd_recv_int(sock, r_arch, &count);
+      gras_dd_recv_uint(sock, r_arch, &count);
     if (count == 0)
       THROW1(mismatch_error,0,
             "Invalid (=0) array size for type %s",type->name);
index 3d5dd39..3adaccf 100644 (file)
@@ -559,7 +559,7 @@ static gras_datadesc_type_t parse_struct(char *definition) {
 
   xbt_dynar_t identifiers;
   s_identifier_t field;
-  int i;
+  unsigned int iter;
   int done;
 
   xbt_dynar_t fields_to_push;
@@ -600,7 +600,7 @@ static gras_datadesc_type_t parse_struct(char *definition) {
     
     DEBUG1("This statement contained %lu identifiers",xbt_dynar_length(identifiers));
     /* append the identifiers we've found */
-    xbt_dynar_foreach(identifiers,i, field) {
+    xbt_dynar_foreach(identifiers,iter, field) {
       if (field.tm.is_ref)
        PARSE_ERROR2("Not enough GRAS_ANNOTATE to deal with all dereferencing levels of %s (%d '*' left)",
                     field.name,field.tm.is_ref);
@@ -615,7 +615,7 @@ static gras_datadesc_type_t parse_struct(char *definition) {
     DEBUG1("struct_type=%p",(void*)struct_type);
     
     /* Make sure that all fields declaring a size push it into the cbps */
-    xbt_dynar_foreach(fields_to_push,i, name) {
+    xbt_dynar_foreach(fields_to_push,iter, name) {
       DEBUG1("struct_type=%p",(void*)struct_type);
       if (name[0] == '*') {
        VERB2("Push field '%s' as a multiplier into size stack of %p",
index 4207d70..8d40258 100644 (file)
@@ -48,7 +48,7 @@ gras_msg_wait_ext_(double           timeout,
   double start, now;
   gras_msg_procdata_t pd=
     (gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cpt;
+  unsigned int cpt;
 
   xbt_assert0(msg_got,"msg_got is an output parameter");
 
@@ -295,7 +295,7 @@ gras_msg_handle(double timeOut) {
   
   double          untiltimer;
    
-  int             cpt;
+  unsigned int cpt;
   int volatile ran_ok;
 
   s_gras_msg_t    msg;
index 10e1f1c..374b3fe 100644 (file)
@@ -228,7 +228,7 @@ gras_cb_register_(gras_msgtype_t msgtype,
   gras_msg_procdata_t pd=
     (gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
   gras_cblist_t *list=NULL;
-  int cpt;
+  unsigned int cpt;
 
   DEBUG2("Register %p as callback to '%s'",cb,msgtype->name);
 
@@ -261,7 +261,7 @@ gras_cb_unregister_(gras_msgtype_t msgtype,
     (gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
   gras_cblist_t *list;
   gras_msg_cb_t cb_cpt;
-  int cpt;
+  unsigned int cpt;
   int found = 0;
 
   /* search the list of cb for this message on this host */
index 8937485..be3f040 100644 (file)
@@ -68,7 +68,7 @@ static int msgfilter_rpcID(gras_msg_t msg, void* ctx) {
   unsigned long int ID= *(unsigned long int*)ctx;
   int res = msg->ID == ID && 
     (msg->kind == e_gras_msg_kind_rpcanswer || msg->kind == e_gras_msg_kind_rpcerror);
-  int cursor;
+  unsigned int cursor;
   gras_msg_cb_ctx_t rpc_ctx;
      
 
index 1249840..49c0f1b 100644 (file)
@@ -45,7 +45,8 @@ void gras_timer_repeat(double interval, void_f_void_t action) {
 /** @brief Cancel a delayed task */
 void gras_timer_cancel_delay(double interval, void_f_void_t action) {
   gras_msg_procdata_t pd=(gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cursor,found;
+  unsigned int cursor;
+  int found;
   s_gras_timer_t timer;
 
   found = FALSE;
@@ -68,7 +69,8 @@ void gras_timer_cancel_delay(double interval, void_f_void_t action) {
 /** @brief Cancel a repetitive task */
 void gras_timer_cancel_repeat(double interval, void_f_void_t action) {
   gras_msg_procdata_t pd=(gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cursor,found;
+  unsigned int cursor;
+  int found;
   s_gras_timer_t timer;
 
   found = FALSE;
@@ -90,7 +92,8 @@ void gras_timer_cancel_repeat(double interval, void_f_void_t action) {
 /** @brief Cancel all delayed tasks */
 void gras_timer_cancel_delay_all(void) {
   gras_msg_procdata_t pd=(gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cursor, found;
+  unsigned int cursor;
+  int found;
   s_gras_timer_t timer;
 
   found = FALSE;
@@ -110,7 +113,8 @@ void gras_timer_cancel_delay_all(void) {
 /** @brief Cancel all repetitive tasks */
 void gras_timer_cancel_repeat_all(void){
   gras_msg_procdata_t pd=(gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cursor, found;
+  unsigned int cursor;
+  int found;
   s_gras_timer_t timer;
 
   found = FALSE;
@@ -136,12 +140,12 @@ void gras_timer_cancel_all(void) {
 /* returns 0 if it handled a timer, or the delay until next timer, or -1 if no armed timer */
 double gras_msg_timer_handle(void) {
   gras_msg_procdata_t pd=(gras_msg_procdata_t)gras_libdata_by_id(gras_msg_libdata_id);
-  int cursor;
+  unsigned int cursor;
   gras_timer_t timer;
   double now=gras_os_time();
   double untilnext = -1.0;
   
-  for (cursor=0; cursor < (int)xbt_dynar_length(pd->timers); cursor++) {
+  for (cursor=0; cursor < xbt_dynar_length(pd->timers); cursor++) {
      double untilthis;
      
      timer = xbt_dynar_get_ptr (pd->timers, cursor);
index 66ad0a2..77b1d79 100644 (file)
@@ -42,7 +42,7 @@ gras_socket_t gras_trp_select(double timeout) {
   static int fd_setsize=-1; /* FD_SETSIZE not always defined. Get this portably */
 
   gras_socket_t sock_iter; /* iterating over all sockets */
-  int cursor;              /* iterating over all sockets */
+  unsigned int cursor;     /* iterating over all sockets */
 
   /* Check whether there is more data to read from the socket we selected last time.
      This can happen with tcp buffered sockets since we try to get as much data as we can for them */
index b77eae4..96c2894 100644 (file)
@@ -36,7 +36,7 @@ gras_socket_t gras_trp_select(double timeout) {
   gras_socket_t active_socket = NULL;
   gras_trp_sg_sock_data_t *active_socket_data;
   gras_socket_t sock_iter; /* iterating over all sockets */
-  int cursor;
+  unsigned int cursor;
 
   DEBUG3("select on %s@%s with timeout=%f",
         SIMIX_process_get_name(SIMIX_process_self()),
index 21d7e23..1df5295 100644 (file)
@@ -331,7 +331,7 @@ gras_socket_client_from_string(const char *host) {
 void gras_socket_close(gras_socket_t sock) {
   xbt_dynar_t sockets = ((gras_trp_procdata_t) gras_libdata_by_id(gras_trp_libdata_id))->sockets;
   gras_socket_t sock_iter = NULL;
-  int cursor;
+  unsigned int cursor;
 
   XBT_IN;
   VERB1("Close %p",sock);
@@ -349,7 +349,7 @@ void gras_socket_close(gras_socket_t sock) {
   if (sock) {
        /* FIXME: Cannot get the dynar mutex, because it can be already locked */
 //             _xbt_dynar_foreach(sockets,cursor,sock_iter) {
-               for (cursor=0; cursor< (int)xbt_dynar_length(sockets); cursor++)  {
+               for (cursor=0; cursor< xbt_dynar_length(sockets); cursor++)  {
                        _xbt_dynar_cursor_get(sockets,&cursor,&sock_iter);
                        if (sock == sock_iter) {
                                DEBUG2("remove sock cursor %d dize %lu\n",cursor,xbt_dynar_length(sockets));
@@ -584,7 +584,7 @@ void gras_trp_socketset_dump(const char *name) {
   gras_trp_procdata_t procdata = 
     (gras_trp_procdata_t)gras_libdata_by_id(gras_trp_libdata_id);
 
-  int it;
+  unsigned int it;
   gras_socket_t s;
 
   INFO1("** Dump the socket set %s",name);
index b3335b8..6dbb7c9 100644 (file)
@@ -58,7 +58,7 @@ typedef struct {
  ***/
 static void find_port(gras_hostdata_t *hd, int port,
                      gras_sg_portrec_t *hpd) {
-  int cpt;
+  unsigned int cpt;
   gras_sg_portrec_t pr;
 
   xbt_assert0(hd,"Please run gras_process_init on each process");
@@ -208,7 +208,7 @@ void gras_trp_sg_socket_server(gras_trp_plugin_t self,
 
 void gras_trp_sg_socket_close(gras_socket_t sock){
   gras_hostdata_t *hd=(gras_hostdata_t *)SIMIX_host_get_data(SIMIX_host_self());
-  int cpt;
+  unsigned int cpt;
   gras_sg_portrec_t pr; 
 
   XBT_IN1(" (sock=%p)",sock);
index a978ba3..1cea719 100644 (file)
@@ -109,7 +109,7 @@ gras_procdata_init() {
   gras_procdata_t *pd=gras_procdata_get();
   s_gras_procdata_fabric_t fab;
    
-  int cursor;
+  unsigned int cursor;
    
   xbt_ex_t e;
   xbt_set_elm_t elem;
@@ -122,7 +122,7 @@ gras_procdata_init() {
   xbt_dynar_foreach(_gras_procdata_fabrics,cursor,fab){ 
     volatile int found = 0;
      
-    if (cursor+1 <= (int)xbt_set_length(pd->libdata)) {
+    if (cursor+1 <= xbt_set_length(pd->libdata)) {
        DEBUG2("Skip fabric %d: there is already %ld libdata",
             cursor, xbt_set_length(pd->libdata));
        continue; /* allow to recall this function to get recently added fabrics */
index e1cac96..36c5ead 100644 (file)
@@ -74,7 +74,7 @@ void
 gras_process_exit() {
        xbt_dynar_t sockets = ((gras_trp_procdata_t) gras_libdata_by_name("gras_trp"))->sockets;
   gras_socket_t sock_iter;
-  int cursor;
+  unsigned int cursor;
   gras_hostdata_t *hd=
     (gras_hostdata_t *)SIMIX_host_get_data(SIMIX_host_self());
   gras_procdata_t *pd=
index c3600e5..5a3a4e3 100644 (file)
@@ -26,7 +26,7 @@ XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
 
 XBT_PUBLIC(tmgr_trace_event_t) tmgr_history_add_trace(tmgr_history_t history,
                                          tmgr_trace_t trace,
-                                         double start_time, int offset,
+                                         double start_time, unsigned int offset,
                                          void *model);
 
 /* Access functions */
index a080aa7..a7950c9 100644 (file)
@@ -123,7 +123,7 @@ static void sd_cfg_control_set(const char *control_string)
   /* To split the string in commands, and the cursors */
   xbt_dynar_t set_strings;
   char *str;
-  int cpt;
+  unsigned int cpt;
 
   if (!control_string)
     return;
@@ -395,7 +395,7 @@ SD_task_t* SD_simulate(double how_long)
   SD_task_t *changed_tasks = NULL;
   int changed_task_number = 0;
   int changed_task_capacity = sd_global->task_number + 1;
-  int i;
+  unsigned int iter;
   static int first_time = 1;
 
   SD_CHECK_INIT_DONE();
@@ -451,7 +451,7 @@ SD_task_t* SD_simulate(double how_long)
       total_time += elapsed_time;
 
     /* let's see which tasks are done */
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       while ((action = xbt_swag_extract(model->common_public->
                                        states.done_action_set))) {
        task = action->data;
@@ -523,10 +523,10 @@ SD_task_t* SD_simulate(double how_long)
   }
 
   /* we must reset every task->state_changed */
-  i = 0;
-  while (changed_tasks[i] != NULL) {
-    changed_tasks[i]->state_changed = 0;
-    i++;
+  iter = 0;
+  while (changed_tasks[iter] != NULL) {
+    changed_tasks[iter]->state_changed = 0;
+    iter++;
   }
 
   INFO0("Simulation finished");
index 5e3f7a8..c204eca 100644 (file)
@@ -31,7 +31,7 @@ static void simix_cfg_control_set(const char *control_string)
   /* To split the string in commands, and the cursors */
   xbt_dynar_t set_strings;
   char *str;
-  int cpt;
+  unsigned int cpt;
 
   if (!control_string)
     return;
@@ -323,7 +323,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 {
 
   smx_process_t process = NULL;
-  int i;
+  unsigned int iter;
   double elapsed_time = 0.0;
   static int state_modifications = 1;
   static int first = 1;
@@ -353,7 +353,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     void *fun = NULL;
     void *arg = NULL;
 
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       if (xbt_swag_size(model->common_public->states.failed_action_set)
          || xbt_swag_size(model->common_public->states.
                           done_action_set)) {
@@ -393,7 +393,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     }
 
     /* Wake up all process waiting for the action finish */
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       while ((action =
              xbt_swag_extract(model->common_public->states.
                               failed_action_set))) {
index f3d3211..fe4348c 100644 (file)
@@ -354,7 +354,7 @@ void surf_init(int *argc, char **argv)
 static char *path_name = NULL;
 FILE *surf_fopen(const char *name, const char *mode)
 {
-  int i;
+  unsigned int iter;
   char *path = NULL;
   FILE *file = NULL;
   unsigned int path_name_len = 0;      /* don't count '\0' */
@@ -374,7 +374,7 @@ FILE *surf_fopen(const char *name, const char *mode)
       path_name = xbt_new0(char, path_name_len + 1);
     }
 
-    xbt_dynar_foreach(surf_path, i, path) {
+    xbt_dynar_foreach(surf_path, iter, path) {
       if (path_name_len < strlen(path) + strlen(name) + 1) {
        path_name_len = strlen(path) + strlen(name) + 1;        /* plus '/' */
        path_name = xbt_realloc(path_name, path_name_len + 1);
@@ -390,10 +390,10 @@ FILE *surf_fopen(const char *name, const char *mode)
 
 void surf_exit(void)
 {
-  int i;
+  unsigned int iter;
   surf_model_t model = NULL;
 
-  xbt_dynar_foreach(model_list, i, model) {
+  xbt_dynar_foreach(model_list, iter, model) {
     model->common_private->finalize();
   }
 
@@ -433,7 +433,7 @@ double surf_solve(void)
   surf_model_object_t model_obj = NULL;
   surf_model_t model = NULL;
   tmgr_trace_event_t event = NULL;
-  int i;
+  unsigned int iter;
 
   if (first_run) {
     DEBUG0
@@ -449,7 +449,7 @@ double surf_solve(void)
            update_resource_state(model_obj, event, value);
       }
     }
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       model->common_private->update_actions_state(NOW, 0.0);
     }
     first_run = 0;
@@ -459,7 +459,7 @@ double surf_solve(void)
   min = -1.0;
 
   DEBUG0("Looking for next action end");
-  xbt_dynar_foreach(model_list, i, model) {
+  xbt_dynar_foreach(model_list, iter, model) {
     DEBUG1("Running for Resource [%s]", model->common_public->name);
     model_next_action_end =
        model->common_private->share_resources(NOW);
@@ -502,7 +502,7 @@ double surf_solve(void)
 
   NOW = NOW + min;
 
-  xbt_dynar_foreach(model_list, i, model) {
+  xbt_dynar_foreach(model_list, iter, model) {
     model->common_private->update_actions_state(NOW, min);
   }
 
index 4d6239a..955057c 100644 (file)
@@ -312,7 +312,7 @@ void surfxml_add_callback(xbt_dynar_t cb_list, void_f_void_t function)
 
 static XBT_INLINE void surfxml_call_cb_functions(xbt_dynar_t cb_list)
 {
-  int iterator;
+  unsigned int iterator;
   void_f_void_t fun;
   xbt_dynar_foreach(cb_list, iterator, fun){
        DEBUG2("call %p %p",fun,*fun);
index 9d199f7..cb88ec0 100644 (file)
@@ -132,7 +132,7 @@ void tmgr_trace_free(tmgr_trace_t trace)
 
 tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h,
                                          tmgr_trace_t trace,
-                                         double start_time, int offset,
+                                         double start_time, unsigned int offset,
                                          void *model)
 {
   tmgr_trace_event_t trace_event = NULL;
@@ -142,7 +142,7 @@ tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h,
   trace_event->idx = offset;
   trace_event->model = model;
 
-  xbt_assert0((trace_event->idx < (int)xbt_dynar_length(trace->event_list)),
+  xbt_assert0((trace_event->idx < xbt_dynar_length(trace->event_list)),
              "You're refering to an event that does not exist!");
 
   xbt_heap_push(h->heap, trace_event, start_time);
@@ -180,7 +180,7 @@ tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h,
   *value = event->value;
   *model = trace_event->model;
 
-  if (trace_event->idx < (int)xbt_dynar_length(trace->event_list) - 1) {
+  if (trace_event->idx < xbt_dynar_length(trace->event_list) - 1) {
     xbt_heap_push(h->heap, trace_event, event_date + event->delta);
     trace_event->idx++;
   } else if (event->delta > 0) {       /* Last element, checking for periodicity */
index a8e01c9..972002a 100644 (file)
@@ -23,7 +23,7 @@ typedef struct tmgr_trace {
 
 typedef struct tmgr_trace_event {
   tmgr_trace_t trace;
-  int idx;
+  unsigned int idx;
   void *model;
 } s_tmgr_trace_event_t;
 
index 9dcb5ae..727c460 100644 (file)
@@ -109,7 +109,7 @@ static lmm_system_t maxmin_system = NULL;
 /* convenient function */
 static void __update_cpu_usage(cpu_KCCFLN05_t cpu)
 {
-  int cpt;
+  unsigned int cpt;
   surf_action_workstation_KCCFLN05_t action = NULL;
   if ((!xbt_dynar_length(cpu->incomming_communications)) &&
       (!xbt_dynar_length(cpu->outgoing_communications))) {
@@ -209,7 +209,7 @@ static void action_use(surf_action_t action)
 
 static int action_free(surf_action_t action)
 {
-  int cpt;
+  unsigned int cpt;
   surf_action_t act = NULL;
   cpu_KCCFLN05_t src = ((surf_action_workstation_KCCFLN05_t) action)->src;
   cpu_KCCFLN05_t dst = ((surf_action_workstation_KCCFLN05_t) action)->dst;
index 6411ad5..793d9a1 100644 (file)
@@ -796,7 +796,8 @@ xbt_cfg_set_peer(xbt_cfg_t cfg,const char*name,
 void xbt_cfg_rm_int(xbt_cfg_t cfg,const char*name, int val) {
 
   xbt_cfgelm_t variable;
-  int cpt,seen;
+  unsigned int cpt;
+  int seen;
 
   variable = xbt_cfgelm_get(cfg,name,xbt_cfgelm_int);
   
@@ -826,7 +827,7 @@ void xbt_cfg_rm_int(xbt_cfg_t cfg,const char*name, int val) {
 
 void xbt_cfg_rm_double(xbt_cfg_t cfg,const char*name, double val) {
   xbt_cfgelm_t variable;
-  int cpt;
+  unsigned int cpt;
   double seen;
 
   variable = xbt_cfgelm_get(cfg,name,xbt_cfgelm_double);
@@ -858,7 +859,7 @@ void xbt_cfg_rm_double(xbt_cfg_t cfg,const char*name, double val) {
 void
 xbt_cfg_rm_string(xbt_cfg_t cfg,const char*name, const char *val) {
   xbt_cfgelm_t variable;
-  int cpt;
+  unsigned int cpt;
   char *seen;
 
   variable = xbt_cfgelm_get(cfg,name,xbt_cfgelm_string);
@@ -892,7 +893,7 @@ xbt_cfg_rm_string(xbt_cfg_t cfg,const char*name, const char *val) {
 void
 xbt_cfg_rm_peer(xbt_cfg_t cfg,const char*name, const char *peer,int port) {
   xbt_cfgelm_t variable;
-  int cpt;
+  unsigned int cpt;
   xbt_peer_t seen;
 
   variable = xbt_cfgelm_get(cfg,name,xbt_cfgelm_peer);
@@ -956,7 +957,7 @@ xbt_cfg_empty(xbt_cfg_t cfg,const char*name) {
 
   if (variable) {
     if (variable->cb_rm) {
-      int cpt;
+      unsigned int cpt;
       void *ignored;
       xbt_dynar_foreach(variable->content,cpt,ignored) {
         (*variable->cb_rm)(name, cpt);
index a1718c9..010eec3 100644 (file)
@@ -72,7 +72,7 @@ typedef struct s_xbt_test_test {
 static void xbt_test_test_dump(xbt_test_test_t test){
   if (test) {
     xbt_test_log_t log;
-    int it_log;
+    unsigned int it_log;
     fprintf(stderr,"    test %p(%s:%d)=%s (%s)\n",
            test,test->file,test->line,test->title,
            test->failed?"failed":"not failed");
@@ -100,7 +100,7 @@ struct s_xbt_test_unit {
 static void xbt_test_unit_dump(xbt_test_unit_t unit) {
   if (unit) {
     xbt_test_test_t test;
-    int it_test;
+    unsigned int it_test;
     fprintf(stderr,"  UNIT %s: %s (%s)\n",
            unit->name,unit->title,
            (unit->enabled?"enabled":"disabled"));
@@ -158,7 +158,7 @@ xbt_test_suite_t xbt_test_suite_new(const char *name, const char *fmt, ...) {
 /** @brief retrieve a testsuite from name, or create a new one */
 xbt_test_suite_t xbt_test_suite_by_name(const char *name,const char *fmt, ...) {
   xbt_test_suite_t suite;
-  int it_suite;
+  unsigned int it_suite;
 
   char *bufname;
   va_list ap;
@@ -180,7 +180,7 @@ xbt_test_suite_t xbt_test_suite_by_name(const char *name,const char *fmt, ...) {
 void xbt_test_suite_dump(xbt_test_suite_t suite) {
   if (suite) {
     xbt_test_unit_t unit;
-    int it_unit;
+    unsigned int it_unit;
     fprintf(stderr,"TESTSUITE %s: %s (%s)\n",
            suite->name, suite->title,
            suite->enabled?"enabled":"disabled");
@@ -225,7 +225,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) {
   const char *file;
   int line;
   char *cp;
-  int it_unit,it_test,it_log;
+  unsigned int it_unit,it_test,it_log;
 
   int first=1; /* for result pretty printing */
 
@@ -251,7 +251,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) {
     suite_title[40 + (suite_len+5)/2] = '=';
     if (!suite->enabled) 
       sprintf(suite_title+ 70," DISABLED ");
-    fprintf(stderr, "\n%s",suite_title);
+    fprintf(stderr, "\n%s\n",suite_title);
   }
 
   if (suite->enabled) {        
@@ -430,10 +430,10 @@ static void apply_selection(char *selection) {
   int done = 0;
   char dir[1024]; /* the directive */
   /* iterators */
-  int it_suite;
+  unsigned int it_suite;
   xbt_test_suite_t suite;
   xbt_test_unit_t unit;
-  int it_unit;
+  unsigned int it_unit;
 
   char suitename[512];
   char unitname[512];
@@ -537,7 +537,7 @@ void xbt_test_dump(char *selection) {
   apply_selection(selection);
 
   if (_xbt_test_suites) {
-    int it_suite;
+    unsigned int it_suite;
     xbt_test_suite_t suite;
 
     xbt_dynar_foreach(_xbt_test_suites,it_suite,suite) 
@@ -551,7 +551,7 @@ int xbt_test_run(char *selection) {
   apply_selection(selection);
 
   if (_xbt_test_suites) {
-    int it_suite;
+    unsigned int it_suite;
     xbt_test_suite_t suite;
     int first=1;
     
index df4f0bc..f6b45ce 100644 (file)
@@ -503,7 +503,7 @@ xbt_dynar_remove_at(xbt_dynar_t  const dynar,
                      void         * const object) {
 
   _dynar_lock(dynar);
-       _xbt_dynar_remove_at(dynar, idx, object);
+  _xbt_dynar_remove_at(dynar, idx, object);
   _dynar_unlock(dynar);
 }
 
@@ -658,7 +658,7 @@ xbt_dynar_map(const xbt_dynar_t  dynar,
  */
 void
 _xbt_dynar_cursor_first(const xbt_dynar_t dynar,
-                      int        * const cursor) {
+                      unsigned int * const cursor) {
 
   _dynar_lock(dynar);
   DEBUG1("Set cursor on %p to the first position",(void*)dynar);
@@ -671,7 +671,7 @@ _xbt_dynar_cursor_first(const xbt_dynar_t dynar,
  */
 void
 _xbt_dynar_cursor_step(const xbt_dynar_t dynar,
-                      int        * const cursor) {
+                      unsigned int * const cursor) {
   
   (*cursor)++;
 }
@@ -682,7 +682,7 @@ _xbt_dynar_cursor_step(const xbt_dynar_t dynar,
  */
 int
 _xbt_dynar_cursor_get(const xbt_dynar_t dynar,
-                     int                * const cursor,
+                     unsigned int  * const cursor,
                      void               * const dst) {
 
   _sanity_check_dynar(dynar);
@@ -708,7 +708,7 @@ _xbt_dynar_cursor_get(const xbt_dynar_t dynar,
  * This function can be used while traversing without problem.
  */
 void xbt_dynar_cursor_rm(xbt_dynar_t dynar,
-                         int          * const cursor) {
+                        unsigned int * const cursor) {
   
   _xbt_dynar_remove_at(dynar,(*cursor)--,NULL);
 }
@@ -734,7 +734,8 @@ XBT_LOG_DEFAULT_CATEGORY(xbt_dyn);
 XBT_TEST_UNIT("int",test_dynar_int,"Dynars of integers") {
    /* Vars_decl [doxygen cruft] */
    xbt_dynar_t d;
-   int i,cpt,cursor;
+   int i,cpt;
+   unsigned int cursor;
    int *iptr;
    
    xbt_test_add0("==== Traverse the empty dynar");
@@ -879,7 +880,8 @@ XBT_TEST_UNIT("int",test_dynar_int,"Dynars of integers") {
 /*******************************************************************************/
 XBT_TEST_UNIT("double",test_dynar_double,"Dynars of doubles") {
    xbt_dynar_t d;
-   int cpt,cursor;
+   int cpt;
+   unsigned int cursor;
    double d1,d2;
    
    xbt_test_add0("==== Traverse the empty dynar");
@@ -1000,12 +1002,13 @@ static void free_string(void *d){
 XBT_TEST_UNIT("string",test_dynar_string,"Dyars of strings") {
    xbt_dynar_t d;
    int cpt;
+   unsigned int iter;
    char buf[1024];
    char *s1,*s2;
    
    xbt_test_add0("==== Traverse the empty dynar");
    d=xbt_dynar_new(sizeof(char *),&free_string);
-   xbt_dynar_foreach(d,cpt,s1){
+   xbt_dynar_foreach(d,iter,s1){
      xbt_test_assert0(FALSE,
                  "Damnit, there is something in the empty dynar");
    }
@@ -1056,8 +1059,8 @@ XBT_TEST_UNIT("string",test_dynar_string,"Dyars of strings") {
      xbt_dynar_unshift(d,&s1);
    }
    /* 2. Traverse the dynar with the macro */
-   xbt_dynar_foreach(d,cpt,s1) {
-     sprintf(buf,"%d",NB_ELEM - cpt -1);
+   xbt_dynar_foreach(d,iter,s1) {
+     sprintf(buf,"%d",NB_ELEM - iter -1);
      xbt_test_assert2 (!strcmp(buf,s1),
            "The retrieved value is not the same than the injected one (%s!=%s)",
               buf,s1);
index 9004110..58046be 100644 (file)
@@ -120,7 +120,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t *e)  {
     for (i=0; environ[i]; i++) {
       if (!strncmp("PATH=",environ[i], 5)) {   
        xbt_dynar_t path=xbt_str_split(environ[i] + 5, ":");
-       int cpt;
+       unsigned int cpt;
        char *data;
        xbt_dynar_foreach(path, cpt, data) {
          if (binary_name)
index 27910e5..464dad4 100644 (file)
@@ -83,7 +83,7 @@ xbt_edge_t xbt_graph_new_edge(xbt_graph_t g,
 xbt_edge_t xbt_graph_get_edge(xbt_graph_t g, xbt_node_t src, xbt_node_t dst)
 {
   xbt_edge_t edge;
-  int cursor;
+  unsigned int cursor;
 
   xbt_dynar_foreach(src->out, cursor, edge) {
     DEBUG3("%p = %p--%p",edge,edge->src,edge->dst);
@@ -131,7 +131,7 @@ void xbt_graph_free_graph(xbt_graph_t g,
                          void_f_pvoid_t edge_free_function,
                          void_f_pvoid_t graph_free_function)
 {
-  int cursor = 0;
+  unsigned int cursor = 0;
   xbt_node_t node = NULL;
   xbt_edge_t edge = NULL;
 
@@ -170,7 +170,7 @@ void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n,
 {
   unsigned long nbr;
   unsigned long i;
-  int cursor = 0;
+  unsigned int cursor = 0;
   xbt_node_t node = NULL;
   xbt_edge_t edge = NULL;
 
@@ -206,7 +206,7 @@ void xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e,
                         void_f_pvoid_t free_function)
 {
   int idx;
-  int cursor = 0;
+  unsigned int cursor = 0;
   xbt_edge_t edge = NULL;
 
   if ((free_function) && (e->data))
@@ -235,7 +235,7 @@ void xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e,
 int __xbt_find_in_dynar(xbt_dynar_t dynar, void *p)
 {
 
-  int cursor = 0;
+  unsigned int cursor = 0;
   void *tmp = NULL;
 
   xbt_dynar_foreach(dynar, cursor, tmp) {
@@ -290,8 +290,8 @@ double xbt_graph_edge_get_length(xbt_edge_t e)
  */
 double *xbt_graph_get_length_matrix(xbt_graph_t g)
 {
-  int cursor = 0;
-  int in_cursor = 0;
+  unsigned int cursor = 0;
+  unsigned int in_cursor = 0;
   unsigned long idx, i;
   unsigned long n;
   xbt_edge_t edge = NULL;
@@ -433,7 +433,7 @@ xbt_edge_t *xbt_graph_spanning_tree_prim(xbt_graph_t g)
   xbt_node_t node = NULL;
   xbt_dynar_t edge_list = NULL;
   xbt_heap_t heap = xbt_heap_new(10, NULL);
-  int cursor;
+  unsigned int cursor;
 
   xbt_assert0(!(g->directed),
              "Spanning trees do not make sense on directed graphs");
@@ -489,7 +489,8 @@ xbt_node_t *xbt_graph_topo_sort(xbt_graph_t g)
 {
 
   xbt_node_t *sorted;
-  int cursor, idx;
+  unsigned int cursor;
+  int idx;
   xbt_node_t node;
   unsigned long n;
 
@@ -516,7 +517,7 @@ xbt_node_t *xbt_graph_topo_sort(xbt_graph_t g)
 void xbt_graph_depth_visit(xbt_graph_t g, xbt_node_t n,
                           xbt_node_t * sorted, int *idx)
 {
-  int cursor;
+  unsigned int cursor;
   xbt_edge_t edge;
 
   if (*((int *) (n->xbtdata)) == ALREADY_EXPLORED)
@@ -634,7 +635,7 @@ void xbt_graph_export_graphviz(xbt_graph_t g, const char *filename,
                               const char *(node_name) (xbt_node_t),
                               const char *(edge_name) (xbt_edge_t))
 {
-  int cursor = 0;
+  unsigned int cursor = 0;
   xbt_node_t node = NULL;
   xbt_edge_t edge = NULL;
   FILE *file = NULL;
@@ -680,7 +681,7 @@ void xbt_graph_export_graphxml(xbt_graph_t g, const char *filename,
                               const char *(node_data_print) (void *),
                               const char *(edge_data_print) (void *))
 {
-  int cursor = 0;
+  unsigned int cursor = 0;
   xbt_node_t node = NULL;
   xbt_edge_t edge = NULL;
   FILE *file = NULL;
index d158ee5..19e09b7 100644 (file)
@@ -662,7 +662,7 @@ static void _xbt_log_cat_apply_set(xbt_log_category_t category,
  */
 int _xbt_log_cat_init(xbt_log_category_t category,
                      e_xbt_log_priority_t priority) {
-  int cursor;
+  unsigned int cursor;
   xbt_log_setting_t setting=NULL;
   int found = 0;
   s_xbt_log_event_t _log_ev;
@@ -956,7 +956,7 @@ void xbt_log_control_set(const char* control_string) {
   /* To split the string in commands, and the cursors */
   xbt_dynar_t set_strings;
   char *str;
-  int cpt;
+  unsigned int cpt;
 
   if (!control_string)
     return;
index 90725f8..f62ef1b 100644 (file)
@@ -370,7 +370,7 @@ XBT_TEST_UNIT("xbt_str_split_quoted",test_split_quoted, "test the function xbt_s
 
 char *xbt_str_join(xbt_dynar_t dyn, const char*sep) {
   int len=1,dyn_len=xbt_dynar_length(dyn);
-  int cpt;
+  unsigned int cpt;
   char *cursor;
   char *res,*p;
   
index 762fedb..e068a45 100644 (file)
@@ -81,13 +81,13 @@ void test(char *platform)
   surf_solve();                        /* Takes traces into account. Returns 0.0 */
   do {
     surf_action_t action = NULL;
-    int i;
+    unsigned int iter;
     surf_model_t model = NULL;
 
     now = surf_get_clock();
     DEBUG1("Next Event : " "%g" "\n", now);
 
-    xbt_dynar_foreach(model_list, i, model) {
+    xbt_dynar_foreach(model_list, iter, model) {
       DEBUG1("\t %s actions\n", model->common_public->name);
       while ((action =
             xbt_swag_extract(model->common_public->states.