Custom Query (541 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (28 - 30 of 541)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Ticket Resolution Summary Owner Reporter
#465 fixed Comparison between signed and unsigned integer expressions in four src/data_sources/k2ew source files somebody baker
Description

Four source files in src/data_sources/k2ew generate warnings for comparisons between signed and unsigned expressions: getconfig.c, k2misc.c, k2pktio.c, and k2c_tcp.c:

• src/data_sources/k2ew/getconfig.c:

getconfig.c: In function 'get_config':
getconfig.c:351:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
getconfig.c:381:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
getconfig.c:411:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The simplest fix is to cast (signed?) len as size_t:

--- src/data_sources/k2ew/getconfig.c
+++ src/data_sources/k2ew/getconfig.c
@@ -350,3 +350,4 @@
               {    /* still data remaining to process */
-                if(len >= sizeof(channel_names_str))  /* if too long then */
+                if ( (size_t) len >= sizeof( channel_names_str ) )
+                                                      /* if too long then */
                   len = sizeof(channel_names_str)-1;  /* shorten length */
@@ -380,3 +381,4 @@
               {    /* still data remaining to process */
-                if(len >= sizeof(location_names_str))  /* if too long then */
+                if ( (size_t) len >= sizeof( location_names_str ) )
+                                                       /* if too long then */
                   len = sizeof(location_names_str)-1;  /* shorten length */
@@ -410,3 +412,4 @@
               {    /* still data remaining to process */
-                if(len >= sizeof(invpol_flags_str))   /* if too long then */
+                if ( (size_t) len >= sizeof( invpol_flags_str ) )
+                                                      /* if too long then */
                   len = sizeof(invpol_flags_str)-1;   /* shorten length */

• src/data_sources/k2ew/k2misc.c:

k2misc.c: In function 'k2mi_init_blkmde':
k2misc.c:251:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
k2misc.c: In function 'k2mi_force_blkmde':
k2misc.c:399:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The fix is to declare the index variable, idx, as unsigned int:

--- src/data_sources/k2ew/k2misc.c
+++ src/data_sources/k2ew/k2misc.c
@@ -179,3 +179,4 @@
   int monmde_count = K2MI_MONMODE_MAX;
-  int idx, dcnt, slen, rc1, rc2;
+  int dcnt, slen, rc1, rc2;
+  unsigned int idx;
   static const char *monmde_str_arr[]={          /* monitor-mode strings */
@@ -243,3 +244,3 @@
       if (gcfg_debug > 2)
-        logit("e", "sending MM %d\n", idx);
+        logit("e", "sending MM %u\n", idx);
 
@@ -348,3 +349,4 @@
   int monmde_count = K2MI_MONMODE_MAX;
-  int idx, dcnt, slen, rc1;
+  int dcnt, slen, rc1;
+  unsigned int idx;
   static const char *monmde_str_arr[]={          /* monitor-mode strings */
@@ -391,3 +393,3 @@
       if (gcfg_debug > 2)
-        logit("et", "k2mi_force_blkmde: sending MM %d - string '%s'\n", idx, monmde_str_arr[idx]);
+        logit("et", "k2mi_force_blkmde: sending MM %u - string '%s'\n", idx, monmde_str_arr[idx]);
 

• src/data_sources/k2ew/k2pktio.c:

k2pktio.c:291:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
k2pktio.c:323:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The simplest fix is to cast (signed) msgcnt and spos as size_t, though msgcnt, spos, and dpos should really be unsigned ints:

--- src/data_sources/k2ew/k2pktio.c
+++ src/data_sources/k2ew/k2pktio.c
@@ -290,3 +290,4 @@
   }
-  while(msgcnt < sizeof(*phdrblk)+3);  /* loop if size too small for packet */
+  /* loop while size too small for packet */
+  while ( (size_t) msgcnt < ( sizeof( *phdrblk ) + 3 ) );
 
@@ -322,3 +323,4 @@
   }
-  while(++spos < sizeof(*phdrblk));         /* loop until header filled */
+  /* loop until header filled */
+  while ( (size_t) ++spos < sizeof( *phdrblk ) );
 

• src/data_sources/k2ew/k2c_tcp.c:

k2c_tcp.c: In function 'k2c_init_io':
k2c_tcp.c:130:56: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The fix is to declare addr properly; the type returned by inet_addr() is in_addr_t:

--- src/data_sources/k2ew/k2c_tcp.c
+++ src/data_sources/k2ew/k2c_tcp.c
@@ -105,3 +105,4 @@
 {
-  int addr, error;
+  int error;
+  in_addr_t addr;
   struct hostent* hp;
#57 fixed Confirm Memphis Test somebody stefan
Description

Confirm beta 7.4 Memphis test results for all platforms.

#69 fixed Contrib bundle (release a new copy, freeze CVS, convert to SVN project) somebody paulf
Description

The EW Contrib bundle needs to be moved to SVN too....etc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Note: See TracQuery for help on using queries.