1
0
Fork 0

Use unsigned for numbers in shortened filenames

Bitu (aka uintptr_t) is not necessary for handling shortened files,
as we can represent max 10^7 shortened files anyway; unsigned is good
enough.

This allows use to use simple %u for conversion instead of PRIuPTR,
which caused a bug on AmigaOS on PPC.

Fixes: #162
This commit is contained in:
Patryk Obara 2020-02-05 21:15:31 +01:00 committed by Patryk Obara
parent 4a6704367b
commit 2983de4db4
2 changed files with 22 additions and 18 deletions

View file

@ -196,7 +196,7 @@ public:
bool isDir;
Bit16u id;
Bitu nextEntry;
Bitu shortNr;
unsigned shortNr;
// contents
std::vector<CFileInfo*> fileList;
std::vector<CFileInfo*> longNameList;
@ -209,7 +209,7 @@ private:
bool RemoveTrailingDot (char* shortname);
Bits GetLongName (CFileInfo* info, char* shortname, const size_t shortname_len);
void CreateShortName (CFileInfo* dir, CFileInfo* info);
Bitu CreateShortNameID (CFileInfo* dir, const char* name);
unsigned CreateShortNameID (CFileInfo* dir, const char* name);
int CompareShortname (const char* compareName, const char* shortName);
bool SetResult (CFileInfo* dir, char * &result, Bitu entryNr);
bool IsCachedIn (CFileInfo* dir);