-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #92, Use size_t for 'size' variables #93
Conversation
@@ -158,7 +158,7 @@ | |||
} | |||
} | |||
|
|||
uint32 FM_GetFilenameState(const char *Filename, uint32 BufferSize, bool FileInfoCmd) | |||
uint32 FM_GetFilenameState(const char *Filename, size_t BufferSize, bool FileInfoCmd) |
Check notice
Code scanning / CodeQL-coding-standard
Function too long
@@ -270,7 +270,7 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool FM_VerifyFileState(FM_File_States State, const char *Filename, uint32 BufferSize, uint32 EventID, | |||
bool FM_VerifyFileState(FM_File_States State, const char *Filename, size_t BufferSize, uint32 EventID, |
Check notice
Code scanning / CodeQL-coding-standard
Function too long
@@ -158,7 +158,7 @@ | |||
} | |||
} | |||
|
|||
uint32 FM_GetFilenameState(const char *Filename, uint32 BufferSize, bool FileInfoCmd) | |||
uint32 FM_GetFilenameState(const char *Filename, size_t BufferSize, bool FileInfoCmd) |
Check notice
Code scanning / CodeQL-coding-standard
Long function without assertion
@@ -243,7 +243,7 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
uint32 FM_VerifyNameValid(const char *Name, uint32 BufferSize, uint32 EventID, const char *CmdText) | |||
uint32 FM_VerifyNameValid(const char *Name, size_t BufferSize, uint32 EventID, const char *CmdText) |
Check notice
Code scanning / CodeQL-coding-standard
Long function without assertion
@@ -270,7 +270,7 @@ | |||
/* */ | |||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |||
|
|||
bool FM_VerifyFileState(FM_File_States State, const char *Filename, uint32 BufferSize, uint32 EventID, | |||
bool FM_VerifyFileState(FM_File_States State, const char *Filename, size_t BufferSize, uint32 EventID, |
Check notice
Code scanning / CodeQL-coding-standard
Long function without assertion
8a21666
to
fd3a490
Compare
fd3a490
to
9c2cd0c
Compare
@thnkslprpt CCB 30 March 2023: Approved pending conflict resolution. |
9c2cd0c
to
059961a
Compare
All done @dzbaker. |
Checklist
Describe the contribution
Fixes #92
Easy-to-find size variables converted to
size_t
type.All except the local variables in
FM_ChildDirListPktCmd()
andFM_ChildDirListFileLoop()
were already of typeuint32
, so no real risk of signedness issues popping up.Note: I did not scrub the entire app - if someone can suggest some additional variables to convert over to
size_t
I can add them to this PR.A few typos and spacing issues cleared up in the same files.
Testing performed
GitHub CI actions (incl. Build + Run, Unit Tests etc.) all passing successfully.
Expected behavior changes
Variables representing size should use
size_t
where possible - more expressive and more compliant with the various (relevant) coding guidelines.Contributor Info
Avi Weiss @thnkslprpt