From c331fe42d53a6ee56d2603d27fae976cfa801227 Mon Sep 17 00:00:00 2001 From: Jean-Yves Lamoureux Date: Thu, 17 Nov 2005 14:33:43 +0000 Subject: [PATCH] * Fixed warnings under GCC 4.x --- src/bitmap.c | 5 +++-- src/graphics.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bitmap.c b/src/bitmap.c index 5d03dfc..e562ccd 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -571,7 +571,8 @@ void caca_draw_bitmap(int x1, int y1, int x2, int y2, { unsigned int i; int ch = 0, distmin; - int r, g, b, a, fg_r = 0, fg_g = 0, fg_b = 0, bg_r, bg_g, bg_b; + unsigned int r, g, b, a; + int fg_r = 0, fg_g = 0, fg_b = 0, bg_r, bg_g, bg_b; int fromx, fromy, tox, toy, myx, myy, dots, dist; int error[3]; @@ -710,7 +711,7 @@ void caca_draw_bitmap(int x1, int y1, int x2, int y2, } else { - int lum = r; if(g > lum) lum = g; if(b > lum) lum = b; + unsigned int lum = r; if(g > lum) lum = g; if(b > lum) lum = b; outfg = outbg; outbg = CACA_COLOR_BLACK; diff --git a/src/graphics.c b/src/graphics.c index c54a227..7490a10 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -502,8 +502,8 @@ void caca_putchar(int x, int y, char c) */ void caca_putstr(int x, int y, char const *s) { - char *charbuf; - char *attrbuf; + unsigned char *charbuf; + unsigned char *attrbuf; char const *t; unsigned int len; @@ -1022,7 +1022,7 @@ int _caca_init_graphics(void) for(i = 0; i < 94; i++) { - glGenTextures(1, &id[i]); + glGenTextures(1, (GLuint*)&id[i]); glBindTexture(GL_TEXTURE_2D, id[i]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -1402,7 +1402,7 @@ void caca_refresh(void) XSetForeground(x11_dpy, x11_gc, x11_colors[attr[0] & 0xf]); XDrawString(x11_dpy, x11_pixmap, x11_gc, x * x11_font_width, (y + 1) * x11_font_height - x11_font_offset, - cache_char + x + y * _caca_width, len); + (char*)(cache_char + x + y * _caca_width), len); } }