shithub: choc

Download patch

ref: 9b5d574982b49d0c12c5c7229a9151ad40c1bcb9
parent: cdd3680b9e94640cc4956ae30de734cbe1e9bf76
author: Simon Howard <fraggle@gmail.com>
date: Fri Mar 6 15:01:32 EST 2009

Fix signed/unsigned conversion warning.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1448

--- a/textscreen/txt_scrollpane.c
+++ b/textscreen/txt_scrollpane.c
@@ -233,8 +233,8 @@
     {
         scrollpane->y -= scrollpane->widget.y - selected->y;
     }
-    else if (selected->y + selected->h >
-             scrollpane->widget.y + scrollpane->h)
+    else if ((signed) (selected->y + selected->h) >
+             (signed) (scrollpane->widget.y + scrollpane->h))
     {
         scrollpane->y += (selected->y + selected->h)
                        - (scrollpane->widget.y + scrollpane->h);
@@ -246,8 +246,8 @@
     {
         scrollpane->x -= scrollpane->widget.x - selected->x;
     }
-    else if (selected->x + selected->w >
-             scrollpane->widget.x + scrollpane->w)
+    else if ((signed) (selected->x + selected->w) >
+             (signed) (scrollpane->widget.x + scrollpane->w))
     {
         scrollpane->x += (selected->x + selected->w)
                        - (scrollpane->widget.x + scrollpane->w);