Browse Source

uthash: add error message

Nathalie Furmento 6 years ago
parent
commit
43d5671900
2 changed files with 4 additions and 4 deletions
  1. 3 3
      sc_hypervisor/src/uthash.h
  2. 1 1
      src/common/uthash.h

+ 3 - 3
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=0,_hf_hashv=0;                                                \
+  unsigned _hf_bkt=0,_hf_hashv=0;					         \
   out=NULL;                                                                      \
   if (head) {                                                                    \
      HASH_FCN(keyptr,keylen, (head)->hh.tbl->num_buckets, _hf_hashv, _hf_bkt);   \
@@ -153,7 +153,7 @@ do {
 do {                                                                             \
   __typeof__(out) _out;                                                          \
   HASH_FIND(hh,head,keyptr,keylen,_out);                                         \
-  STARPU_ASSERT(!_out);                                                          \
+  STARPU_ASSERT_MSG(!_out,"Cannot insert the same key twice"); 			 \
 } while(0)
 #else
 #define HASH_CHECK_KEY(hh,head,keyptr,keylen,out)
@@ -161,7 +161,7 @@ do {
 
 #define HASH_ADD_KEYPTR(hh,head,keyptr,keylen_in,add)                            \
 do {                                                                             \
- unsigned _ha_bkt;                                                               \
+ unsigned _ha_bkt=0;							 	 \
  HASH_CHECK_KEY(hh,head,keyptr,keylen_in,add);                                   \
  (add)->hh.next = NULL;                                                          \
  (add)->hh.key = (char*)keyptr;                                                  \

+ 1 - 1
src/common/uthash.h

@@ -153,7 +153,7 @@ do {
 do {                                                                             \
   __typeof__(out) _out;                                                          \
   HASH_FIND(hh,head,keyptr,keylen,_out);                                         \
-  STARPU_ASSERT(!_out);                                                          \
+  STARPU_ASSERT_MSG(!_out,"Cannot insert the same key twice"); 			 \
 } while(0)
 #else
 #define HASH_CHECK_KEY(hh,head,keyptr,keylen,out)