mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-14 18:47:39 +01:00
Minor tweaks
This commit is contained in:
parent
cfb132a92d
commit
6b655d9c53
@ -691,7 +691,7 @@ static STREAMFILE* open_txth(STREAMFILE* sf) {
|
|||||||
/* try "(path/)(.sub.ext).txth" */
|
/* try "(path/)(.sub.ext).txth" */
|
||||||
get_streamfile_basename(sf,basename,PATH_LIMIT);
|
get_streamfile_basename(sf,basename,PATH_LIMIT);
|
||||||
subext = filename_extension(basename);
|
subext = filename_extension(basename);
|
||||||
if (subext != NULL) {
|
if (subext != NULL && subext[0] != '\0') {
|
||||||
get_streamfile_path(sf,filename,PATH_LIMIT);
|
get_streamfile_path(sf,filename,PATH_LIMIT);
|
||||||
get_streamfile_ext(sf,fileext,PATH_LIMIT);
|
get_streamfile_ext(sf,fileext,PATH_LIMIT);
|
||||||
strcat(filename,".");
|
strcat(filename,".");
|
||||||
|
@ -1351,9 +1351,11 @@ static uint32_t hash_sf(STREAMFILE* sf) {
|
|||||||
get_streamfile_name(sf, path, sizeof(path));
|
get_streamfile_name(sf, path, sizeof(path));
|
||||||
|
|
||||||
/* our favorite garbo hash a.k.a FNV-1 32b */
|
/* our favorite garbo hash a.k.a FNV-1 32b */
|
||||||
for (i = 0; i < strlen(path); i++) {
|
i = 0;
|
||||||
|
while (path[i] != '\0') {
|
||||||
char c = tolower(path[i]);
|
char c = tolower(path[i]);
|
||||||
hash = (hash * 16777619) ^ (uint8_t)c;
|
hash = (hash * 16777619) ^ (uint8_t)c;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
|
Loading…
Reference in New Issue
Block a user