Selaa lähdekoodia

* 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.


git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/ttyvaders/trunk@188 92316355-f0b4-4df1-b90c-862c8a59935f
master
sam 21 vuotta sitten
vanhempi
commit
ed7e6e31f2
6 muutettua tiedostoa jossa 19 lisäystä ja 17 poistoa
  1. +1
    -1
      configure.ac
  2. +2
    -2
      libcaca/blit.c
  3. +4
    -4
      libcaca/caca.c
  4. +4
    -4
      libcaca/conic.c
  5. +5
    -4
      libcaca/graphics.c
  6. +3
    -2
      src/weapons.c

+ 1
- 1
configure.ac Näytä tiedosto

@@ -56,7 +56,7 @@ AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES})
# Optimizations
CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs"
CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"

AC_OUTPUT([
Makefile


+ 2
- 2
libcaca/blit.c Näytä tiedosto

@@ -51,8 +51,8 @@ void caca_blit(int x1, int y1, int x2, int y2, void *pixels, int w, int h)

pitch = (3 * w + 3) / 4 * 4;

for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= caca_get_height(); y++)
for(x = x1 > 0 ? x1 : 0; x <= x2 && x <= caca_get_width(); x++)
for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= (int)caca_get_height(); y++)
for(x = x1 > 0 ? x1 : 0; x <= x2 && x <= (int)caca_get_width(); x++)
{
int fromx = w * (x - x1) / (x2 - x1 + 1);
int fromy = h * (y - y1) / (y2 - y1 + 1);


+ 4
- 4
libcaca/caca.c Näytä tiedosto

@@ -257,8 +257,8 @@ static unsigned int _caca_getticks(void)
void caca_refresh(void)
{
#define IDLE_USEC 10000
static unsigned int lastticks = 0;
unsigned int ticks = lastticks + _caca_getticks();
static int lastticks = 0;
int ticks = lastticks + _caca_getticks();

#if defined(USE_SLANG)
SLsmg_refresh();
@@ -274,7 +274,7 @@ void caca_refresh(void)

/* Wait until _caca_delay + time of last call */
ticks += _caca_getticks();
for(; ticks < _caca_delay - IDLE_USEC; ticks += _caca_getticks())
for(; ticks + IDLE_USEC < (int)_caca_delay; ticks += _caca_getticks())
usleep(IDLE_USEC);

/* Update the sliding mean of the render time */
@@ -283,7 +283,7 @@ void caca_refresh(void)
lastticks = ticks - _caca_delay;

/* If we drifted too much, it's bad, bad, bad. */
if(lastticks > _caca_delay)
if(lastticks > (int)_caca_delay)
lastticks = 0;
}



+ 4
- 4
libcaca/conic.c Näytä tiedosto

@@ -183,13 +183,13 @@ static void ellipsepoints(int xo, int yo, int x, int y, char c)
{
uint8_t b = 0;

if(xo + x >= 0 && xo + x < caca_get_width())
if(xo + x >= 0 && xo + x < (int)caca_get_width())
b |= 0x1;
if(xo - x >= 0 && xo - x < caca_get_width())
if(xo - x >= 0 && xo - x < (int)caca_get_width())
b |= 0x2;
if(yo + y >= 0 && yo + y < caca_get_height())
if(yo + y >= 0 && yo + y < (int)caca_get_height())
b |= 0x4;
if(yo - y >= 0 && yo - y < caca_get_height())
if(yo - y >= 0 && yo - y < (int)caca_get_height())
b |= 0x8;

if((b & (0x1|0x4)) == (0x1|0x4))


+ 5
- 4
libcaca/graphics.c Näytä tiedosto

@@ -63,7 +63,8 @@ int caca_get_color(void)

void caca_putchar(int x, int y, char c)
{
if(x < 0 || x >= caca_get_width() || y < 0 || y >= caca_get_height())
if(x < 0 || x >= (int)caca_get_width() ||
y < 0 || y >= (int)caca_get_height())
return;

#if defined(USE_SLANG)
@@ -82,9 +83,9 @@ void caca_putchar(int x, int y, char c)

void caca_putstr(int x, int y, const char *s)
{
int len;
unsigned int len;

if(y < 0 || y >= caca_get_height() || x >= caca_get_width())
if(y < 0 || y >= (int)caca_get_height() || x >= (int)caca_get_width())
return;

len = strlen(s);
@@ -129,7 +130,7 @@ void caca_printf(int x, int y, const char *format, ...)
char *buf = tmp;
va_list args;

if(y < 0 || y >= caca_get_height() || x >= caca_get_width())
if(y < 0 || y >= (int)caca_get_height() || x >= (int)caca_get_width())
return;

if(caca_get_width() - x + 1 > BUFSIZ)


+ 3
- 2
src/weapons.c Näytä tiedosto

@@ -49,7 +49,7 @@ void init_weapons(game *g, weapons *wp)

void draw_weapons(game *g, weapons *wp)
{
int i;
unsigned int i;

for(i = 0; i < WEAPONS; i++)
{
@@ -95,7 +95,8 @@ void draw_weapons(game *g, weapons *wp)

void update_weapons(game *g, weapons *wp)
{
int i, j, dist, xmin, ymin, dx, dy, xnew, ynew;
unsigned int i, j;
int dist, xmin, ymin, dx, dy, xnew, ynew;

for(i = 0; i < WEAPONS; i++)
{


Ladataan…
Peruuta
Tallenna