Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Build failure for games/sail/pl_7.c



Sarton OBrien reported:

cc1: warnings being treated as errors
/usr/src/games/sail/pl_7.c: In function 'draw_scroll':
/usr/src/games/sail/pl_7.c:233: warning: comparison between signed and unsigned
*** Error code 1

And he suggested the following patch:

--- pl_7.c      2009-03-15 20:52:59.000000000 +1100
+++ .#pl_7.c.1.35       2009-03-15 20:40:15.000000000 +1100
@@ -211,7 +211,7 @@
        unsigned visible_lines;
        unsigned index_of_top;
        unsigned index_of_y;
-       unsigned y;
+       int y;
        unsigned cursorx;

        werase(scroll_w);


I offer instead the following patch:

--- pl_7.c      15 Mar 2009 03:33:56 -0000      1.35
+++ pl_7.c      15 Mar 2009 17:13:43 -0000
@@ -230,7 +230,7 @@ draw_scroll(void)
                index_of_top -= sc_scrollup;
        }

-       for (y = 0; y < SCROLL_Y - 1; y++) {
+       for (y = 0; y < visible_lines; y++) {
                index_of_y = index_of_top + y;
                if (index_of_y >= total_lines) {
                        break;

The unsigned variable visible_lines is assigned a value of SCROLL_Y -1 a few lines earlier and is not modified between that assignment and this for(;;) loop.


-------------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:      |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul at whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index