Skip to content

Fix Wsign-compare in cff.cpp#145

Merged
mywave82 merged 1 commit into
adplug:masterfrom
mywave82:cff-Wsign-compare
Feb 26, 2023
Merged

Fix Wsign-compare in cff.cpp#145
mywave82 merged 1 commit into
adplug:masterfrom
mywave82:cff-Wsign-compare

Conversation

@mywave82

Copy link
Copy Markdown
Contributor

Fix this warning by typecasting 0x669 that defaults to int into the type of module_size, size_t

src/cff.cpp: In member function ‘virtual bool CcffLoader::load(const string&, const CFileProvider&)’: src/cff.cpp:106:55: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  106 |   if (nop < 1 || nop > 36 || 0x669 + nop * 64 * 9 * 3 > module_size) {
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

…ype of module_size, size_t

src/cff.cpp: In member function ‘virtual bool CcffLoader::load(const string&, const CFileProvider&)’:
src/cff.cpp:106:55: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
  106 |   if (nop < 1 || nop > 36 || 0x669 + nop * 64 * 9 * 3 > module_size) {
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
@mywave82 mywave82 merged commit 152a80b into adplug:master Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant