@@ -175,7 +175,7 @@ void CraftSoldiersState::init()
175175 */
176176void CraftSoldiersState::lstItemsLeftArrowClick (Action *action)
177177{
178- int row = _lstSoldiers->getSelectedRow ();
178+ unsigned int row = _lstSoldiers->getSelectedRow ();
179179 if (row > 0 )
180180 {
181181 if (action->getDetails ()->button .button == SDL_BUTTON_LEFT )
@@ -195,7 +195,7 @@ void CraftSoldiersState::lstItemsLeftArrowClick(Action *action)
195195 * @param row Selected soldier row.
196196 * @param max Move the soldier to the top?
197197 */
198- void CraftSoldiersState::moveSoldierUp (Action *action, int row, bool max)
198+ void CraftSoldiersState::moveSoldierUp (Action *action, unsigned int row, bool max)
199199{
200200 Soldier *s = _base->getSoldiers ()->at (row);
201201 if (max)
@@ -225,9 +225,9 @@ void CraftSoldiersState::moveSoldierUp(Action *action, int row, bool max)
225225 */
226226void CraftSoldiersState::lstItemsRightArrowClick (Action *action)
227227{
228- int row = _lstSoldiers->getSelectedRow ();
228+ unsigned int row = _lstSoldiers->getSelectedRow ();
229229 size_t numSoldiers = _base->getSoldiers ()->size ();
230- if (0 < numSoldiers && INT_MAX >= numSoldiers && row < ( int ) numSoldiers - 1 )
230+ if (0 < numSoldiers && INT_MAX >= numSoldiers && row < numSoldiers - 1 )
231231 {
232232 if (action->getDetails ()->button .button == SDL_BUTTON_LEFT )
233233 {
@@ -246,7 +246,7 @@ void CraftSoldiersState::lstItemsRightArrowClick(Action *action)
246246 * @param row Selected soldier row.
247247 * @param max Move the soldier to the bottom?
248248 */
249- void CraftSoldiersState::moveSoldierDown (Action *action, int row, bool max)
249+ void CraftSoldiersState::moveSoldierDown (Action *action, unsigned int row, bool max)
250250{
251251 Soldier *s = _base->getSoldiers ()->at (row);
252252 if (max)
@@ -322,7 +322,7 @@ void CraftSoldiersState::lstSoldiersMousePress(Action *action)
322322{
323323 if (Options::changeValueByMouseWheel == 0 )
324324 return ;
325- int row = _lstSoldiers->getSelectedRow ();
325+ unsigned int row = _lstSoldiers->getSelectedRow ();
326326 size_t numSoldiers = _base->getSoldiers ()->size ();
327327 if (action->getDetails ()->button .button == SDL_BUTTON_WHEELUP &&
328328 row > 0 )
@@ -334,7 +334,7 @@ void CraftSoldiersState::lstSoldiersMousePress(Action *action)
334334 }
335335 }
336336 else if (action->getDetails ()->button .button == SDL_BUTTON_WHEELDOWN &&
337- 0 < numSoldiers && INT_MAX >= numSoldiers && row < ( int ) numSoldiers - 1 )
337+ 0 < numSoldiers && INT_MAX >= numSoldiers && row < numSoldiers - 1 )
338338 {
339339 if (action->getAbsoluteXMouse () >= _lstSoldiers->getArrowsLeftEdge () &&
340340 action->getAbsoluteXMouse () <= _lstSoldiers->getArrowsRightEdge ())
0 commit comments