signedness fix
This commit is contained in:
parent
7c79084433
commit
02aa83a59e
2 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
|||
(Format: Year/Month/Day)
|
||||
Changes for 0.9.16:
|
||||
*06/04/16:
|
||||
* signedness fix in Container moveItem (thanks _markt)
|
||||
Container.cc
|
||||
* Vertical toolbar (Simon)
|
||||
Toolbar.cc ToolbarItem.hh/cc IconbarTool.hh/cc IconButton.hh/cc
|
||||
ClockTool.hh/cc ButtonTool.cc WorkspaceNameTool.hh/cc Container.cc
|
||||
|
|
|
@ -129,11 +129,11 @@ void Container::moveItem(Item item, int movement) {
|
|||
int index = find(item);
|
||||
const size_t size = m_item_list.size();
|
||||
|
||||
if (index < 0 || (movement % size) == 0) {
|
||||
if (index < 0 || (movement % static_cast<signed>(size)) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int newindex = (index + movement) % size;
|
||||
int newindex = (index + movement) % static_cast<signed>(size);
|
||||
if (newindex < 0) // neg wrap
|
||||
newindex += size;
|
||||
|
||||
|
|
Loading…
Reference in a new issue