diff --git a/supportApp/netCDFSrc/libdispatch/drc.c b/supportApp/netCDFSrc/libdispatch/drc.c index e2de99d..d5f8fc2 100644 --- a/supportApp/netCDFSrc/libdispatch/drc.c +++ b/supportApp/netCDFSrc/libdispatch/drc.c @@ -366,9 +366,10 @@ rclocate(const char* key, const char* hostport) if(hostport == NULL) hostport = ""; for(found=0,i=0;ihost == NULL ? 0 : strlen(triple->host)); int t; + size_t hplen; + triple = (NCTriple*)nclistget(rc,i); + hplen = (triple->host == NULL ? 0 : strlen(triple->host)); if(strcmp(key,triple->key) != 0) continue; /* keys do not match */ /* If the triple entry has no url, then use it (because we have checked all other cases)*/ diff --git a/supportApp/netCDFSrc/libdispatch/nchashmap.c b/supportApp/netCDFSrc/libdispatch/nchashmap.c index 584c0b1..41a88d3 100644 --- a/supportApp/netCDFSrc/libdispatch/nchashmap.c +++ b/supportApp/netCDFSrc/libdispatch/nchashmap.c @@ -145,6 +145,8 @@ NC_hashmapnew(size_t startsize) int NC_hashmapadd(NC_hashmap* hash, void* data, const char* key) { + NC_hentry* entry; + if(hash->size*3/4 <= hash->count) rehash(hash); @@ -154,7 +156,7 @@ NC_hashmapadd(NC_hashmap* hash, void* data, const char* key) rehash(hash); continue; /* try on larger table */ } - NC_hentry* entry = &hash->table[index]; + entry = &hash->table[index]; if(entry->flags & ACTIVE) { /* key already exists in table => overwrite */ entry->data = data; @@ -263,8 +265,9 @@ findPrimeGreaterThan(size_t val) v = (unsigned int)val; for(;;) { + int m; if(L >= R) break; - int m = (L + R) / 2; + m = (L + R) / 2; /* is this an acceptable prime? */ if(NC_primes[m-1] < v && NC_primes[m] >= v) return NC_primes[m]; /* acceptable*/