Skip to content

Fix for d00-Wsign-compare#148

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

Fix for d00-Wsign-compare#148
mywave82 merged 1 commit into
adplug:masterfrom
mywave82:d00-Wsign-compare

Conversation

@mywave82

@mywave82 mywave82 commented Dec 17, 2022

Copy link
Copy Markdown
Contributor
src/d00.cpp: In member function ‘virtual void Cd00Player::rewind(int)’: src/d00.cpp:465:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  465 |   if (subsong < getsubsongs() && dataofs + sizeof(Stpoin) <= filesize)
      |       ~~~~~~~~^~~~~~~~~~~~~~~

src/d00.cpp: In member function ‘virtual void Cd00Player::rewind(int)’:
src/d00.cpp:465:15: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  465 |   if (subsong < getsubsongs() && dataofs + sizeof(Stpoin) <= filesize)
      |       ~~~~~~~~^~~~~~~~~~~~~~~
@mywave82

Copy link
Copy Markdown
Contributor Author

Currently rewind() is prototyped with subsong being signed int, and only rix.cpp and d00.cpp actually has special handling for <0 value, while other subsong implementors does range checks and clamps the value to 0 if out of range. I assume the correct would be to fix other implementors to handle <0 as current song reload instead of clamping.

@mywave82

Copy link
Copy Markdown
Contributor Author

Moved rewind() question into is own issue.

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