Start replay loading
This commit is contained in:
parent
71aa8156e9
commit
17a371fdca
4 changed files with 169 additions and 16 deletions
22
general.h
22
general.h
|
@ -42,4 +42,26 @@ int _LCR_hexDigitVal(char c)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
Computes simple hash of a string represented by a function returning next
|
||||
string character, ending at 0 or endChar. This is intended for simple (but
|
||||
not 100% reliable) string comparison.
|
||||
*/
|
||||
uint16_t _LCR_simpleStrHash(char (*nextChar)(void), char endChar)
|
||||
{
|
||||
uint16_t r = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
char c = nextChar();
|
||||
|
||||
if (c == 0 || c == endChar)
|
||||
break;
|
||||
|
||||
r = ((r << 5) | (r >> 11)) + c;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue