From e4d9594065dd6626378e04e52c080942b0e4c9fd Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Mon, 14 Oct 2024 12:13:19 +0200 Subject: [PATCH] small cosmetic changes in hash tables (initialization of next pointer) --- src/hilight.c | 2 +- src/node_hash.c | 2 +- src/spice_netlist.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hilight.c b/src/hilight.c index 5c6fd02f..8202e83c 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -84,8 +84,8 @@ static Hilight_hashentry *hilight_hash_lookup(const char *token, int value, int if(token==NULL) return NULL; hashcode=hi_hash(token); index=hashcode % HASHSIZE; - entry=xctx->hilight_table[index]; preventry=&xctx->hilight_table[index]; + entry=*preventry; while(1) { if( !entry ) { /* empty slot */ size_t lent = strlen(token) + 1; diff --git a/src/node_hash.c b/src/node_hash.c index 925b6fbe..f2b54c00 100644 --- a/src/node_hash.c +++ b/src/node_hash.c @@ -50,8 +50,8 @@ static Node_hashentry *node_hash_lookup(const char *token, const char *dir,int w d.port=port; hashcode=str_hash(token); index=hashcode % HASHSIZE; - entry=xctx->node_table[index]; preventry=&xctx->node_table[index]; + entry=*preventry; while(1) { if( !entry ) /* empty slot */ diff --git a/src/spice_netlist.c b/src/spice_netlist.c index 1e7863d7..a847f3dc 100644 --- a/src/spice_netlist.c +++ b/src/spice_netlist.c @@ -720,8 +720,8 @@ Str_hashentry *str_hash_lookup(Str_hashtable *hashtable, const char *token, cons if(token==NULL || size == 0 || table == NULL) return NULL; hashcode=str_hash(token); idx=hashcode % size; - entry=table[idx]; preventry=&table[idx]; + entry=*preventry; while(1) { if( !entry ) /* empty slot */ @@ -821,8 +821,8 @@ Int_hashentry *int_hash_lookup(Int_hashtable *hashtable, const char *token, cons if(token==NULL || size == 0 || table == NULL) return NULL; hashcode=str_hash(token); idx=hashcode % size; - entry=table[idx]; preventry=&table[idx]; + entry=*preventry; while(1) { if( !entry ) /* empty slot */ @@ -921,8 +921,8 @@ Ptr_hashentry *ptr_hash_lookup(Ptr_hashtable *hashtable, const char *token, void if(token==NULL || size == 0 || table == NULL) return NULL; hashcode=str_hash(token); idx=hashcode % size; - entry=table[idx]; preventry=&table[idx]; + entry=*preventry; while(1) { if( !entry ) /* empty slot */