From 0c647a7f24de62f945b8b2d33a578ac99877931d Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Tue, 2 Jul 2013 06:25:21 +0200 Subject: [PATCH] Silence compiler warnings (lib). --- src/lib/api.c | 3 -- src/lib/dynamic_filters.c | 6 +-- src/lib/dynamic_filters.h | 12 ++--- src/lib/ellipse.c | 16 +++---- src/lib/font_load.c | 5 -- src/lib/font_query.c | 28 ++++------- src/lib/grab.c | 6 +-- src/lib/line.c | 12 ++--- src/lib/polygon.c | 9 +--- src/lib/rend.c | 20 ++++---- src/lib/rgba.c | 98 +++------------------------------------ src/lib/rgbadraw.c | 5 -- src/lib/rgbadraw.h | 7 +-- src/lib/rotate.c | 18 +++---- src/lib/ximage.c | 6 +-- 15 files changed, 63 insertions(+), 188 deletions(-) diff --git a/src/lib/api.c b/src/lib/api.c index e53fa40..e29eaf0 100644 --- a/src/lib/api.c +++ b/src/lib/api.c @@ -2133,11 +2133,8 @@ imlib_create_image_from_ximage(XImage * image, XImage * mask, int x, int y, int width, int height, char need_to_grab_x) { ImlibImage *im; - char domask = 0; CHECK_CONTEXT(ctx); - if (mask) - domask = 1; im = __imlib_CreateImage(width, height, NULL); im->data = malloc(width * height * sizeof(DATA32)); __imlib_GrabXImageToRGBA(im->data, 0, 0, width, height, diff --git a/src/lib/dynamic_filters.c b/src/lib/dynamic_filters.c index 92f373d..07ab259 100644 --- a/src/lib/dynamic_filters.c +++ b/src/lib/dynamic_filters.c @@ -16,8 +16,8 @@ #include "script.h" #include "loaderpath.h" -pImlibExternalFilter filters = NULL; -int dyn_initialised = 0; +static pImlibExternalFilter filters = NULL; +static int dyn_initialised = 0; #define MALLOCSHOW #define FREESHOW @@ -87,7 +87,7 @@ __imlib_dynamic_filters_init() { MALLOCSHOW; filters = malloc(sizeof(ImlibExternalFilter)); - filters->filename = ""; + filters->filename = (char *)""; filters->next = NULL; ptr = filters; #ifdef FDEBUG diff --git a/src/lib/dynamic_filters.h b/src/lib/dynamic_filters.h index 014e2fa..81c8c50 100644 --- a/src/lib/dynamic_filters.h +++ b/src/lib/dynamic_filters.h @@ -14,6 +14,7 @@ struct imlib_filter_info typedef struct _imlib_external_filter ImlibExternalFilter; typedef struct _imlib_external_filter *pImlibExternalFilter; + struct _imlib_external_filter { char *name; @@ -24,20 +25,15 @@ struct _imlib_external_filter void *handle; char **filters; void (*init_filter)( struct imlib_filter_info *info ); - void (*deinit_filter)(); + void (*deinit_filter)(void); void *(*exec_filter)( char *filter, void *im, pIFunctionParam params ); pImlibExternalFilter next; }; -__hidden void __imlib_dynamic_filters_init(); -__hidden void __imlib_dynamic_filters_deinit(); +__hidden void __imlib_dynamic_filters_init(void); +__hidden void __imlib_dynamic_filters_deinit(void); __hidden pImlibExternalFilter __imlib_get_dynamic_filter( char *name ); __hidden char **__imlib_ListFilters(int *num_ret); __hidden pImlibExternalFilter __imlib_LoadFilter( char *file ); - - #endif - - - diff --git a/src/lib/ellipse.c b/src/lib/ellipse.c index 38be1ac..7a5d88d 100644 --- a/src/lib/ellipse.c +++ b/src/lib/ellipse.c @@ -378,9 +378,9 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color, bpp -= (lx + 1); } - if (((unsigned)(ty) < clh) && (len > 0)) + if (((unsigned)ty < (unsigned)clh) && (len > 0)) sfunc(color, tpp, len); - if (((unsigned)(by) < clh) && (len > 0)) + if (((unsigned)by < (unsigned)clh) && (len > 0)) sfunc(color, bpp, len); } @@ -448,9 +448,9 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color, bpp -= lx; } - if (((unsigned)(ty) < clh) && (len > 0)) + if (((unsigned)ty < (unsigned)clh) && (len > 0)) sfunc(color, tpp, len); - if (((unsigned)(by) < clh) && (len > 0)) + if (((unsigned)by < (unsigned)clh) && (len > 0)) sfunc(color, bpp, len); dx -= a2; @@ -535,9 +535,9 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color, bpp -= (lx + 1); } - if (((unsigned)(ty) < clh) && (len > 0)) + if (((unsigned)ty < (unsigned)clh) && (len > 0)) sfunc(color, tpp, len); - if (((unsigned)(by) < clh) && (len > 0)) + if (((unsigned)by < (unsigned)clh) && (len > 0)) sfunc(color, bpp, len); } @@ -609,9 +609,9 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color, bpp -= (lx + 1); } - if (((unsigned)(ty) < clh) && (len > 0)) + if (((unsigned)ty < (unsigned)clh) && (len > 0)) sfunc(color, tpp, len); - if (((unsigned)(by) < clh) && (len > 0)) + if (((unsigned)by < (unsigned)clh) && (len > 0)) sfunc(color, bpp, len); A_VAL(&col1) = ((xx - (x << 16)) >> 8); diff --git a/src/lib/font_load.c b/src/lib/font_load.c index b1f15a0..9ae07bd 100644 --- a/src/lib/font_load.c +++ b/src/lib/font_load.c @@ -265,8 +265,6 @@ font_modify_cache_cb(Imlib_Hash * hash, const char *key, void *data, dir = fdata; font_cache_usage += (*dir) * ((fg->glyph_out->bitmap.width * fg->glyph_out->bitmap.rows) + sizeof(Imlib_Font_Glyph) + sizeof(Imlib_Object_List) + 400); /* fudge values */ return 1; - hash = 0; - key = 0; } void @@ -316,9 +314,6 @@ font_flush_free_glyph_cb(Imlib_Hash * hash, const char *key, void *data, FT_Done_Glyph(fg->glyph); free(fg); return 1; - hash = 0; - key = 0; - fdata = 0; } void diff --git a/src/lib/font_query.c b/src/lib/font_query.c index 8c16a33..a1cc019 100644 --- a/src/lib/font_query.c +++ b/src/lib/font_query.c @@ -22,7 +22,7 @@ void imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h) { int use_kerning; - int pen_x, pen_y; + int pen_x /*, pen_y */ ; int start_x, end_x; int chr; FT_UInt prev_index; @@ -30,7 +30,7 @@ imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h) start_x = 0; end_x = 0; pen_x = 0; - pen_y = 0; +/* pen_y = 0; */ use_kerning = FT_HAS_KERNING(fn->ft.face); prev_index = 0; for (chr = 0; text[chr];) @@ -38,7 +38,7 @@ imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h) FT_UInt index; Imlib_Font_Glyph *fg; ImlibFont *fn_in_chain; - int chr_x, chr_y, chr_w; + int chr_x, /*chr_y, */ chr_w; int gl; gl = imlib_font_utf8_get_next((unsigned char *)text, &chr); @@ -58,7 +58,7 @@ imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h) continue; chr_x = (pen_x >> 8) + fg->glyph_out->left; - chr_y = (pen_y >> 8) + fg->glyph_out->top; +/* chr_y = (pen_y >> 8) + fg->glyph_out->top; */ chr_w = fg->glyph_out->bitmap.width; if (pen_x == 0) @@ -104,14 +104,13 @@ imlib_font_query_advance(ImlibFont * fn, const char *text, int *h_adv, int *v_adv) { int use_kerning; - int pen_x, pen_y; + int pen_x; int start_x; int chr; FT_UInt prev_index; start_x = 0; pen_x = 0; - pen_y = 0; use_kerning = FT_HAS_KERNING(fn->ft.face); prev_index = 0; for (chr = 0; text[chr];) @@ -119,7 +118,6 @@ imlib_font_query_advance(ImlibFont * fn, const char *text, int *h_adv, FT_UInt index; Imlib_Font_Glyph *fg; ImlibFont *fn_in_chain; - int chr_x, chr_y, chr_w; int gl; gl = imlib_font_utf8_get_next((unsigned char *)text, &chr); @@ -138,10 +136,6 @@ imlib_font_query_advance(ImlibFont * fn, const char *text, int *h_adv, if (!fg) continue; - chr_x = (pen_x >> 8) + fg->glyph_out->left; - chr_y = (pen_y >> 8) + fg->glyph_out->top; - chr_w = fg->glyph_out->bitmap.width; - pen_x += fg->glyph->advance.x >> 8; prev_index = index; } @@ -157,14 +151,13 @@ imlib_font_query_char_coords(ImlibFont * fn, const char *text, int pos, int *cx, int *cy, int *cw, int *ch) { int use_kerning; - int pen_x, pen_y; + int pen_x; int prev_chr_end; int chr; int asc, desc; FT_UInt prev_index; pen_x = 0; - pen_y = 0; use_kerning = FT_HAS_KERNING(fn->ft.face); prev_index = 0; prev_chr_end = 0; @@ -176,7 +169,7 @@ imlib_font_query_char_coords(ImlibFont * fn, const char *text, int pos, FT_UInt index; Imlib_Font_Glyph *fg; ImlibFont *fn_in_chain; - int chr_x, chr_y, chr_w; + int chr_x, chr_w; int gl, kern; FT_Vector delta; @@ -200,7 +193,6 @@ imlib_font_query_char_coords(ImlibFont * fn, const char *text, int pos, if (kern < 0) kern = 0; chr_x = ((pen_x - kern) >> 8) + fg->glyph_out->left; - chr_y = (pen_y >> 8) + fg->glyph_out->top; chr_w = fg->glyph_out->bitmap.width + (kern >> 8); if (text[chr]) { @@ -240,14 +232,13 @@ imlib_font_query_text_at_pos(ImlibFont * fn, const char *text, int x, int y, int *cx, int *cy, int *cw, int *ch) { int use_kerning; - int pen_x, pen_y; + int pen_x; int prev_chr_end; int chr; int asc, desc; FT_UInt prev_index; pen_x = 0; - pen_y = 0; use_kerning = FT_HAS_KERNING(fn->ft.face); prev_index = 0; prev_chr_end = 0; @@ -259,7 +250,7 @@ imlib_font_query_text_at_pos(ImlibFont * fn, const char *text, int x, int y, FT_UInt index; Imlib_Font_Glyph *fg; ImlibFont *fn_in_chain; - int chr_x, chr_y, chr_w; + int chr_x, chr_w; int gl, kern; FT_Vector delta; @@ -283,7 +274,6 @@ imlib_font_query_text_at_pos(ImlibFont * fn, const char *text, int x, int y, if (kern < 0) kern = 0; chr_x = ((pen_x - kern) >> 8) + fg->glyph_out->left; - chr_y = (pen_y >> 8) + fg->glyph_out->top; chr_w = fg->glyph_out->bitmap.width + (kern >> 8); if (text[chr]) { diff --git a/src/lib/grab.c b/src/lib/grab.c index 7734a55..b906662 100644 --- a/src/lib/grab.c +++ b/src/lib/grab.c @@ -15,8 +15,6 @@ static DATA8 rtab[256], gtab[256], btab[256]; static void Tmp_HandleXError(Display * d, XErrorEvent * ev) { - d = NULL; - ev = NULL; _x_err = 1; } @@ -528,7 +526,7 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh, char is_pixmap = 0, created_mask = 0, is_shm = 0, is_mshm = 0; char domask; int i; - int src_x, src_y, src_w, src_h, origw, origh; + int src_x, src_y, src_w, src_h; int width, height, clipx, clipy; XShmSegmentInfo shminfo, mshminfo; XImage *xim, *mxim; @@ -537,8 +535,6 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh, domask = (pdomask) ? *pdomask : 0; /* FIXME: oh isn't used - i wonder if there's a bug looming... */ oh = 0; - origw = w; - origh = h; if (grab) XGrabServer(d); XSync(d, False); diff --git a/src/lib/line.c b/src/lib/line.c index 3174122..ef6e247 100644 --- a/src/lib/line.c +++ b/src/lib/line.c @@ -565,7 +565,7 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color, break; } - if ((unsigned)(px) < clw) + if ((unsigned)(px) < (unsigned)clw) { aa = (yy - (y << 16)) >> 8; @@ -573,10 +573,10 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color, if (ca < 255) MULT(A_VAL(&color), ca, A_VAL(&color), tmp); - if ((unsigned)(py) < clh) + if ((unsigned)(py) < (unsigned)clh) pfunc(color, p); - if ((unsigned)(py + 1) < clh) + if ((unsigned)(py + 1) < (unsigned)clh) { A_VAL(&color) = aa; if (ca < 255) @@ -624,7 +624,7 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color, break; } - if ((unsigned)(py) < clh) + if ((unsigned)(py) < (unsigned)clh) { aa = (xx - (x << 16)) >> 8; @@ -632,10 +632,10 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color, if (ca < 255) MULT(A_VAL(&color), ca, A_VAL(&color), tmp); - if ((unsigned)(px) < clw) + if ((unsigned)(px) < (unsigned)clw) pfunc(color, p); - if ((unsigned)(px + 1) < clw) + if ((unsigned)(px + 1) < (unsigned)clw) { A_VAL(&color) = aa; if (ca < 255) diff --git a/src/lib/polygon.c b/src/lib/polygon.c index ebcfa94..db5f2b4 100644 --- a/src/lib/polygon.c +++ b/src/lib/polygon.c @@ -356,27 +356,20 @@ do { \ switch(e->type) \ { \ case SHALLOW_EDGE: \ - { \ elx = (e->xx - (2 * e->dxx)) >> 16; \ erx = (e->xx + (2 * e->dxx)) >> 16; \ if (e->dxx < 0) \ { lx = elx; elx = erx; erx = lx; } \ break; \ - } \ + default: \ case STEEP_EDGE: \ - { \ lx = (e->xx >> 16); \ elx = erx = lx; \ break; \ - } \ case HORZ_EDGE: \ - { \ elx = e->v0->x; \ erx = e->v1->x; \ break; \ - } \ - default: \ - break; \ } \ } while (0) diff --git a/src/lib/rend.c b/src/lib/rend.c index d1927af..bb4e865 100644 --- a/src/lib/rend.c +++ b/src/lib/rend.c @@ -97,7 +97,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm, } for (i = 31; i >= 0; i--) { - if (rm >= (1 << i)) + if (rm >= (1U << i)) { rshift = i - 7; break; @@ -105,7 +105,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm, } for (i = 31; i >= 0; i--) { - if (gm >= (1 << i)) + if (gm >= (1U << i)) { gshift = i - 7; break; @@ -113,7 +113,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm, } for (i = 31; i >= 0; i--) { - if (bm >= (1 << i)) + if (bm >= (1U << i)) { bshift = i - 7; break; @@ -140,11 +140,12 @@ static void __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy, XImage * xim, Visual * v, Context * ct) { - unsigned int x, y, r, g, b, val, hh; + int x, y, hh; + unsigned int r, g, b, val; unsigned int rmask, gmask, bmask; int i, rshift, gshift, bshift; - const DATA8 _dither_88[8][8] = { + static const DATA8 _dither_88[8][8] = { {0, 32, 8, 40, 2, 34, 10, 42}, {48, 16, 56, 24, 50, 18, 58, 26}, {12, 44, 4, 36, 14, 46, 6, 38}, @@ -184,7 +185,7 @@ __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy, bshift = 0; for (i = 31; i >= 0; i--) { - if (rmask >= (1 << i)) + if (rmask >= (1U << i)) { rshift = i - 7; break; @@ -192,7 +193,7 @@ __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy, } for (i = 31; i >= 0; i--) { - if (gmask >= (1 << i)) + if (gmask >= (1U << i)) { gshift = i - 7; break; @@ -200,7 +201,7 @@ __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy, } for (i = 31; i >= 0; i--) { - if (bmask >= (1 << i)) + if (bmask >= (1U << i)) { bshift = i - 7; break; @@ -529,7 +530,6 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m, char dither_mask, int mat, ImlibColorModifier * cmod, ImlibOp op) { - Context *ct; int dx1, dy1, dx2, dy2, dw, dh, tsx, tsy; ImlibImage *back; @@ -580,7 +580,7 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m, dy1 = 0; } - ct = __imlib_GetContext(d, v, cm, depth); + __imlib_GetContext(d, v, cm, depth); back = __imlib_CreateImage(dw, dh, NULL); back->data = calloc(dw * dh, sizeof(DATA32)); diff --git a/src/lib/rgba.c b/src/lib/rgba.c index 8caae3b..e63badf 100644 --- a/src/lib/rgba.c +++ b/src/lib/rgba.c @@ -2925,9 +2925,6 @@ __imlib_RGBA_to_RGB565_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -2997,9 +2994,6 @@ __imlib_RGBA_to_RGB565_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3067,9 +3061,6 @@ __imlib_RGBA_to_BGR565_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3139,9 +3130,6 @@ __imlib_RGBA_to_BGR565_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3209,9 +3197,6 @@ __imlib_RGBA_to_RGB555_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3281,9 +3266,6 @@ __imlib_RGBA_to_RGB555_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3351,9 +3333,6 @@ __imlib_RGBA_to_BGR555_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3423,9 +3402,6 @@ __imlib_RGBA_to_BGR555_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3521,9 +3497,6 @@ __imlib_RGBA_to_RGB332_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3601,9 +3574,6 @@ __imlib_RGBA_to_RGB332_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3699,9 +3669,6 @@ __imlib_RGBA_to_RGB666_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3779,9 +3746,6 @@ __imlib_RGBA_to_RGB666_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3877,9 +3841,6 @@ __imlib_RGBA_to_RGB232_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -3957,9 +3918,6 @@ __imlib_RGBA_to_RGB232_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4055,9 +4013,6 @@ __imlib_RGBA_to_RGB222_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4135,9 +4090,6 @@ __imlib_RGBA_to_RGB222_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4233,9 +4185,6 @@ __imlib_RGBA_to_RGB221_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4313,9 +4262,6 @@ __imlib_RGBA_to_RGB221_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4411,9 +4357,6 @@ __imlib_RGBA_to_RGB121_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4491,9 +4434,6 @@ __imlib_RGBA_to_RGB121_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4589,9 +4529,6 @@ __imlib_RGBA_to_RGB111_fast(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4669,9 +4606,6 @@ __imlib_RGBA_to_RGB111_dither(DATA32 * src, int src_jump, } } } - return; - dx = 0; - dy = 0; } static void @@ -4694,9 +4628,6 @@ __imlib_RGBA_to_RGB1_fast(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } static void @@ -4719,9 +4650,6 @@ __imlib_RGBA_to_RGB1_dither(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } static void @@ -4739,14 +4667,11 @@ __imlib_RGBA_to_A1_fast(DATA32 * src, int src_jump, { for (x = 0; x < w; x++) { - WRITE1_RGBA_A1(src, dest, threshold); + WRITE1_RGBA_A1(src, dest, (DATA32) threshold); } src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } static void @@ -4769,9 +4694,6 @@ __imlib_RGBA_to_A1_dither(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } static void @@ -4797,11 +4719,9 @@ __imlib_RGBA_to_RGB8888_fast(DATA32 * src, int src_jump, } else memcpy(dest, src, h * w * sizeof(DATA32)); - return; - dx = 0; - dy = 0; } +#if 0 /* Unused */ static void __imlib_RGBA_to_BGR8888_fast(DATA32 * src, int src_jump, DATA8 * dst, int dow, @@ -4823,10 +4743,8 @@ __imlib_RGBA_to_BGR8888_fast(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } +#endif static void __imlib_RGBA_to_RGB888_fast(DATA32 * src, int src_jump, @@ -4848,11 +4766,9 @@ __imlib_RGBA_to_RGB888_fast(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } +#if 0 /* Unused */ static void __imlib_RGBA_to_BGR888_fast(DATA32 * src, int src_jump, DATA8 * dest, int dow, @@ -4873,11 +4789,10 @@ __imlib_RGBA_to_BGR888_fast(DATA32 * src, int src_jump, src += src_jump; dest += dest_jump; } - return; - dx = 0; - dy = 0; } +#endif +#if 0 /* Unused */ static void __imlib_RGBA_to_Nothing(DATA32 * src, int src_jump, DATA8 * dest, int dow, @@ -4885,6 +4800,7 @@ __imlib_RGBA_to_Nothing(DATA32 * src, int src_jump, { /*\ Nothing: Dummy function \ */ } +#endif ImlibRGBAFunction __imlib_GetRGBAFunction(int depth, diff --git a/src/lib/rgbadraw.c b/src/lib/rgbadraw.c index f369749..fa1cdd6 100644 --- a/src/lib/rgbadraw.c +++ b/src/lib/rgbadraw.c @@ -258,11 +258,6 @@ __imlib_SharpenImage(ImlibImage * im, int rad) return; else { - int mul, mul2, tot; - - mul = (rad * 4) + 1; - mul2 = rad; - tot = mul - (mul2 * 4); for (y = 1; y < (im->h - 1); y++) { p1 = im->data + 1 + (y * im->w); diff --git a/src/lib/rgbadraw.h b/src/lib/rgbadraw.h index 9dc35b5..11326cb 100644 --- a/src/lib/rgbadraw.h +++ b/src/lib/rgbadraw.h @@ -2,13 +2,14 @@ #define __RGBADRAW 1 #define IN_SEGMENT(x, sx, sw) \ -((unsigned)((x) - (sx)) < (sw)) +((unsigned)((x) - (sx)) < (unsigned)(sw)) #define IN_RANGE(x, y, w, h) \ -( ((unsigned)(x) < (w)) && ((unsigned)(y) < (h)) ) +( ((unsigned)(x) < (unsigned)(w)) && ((unsigned)(y) < (unsigned)(h)) ) #define IN_RECT(x, y, rx, ry, rw, rh) \ -( ((unsigned)((x) - (rx)) < (rw)) && ((unsigned)((y) - (ry)) < (rh)) ) +( ((unsigned)((x) - (rx)) < (unsigned)(rw)) && \ + ((unsigned)((y) - (ry)) < (unsigned)(rh)) ) #define CLIP_RECT_TO_RECT(x, y, w, h, rx, ry, rw, rh) \ { \ diff --git a/src/lib/rotate.c b/src/lib/rotate.c index b4fa034..53d1087 100644 --- a/src/lib/rotate.c +++ b/src/lib/rotate.c @@ -128,19 +128,19 @@ __check_inside_coords(int x, int y, int dxh, int dyh, int dxv, int dyv, sw <<= _ROTATE_PREC; sh <<= _ROTATE_PREC; - if (((unsigned)x >= sw) || ((unsigned)y >= sh)) + if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh)) return 0; x += dxh * dw; y += dyh * dw; - if (((unsigned)x >= sw) || ((unsigned)y >= sh)) + if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh)) return 0; x += dxv * dh; y += dyv * dh; - if (((unsigned)x >= sw) || ((unsigned)y >= sh)) + if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh)) return 0; x -= dxh * dw; y -= dyh * dw; - if (((unsigned)x >= sw) || ((unsigned)y >= sh)) + if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh)) return 0; return 1; @@ -172,7 +172,7 @@ __imlib_RotateSample(DATA32 * src, DATA32 * dest, int sow, int sw, int sh, i = dw - 1; do { - if (((unsigned)x < sw) && ((unsigned)y < sh)) + if (((unsigned)x < (unsigned)sw) && ((unsigned)y < (unsigned)sh)) *dest = src[(x >> _ROTATE_PREC) + ((y >> _ROTATE_PREC) * sow)]; else *dest = 0; @@ -228,9 +228,9 @@ __imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh, { DATA32 *src_x_y = (src + (x >> _ROTATE_PREC) + ((y >> _ROTATE_PREC) * sow)); - if ((unsigned)x < sw) + if ((unsigned)x < (unsigned)sw) { - if ((unsigned)y < sh) + if ((unsigned)y < (unsigned)sh) { /*\ 12 * |*| 34 @@ -257,7 +257,7 @@ __imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh, } else if ((unsigned)(x - sw) < (_ROTATE_PREC_MAX)) { - if ((unsigned)y < sh) + if ((unsigned)y < (unsigned)sh) { /*\ 1. * |*| 3. @@ -283,7 +283,7 @@ __imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh, } else if ((unsigned)(~x) < _ROTATE_PREC_MAX) { - if ((unsigned)y < sh) + if ((unsigned)y < (unsigned)sh) { /*\ .2 * |*| .4 diff --git a/src/lib/ximage.c b/src/lib/ximage.c index 8058beb..ed06a06 100644 --- a/src/lib/ximage.c +++ b/src/lib/ximage.c @@ -29,8 +29,6 @@ TmpXError(Display * d, XErrorEvent * ev) { _x_err = 1; return 0; - d = NULL; - ev = NULL; } void @@ -67,7 +65,7 @@ __imlib_ShmGetXImage(Display * d, Visual * v, Drawable draw, int depth, /* get the shm addr for this data chunk */ if (xim->data != (char *)-1) { - XErrorHandler ph; + XErrorHandler ph = NULL; if (x_does_shm == 2) { @@ -149,7 +147,6 @@ int __imlib_GetMaxXImageCount(Display * d) { return list_max_count; - d = NULL; } void @@ -163,7 +160,6 @@ int __imlib_GetMaxXImageTotalSize(Display * d) { return list_max_mem; - d = NULL; } void