================ return a hash value for the filename ================ */
| 307 | ================ |
| 308 | */ |
| 309 | static long FS_HashFileName( const char *fname, int hashSize ) { |
| 310 | int i; |
| 311 | long hash; |
| 312 | char letter; |
| 313 | |
| 314 | hash = 0; |
| 315 | i = 0; |
| 316 | while (fname[i] != '\0') { |
| 317 | letter = tolower(fname[i]); |
| 318 | if (letter =='.') break; // don't include extension |
| 319 | if (letter =='\\') letter = '/'; // damn path names |
| 320 | if (letter == PATH_SEP) letter = '/'; // damn path names |
| 321 | hash+=(long)(letter)*(i+119); |
| 322 | i++; |
| 323 | } |
| 324 | hash = (hash ^ (hash >> 10) ^ (hash >> 20)); |
| 325 | hash &= (hashSize-1); |
| 326 | return hash; |
| 327 | } |
| 328 | |
| 329 | static fileHandle_t FS_HandleForFile(void) { |
| 330 | int i; |
no outgoing calls
no test coverage detected