X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=hashtable.h;h=a15265bafbe7f1b7658c4ddbcb8bcb8b6175a124;hb=360053ccc0b524d1a902a6e0a4f91fb4889311f9;hp=016d4925215c7158f0dc7267d5c2a6136668850e;hpb=14e0cf70049e2f98019b66559baccbd5c29554c4;p=model-checker.git diff --git a/hashtable.h b/hashtable.h index 016d492..a15265b 100644 --- a/hashtable.h +++ b/hashtable.h @@ -109,7 +109,7 @@ template> _Shift; do { - index = index & capacitymask; + index &= capacitymask; search = &table[index]; if (search->key == key) { search->val = val; @@ -129,11 +129,10 @@ template> _Shift; do { - index = index&capacitymask; + index &= capacitymask; search = &table[index]; - if (search->key == key) { + if (search->key == key) return search->val; - } index++; } while (search->key); return (_Val) 0; @@ -145,11 +144,10 @@ template> _Shift; do { - index = index & capacitymask; + index &= capacitymask; search = &table[index]; - if (search->key == key) { + if (search->key == key) return true; - } index++; } while (search->key); return false; @@ -162,8 +160,8 @@ template *) _calloc(newsize, sizeof(struct hashlistnode<_Key, _Val>))) == NULL) { - model_print("Calloc error %s %d\n", __FILE__, __LINE__); - exit(-1); + model_print("calloc error %s %d\n", __FILE__, __LINE__); + exit(EXIT_FAILURE); } table = newtable; //Update the global hashtable upon resize() @@ -181,7 +179,7 @@ template> _Shift; do { - index = index & capacitymask; + index &= capacitymask; search = &table[index]; index++; } while (search->key);