Browse Source

uthash: initialize variables (sonarqube code smell)

Nathalie Furmento 7 years ago
parent
commit
6f861d82c4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      sc_hypervisor/src/uthash.h
  2. 1 1
      src/common/uthash.h

+ 1 - 1
sc_hypervisor/src/uthash.h

@@ -81,7 +81,7 @@ typedef unsigned int uint32_t;
 
 #define HASH_FIND(hh,head,keyptr,keylen,out)                                     \
 do {                                                                             \
-  unsigned _hf_bkt,_hf_hashv;                                                    \
+  unsigned _hf_bkt=0,_hf_hashv=0;                                                \
   out=NULL;                                                                      \
   if (head) {                                                                    \
      HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \

+ 1 - 1
src/common/uthash.h

@@ -81,7 +81,7 @@ typedef unsigned int uint32_t;
 
 #define HASH_FIND(hh,head,keyptr,keylen,out)                                     \
 do {                                                                             \
-  unsigned _hf_bkt,_hf_hashv;                                                    \
+  unsigned _hf_bkt=0,_hf_hashv=0;					         \
   out=NULL;                                                                      \
   if (head) {                                                                    \
      HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \