Skip to content

Fix for dro2-Wsign-compare and convert some additional variables from signed into unsigned #149

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

Fix for dro2-Wsign-compare and convert some additional variables from signed into unsigned #149
mywave82 merged 1 commit into
adplug:masterfrom
mywave82:dro2-Wsign-compare

Conversation

@mywave82

Copy link
Copy Markdown
Contributor

Fix this warning and make some more of the logic work with unsigned instead of signed datatypes.

src/dro2.cpp: In member function ‘virtual bool Cdro2Player::load(const string&, const CFileProvider&)’: src/dro2.cpp:69:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
   69 |             this->iLength > fp.filesize(f) - f->pos()) {
      |             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

…nstead of signed datatypes.

src/dro2.cpp: In member function ‘virtual bool Cdro2Player::load(const string&, const CFileProvider&)’:
src/dro2.cpp:69:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
   69 |             this->iLength > fp.filesize(f) - f->pos()) {
      |             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Comment thread src/dro2.cpp
return false;
}

this->iLength = f->readInt(4); // should better use an unsigned type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// should better use an unsigned type

Acknowledged

@mywave82 mywave82 merged commit 860325b 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