more c89 conformance

variables should be declared at the beginning of functions
This commit is contained in:
Elad Salomons
2015-06-13 00:01:30 +03:00
parent 79fb7ab9a4
commit 82da5db7ec
3 changed files with 9 additions and 7 deletions

View File

@@ -30,11 +30,12 @@ unsigned int _enHash(char *str);
unsigned int _enHash(char *str)
{
unsigned int hash = 5381;
unsigned int retHash;
int c;
while ((c = *str++)) {
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
unsigned int retHash = hash % ENHASHTABLEMAXSIZE;
retHash = hash % ENHASHTABLEMAXSIZE;
return retHash;
}