4bd8d0793488ed896bf604d1ce7252fd601df161 kent Sat Dec 19 11:25:30 2020 -0800 Making hashIncInt return the value (after increment, rather than be void. diff --git src/inc/hash.h src/inc/hash.h index 22dc124..c892802 100644 --- src/inc/hash.h +++ src/inc/hash.h @@ -153,32 +153,32 @@ /* Lookup name in hash and return val. Abort if not found. */ void *hashFindVal(struct hash *hash, char *name); /* Look up name in hash and return val or NULL if not found. */ void *hashOptionalVal(struct hash *hash, char *name, void *usual); /* Look up name in hash and return val, or usual if not found. */ void *hashFindValUpperCase(struct hash *hash, char *name); /* Lookup upper cased name in hash and return val or return NULL if not found. * (Assumes all elements of hash are themselves already in upper case.) */ struct hashEl *hashAddInt(struct hash *hash, char *name, int val); /* Store integer value in hash */ -void hashIncInt(struct hash *hash, char *name); -/* Increment integer value in hash */ +int hashIncInt(struct hash *hash, char *name); +/* Increment integer value in hash. Return value after increment. */ int hashIntVal(struct hash *hash, char *name); /* Return integer value associated with name in a simple * hash of ints. */ int hashIntValDefault(struct hash *hash, char *name, int defaultInt); /* Return integer value associated with name in a simple * hash of ints or defaultInt if not found. */ long long hashIntSum(struct hash *hash); /* Return sum of all the ints in a hash of ints. */ void hashIntReset(struct hash *hash); /* Reset all values in hash of ints to 0. Reset element count to 0. */