diff options
author | glx <glx@openttd.org> | 2009-01-03 19:39:22 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2009-01-03 19:39:22 +0000 |
commit | 502607410efcf3d877c8d582d6215006b4c7ac0f (patch) | |
tree | 88f63fccf47f8c158a642ed1f4bece3706e6f86e | |
parent | 09cd9a8017ab362b117429e881f0cc380cd859af (diff) | |
download | openttd-502607410efcf3d877c8d582d6215006b4c7ac0f.tar.xz |
(svn r14816) -Fix: signed/unsigned warnings (MSVC)
-rw-r--r-- | src/network/network_gui.cpp | 2 | ||||
-rw-r--r-- | src/settings_gui.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 007901341..380bf9060 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -629,7 +629,7 @@ public: case WKC_PAGEDOWN: /* scroll down a page */ if (this->server == NULL) return ES_HANDLED; - this->list_pos = (this->list_pos + this->vscroll.cap > this->servers.Length() - 1) ? this->servers.Length() - 1 : this->list_pos + this->vscroll.cap; + this->list_pos = min(this->list_pos + this->vscroll.cap, (int)this->servers.Length() - 1); break; case WKC_HOME: /* jump to beginning */ diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index a04f12ee8..bef0d446d 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -818,7 +818,7 @@ struct PatchesSelectionWindow : Window { int x = SETTINGTREE_LEFT_OFFSET; int y = SETTINGTREE_TOP_OFFSET; - for (uint i = vscroll.pos; i != page->num && i < vscroll.pos + vscroll.cap; i++) { + for (uint i = vscroll.pos; i != page->num && vscroll.pos + vscroll.cap - i > 0; i++) { const SettingDesc *sd = page->entries[i].setting; DrawPatch(patches_ptr, sd, x, y, this->click - (i * 2)); y += SETTING_HEIGHT; |