Changeset 188 for ttyvaders


Ignore:
Timestamp:
Nov 16, 2003, 12:26:54 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • configure.ac: + Added -Wsign-compare to the warning flags.
  • libcaca/caca.c: + Fixed a signed/unsigned bug that caused infinite waits with

ee_set_delay(0).

  • src/weapons.c libcaca/graphics.c libcaca/blit.c libcaca/conic.c: + Fixed minor signed/unsigned comparison warnings.
Location:
ttyvaders/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ttyvaders/trunk/configure.ac

    r186 r188  
    5757CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
    5858# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
    59 CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs"
     59CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
    6060
    6161AC_OUTPUT([
  • ttyvaders/trunk/libcaca/blit.c

    r186 r188  
    5252    pitch = (3 * w + 3) / 4 * 4;
    5353
    54     for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= caca_get_height(); y++)
    55         for(x = x1 > 0 ? x1 : 0; x <= x2 && x <= caca_get_width(); x++)
     54    for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= (int)caca_get_height(); y++)
     55        for(x = x1 > 0 ? x1 : 0; x <= x2 && x <= (int)caca_get_width(); x++)
    5656        {
    5757            int fromx = w * (x - x1) / (x2 - x1 + 1);
  • ttyvaders/trunk/libcaca/caca.c

    r186 r188  
    258258{
    259259#define IDLE_USEC 10000
    260     static unsigned int lastticks = 0;
    261     unsigned int ticks = lastticks + _caca_getticks();
     260    static int lastticks = 0;
     261    int ticks = lastticks + _caca_getticks();
    262262
    263263#if defined(USE_SLANG)
     
    275275    /* Wait until _caca_delay + time of last call */
    276276    ticks += _caca_getticks();
    277     for(; ticks < _caca_delay - IDLE_USEC; ticks += _caca_getticks())
     277    for(; ticks + IDLE_USEC < (int)_caca_delay; ticks += _caca_getticks())
    278278        usleep(IDLE_USEC);
    279279
     
    284284
    285285    /* If we drifted too much, it's bad, bad, bad. */
    286     if(lastticks > _caca_delay)
     286    if(lastticks > (int)_caca_delay)
    287287        lastticks = 0;
    288288}
  • ttyvaders/trunk/libcaca/conic.c

    r186 r188  
    184184    uint8_t b = 0;
    185185
    186     if(xo + x >= 0 && xo + x < caca_get_width())
     186    if(xo + x >= 0 && xo + x < (int)caca_get_width())
    187187        b |= 0x1;
    188     if(xo - x >= 0 && xo - x < caca_get_width())
     188    if(xo - x >= 0 && xo - x < (int)caca_get_width())
    189189        b |= 0x2;
    190     if(yo + y >= 0 && yo + y < caca_get_height())
     190    if(yo + y >= 0 && yo + y < (int)caca_get_height())
    191191        b |= 0x4;
    192     if(yo - y >= 0 && yo - y < caca_get_height())
     192    if(yo - y >= 0 && yo - y < (int)caca_get_height())
    193193        b |= 0x8;
    194194
  • ttyvaders/trunk/libcaca/graphics.c

    r186 r188  
    6464void caca_putchar(int x, int y, char c)
    6565{
    66     if(x < 0 || x >= caca_get_width() || y < 0 || y >= caca_get_height())
     66    if(x < 0 || x >= (int)caca_get_width() ||
     67       y < 0 || y >= (int)caca_get_height())
    6768        return;
    6869
     
    8384void caca_putstr(int x, int y, const char *s)
    8485{
    85     int len;
     86    unsigned int len;
    8687
    87     if(y < 0 || y >= caca_get_height() || x >= caca_get_width())
     88    if(y < 0 || y >= (int)caca_get_height() || x >= (int)caca_get_width())
    8889        return;
    8990
     
    130131    va_list args;
    131132
    132     if(y < 0 || y >= caca_get_height() || x >= caca_get_width())
     133    if(y < 0 || y >= (int)caca_get_height() || x >= (int)caca_get_width())
    133134        return;
    134135
  • ttyvaders/trunk/src/weapons.c

    r186 r188  
    5050void draw_weapons(game *g, weapons *wp)
    5151{
    52     int i;
     52    unsigned int i;
    5353
    5454    for(i = 0; i < WEAPONS; i++)
     
    9696void update_weapons(game *g, weapons *wp)
    9797{
    98     int i, j, dist, xmin, ymin, dx, dy, xnew, ynew;
     98    unsigned int i, j;
     99    int dist, xmin, ymin, dx, dy, xnew, ynew;
    99100
    100101    for(i = 0; i < WEAPONS; i++)
Note: See TracChangeset for help on using the changeset viewer.