Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Declare as "unsigned" bit fields used as boolean.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 4 Jun 2012 14:15:16 +0000 (16:15 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 4 Jun 2012 15:34:37 +0000 (17:34 +0200)
Signed bit fields of length 1 do not make much sense.

This is a followup for commit 1377c28e7b9f315616ee6fddc6baa755e0380e75.

include/simgrid/simix.h
src/gras/Virtu/virtu_sg.h
src/simix/smx_private.h
src/simix/smx_process_private.h
src/xbt/config.c
src/xbt/datadesc/datadesc_private.h
src/xbt/datadesc/ddt_parse.c
src/xbt/xbt_sg_synchro.c
src/xbt/xbt_socket_private.h
tools/tesh/run_context.h

index 0bdfbab..f1d989f 100644 (file)
@@ -164,7 +164,7 @@ typedef struct s_smx_context {
   void *data;   /* Here SIMIX stores the smx_process_t containing the context */
   char **argv;
   int argc;
   void *data;   /* Here SIMIX stores the smx_process_t containing the context */
   char **argv;
   int argc;
-  int iwannadie:1;
+  unsigned iwannadie:1;
 } s_smx_ctx_base_t;
 
 /* methods of this class */
 } s_smx_ctx_base_t;
 
 /* methods of this class */
index f4e7bab..7554d19 100644 (file)
@@ -16,7 +16,7 @@
 
 typedef struct {
   int port;                     /* list of ports used by a server socket */
 
 typedef struct {
   int port;                     /* list of ports used by a server socket */
-  int meas:1;                   /* (boolean) the channel is for measurements or for messages */
+  unsigned meas:1;              /* (boolean) the channel is for measurements or for messages */
   smx_process_t server;
   smx_rdv_t rdv;
 } s_gras_sg_portrec_t, *gras_sg_portrec_t;
   smx_process_t server;
   smx_rdv_t rdv;
 } s_gras_sg_portrec_t, *gras_sg_portrec_t;
index a50b31f..4d25f01 100644 (file)
@@ -140,7 +140,7 @@ typedef struct s_smx_action {
       void *dst_buff;
       size_t src_buff_size;
       size_t *dst_buff_size;
       void *dst_buff;
       size_t src_buff_size;
       size_t *dst_buff_size;
-      unsigned int copied:1;          /* whether the data were already copied */
+      unsigned copied:1;              /* whether the data were already copied */
 
       void* src_data;                 /* User data associated to communication */
       void* dst_data;
 
       void* src_data;                 /* User data associated to communication */
       void* dst_data;
index 2b9359b..5365da1 100644 (file)
@@ -22,9 +22,9 @@ typedef struct s_smx_process {
   smx_host_t smx_host;          /* the host on which the process is running */
   smx_context_t context;        /* the context (either uctx or thread) that executes the user function */
   xbt_running_ctx_t *running_ctx;
   smx_host_t smx_host;          /* the host on which the process is running */
   smx_context_t context;        /* the context (either uctx or thread) that executes the user function */
   xbt_running_ctx_t *running_ctx;
-  int doexception:1;
-  int blocked:1;
-  int suspended:1;
+  unsigned doexception:1;
+  unsigned blocked:1;
+  unsigned suspended:1;
   smx_host_t new_host;          /* if not null, the host on which the process must migrate to */
   smx_action_t waiting_action;  /* the current blocking action if any */
   xbt_fifo_t comms;       /* the current non-blocking communication actions */
   smx_host_t new_host;          /* if not null, the host on which the process must migrate to */
   smx_action_t waiting_action;  /* the current blocking action if any */
   xbt_fifo_t comms;       /* the current non-blocking communication actions */
index 8bc054a..87418cd 100644 (file)
@@ -33,7 +33,7 @@ typedef struct {
   /* Allowed type of the variable */
   e_xbt_cfgelm_type_t type;
   int min, max;
   /* Allowed type of the variable */
   e_xbt_cfgelm_type_t type;
   int min, max;
-  int isdefault:1;
+  unsigned isdefault:1;
 
   /* Callbacks */
   xbt_cfg_cb_t cb_set;
 
   /* Callbacks */
   xbt_cfg_cb_t cb_set;
index 0c1c802..1faf92e 100644 (file)
@@ -216,7 +216,7 @@ typedef struct s_xbt_datadesc_type {
   xbt_datadesc_type_cb_void_t recv;
 
   /* flags */
   xbt_datadesc_type_cb_void_t recv;
 
   /* flags */
-  int cycle:1;
+  unsigned cycle:1;
 
   /* random value for users (like default value or whatever) */
   char extra[SIZEOF_MAX];
 
   /* random value for users (like default value or whatever) */
   char extra[SIZEOF_MAX];
index a3f4694..166b5b7 100644 (file)
@@ -17,14 +17,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ddt_parse, xbt_ddt,
 
 typedef struct s_type_modifier {
   short is_long;
 
 typedef struct s_type_modifier {
   short is_long;
-  int is_unsigned:1;
-  int is_short:1;
+  unsigned is_unsigned:1;
+  unsigned is_short:1;
 
 
-  int is_struct:1;
-  int is_union:1;
-  int is_enum:1;
+  unsigned is_struct:1;
+  unsigned is_union:1;
+  unsigned is_enum:1;
 
 
-  int is_ref:1;
+  unsigned is_ref:1;
 
   int is_dynar:2;
   int is_matrix:2;
 
   int is_dynar:2;
   int is_matrix:2;
index d485ba3..e9bbaeb 100644 (file)
@@ -28,7 +28,7 @@ typedef struct s_xbt_thread_ {
   void *userparam;
   void *father_data;
   /* stuff to allow other people to wait on me with xbt_thread_join */
   void *userparam;
   void *father_data;
   /* stuff to allow other people to wait on me with xbt_thread_join */
-  int joinable:1, done:1;
+  unsigned joinable:1, done:1;
   xbt_cond_t cond;
   xbt_mutex_t mutex;
 } s_xbt_thread_t;
   xbt_cond_t cond;
   xbt_mutex_t mutex;
 } s_xbt_thread_t;
index bf74ce8..5816b17 100644 (file)
@@ -28,12 +28,12 @@ typedef struct s_xbt_socket {
 
   xbt_trp_plugin_t plugin;
 
 
   xbt_trp_plugin_t plugin;
 
-  int incoming:1;               /* true if we can read from this sock */
-  int outgoing:1;               /* true if we can write on this sock */
-  int accepting:1;              /* true if master incoming sock in tcp */
-  int meas:1;                   /* true if this is an experiment socket instead of messaging */
-  int valid:1;                  /* false if a select returned that the peer has left, forcing us to "close" the socket */
-  int moredata:1;               /* TCP socket use a buffer and read operation get as much 
+  unsigned incoming:1;          /* true if we can read from this sock */
+  unsigned outgoing:1;          /* true if we can write on this sock */
+  unsigned accepting:1;         /* true if master incoming sock in tcp */
+  unsigned meas:1;              /* true if this is an experiment socket instead of messaging */
+  unsigned valid:1;             /* false if a select returned that the peer has left, forcing us to "close" the socket */
+  unsigned moredata:1;          /* TCP socket use a buffer and read operation get as much 
                                    data as possible. It is possible that several messages
                                    are received in one shoot, and select won't catch them 
                                    afterward again. 
                                    data as possible. It is possible that several messages
                                    are received in one shoot, and select won't catch them 
                                    afterward again. 
@@ -42,7 +42,7 @@ typedef struct s_xbt_socket {
                                    sockets are not concerned since they use the TCP
                                    interface directly, with no buffer. */
 
                                    sockets are not concerned since they use the TCP
                                    interface directly, with no buffer. */
 
-  int recvd:1;                  /* true if the recvd_val field contains one byte of the stream (that we peek'ed to check the socket validity) */
+  unsigned recvd:1;             /* true if the recvd_val field contains one byte of the stream (that we peek'ed to check the socket validity) */
   char recvd_val;               /* what we peeked from the socket, if any */
 
   int refcount;                 /* refcounting on shared sockets */
   char recvd_val;               /* what we peeked from the socket, if any */
 
   int refcount;                 /* refcounting on shared sockets */
index 7721e3e..d888d84 100644 (file)
@@ -23,18 +23,18 @@ typedef struct {
   int env_size;
   char *filepos;
   int pid;
   int env_size;
   char *filepos;
   int pid;
-  int is_background:1;
-  int is_empty:1;
-  int is_stoppable:1;
+  unsigned is_background:1;
+  unsigned is_empty:1;
+  unsigned is_stoppable:1;
 
 
-  int brokenpipe:1;
-  int timeout:1;
+  unsigned brokenpipe:1;
+  unsigned timeout:1;
 
 
-  int reader_done:1;            /* reader set this to true when he's done because
+  unsigned reader_done:1;       /* reader set this to true when he's done because
                                    the child is dead. The main thread use it to detect
                                    that the child is not dead before the end of timeout */
 
                                    the child is dead. The main thread use it to detect
                                    that the child is not dead before the end of timeout */
 
-  int interrupted:1;            /* Whether we got stopped by an armageddon */
+  unsigned interrupted:1;       /* Whether we got stopped by an armageddon */
   xbt_os_mutex_t interruption;  /* To allow main thread to kill a runner
                                    one only at certain points */
 
   xbt_os_mutex_t interruption;  /* To allow main thread to kill a runner
                                    one only at certain points */
 
@@ -46,7 +46,7 @@ typedef struct {
   int end_time;                 /* begin_time + timeout, as epoch */
   char *expected_signal;        /* name of signal to raise (or NULL if none) */
   int expected_return;          /* the exepeted return code of following command */
   int end_time;                 /* begin_time + timeout, as epoch */
   char *expected_signal;        /* name of signal to raise (or NULL if none) */
   int expected_return;          /* the exepeted return code of following command */
-  int output_sort:1;            /* whether the output must be sorted before comparison */
+  unsigned output_sort:1;       /* whether the output must be sorted before comparison */
 
   /* buffers */
   xbt_strbuff_t input;
 
   /* buffers */
   xbt_strbuff_t input;