Silence compiler warnings (lib).

This commit is contained in:
Kim Woelders 2013-07-02 06:25:21 +02:00
parent 6e41fe2e1a
commit 0c647a7f24
15 changed files with 63 additions and 188 deletions

View File

@ -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) int width, int height, char need_to_grab_x)
{ {
ImlibImage *im; ImlibImage *im;
char domask = 0;
CHECK_CONTEXT(ctx); CHECK_CONTEXT(ctx);
if (mask)
domask = 1;
im = __imlib_CreateImage(width, height, NULL); im = __imlib_CreateImage(width, height, NULL);
im->data = malloc(width * height * sizeof(DATA32)); im->data = malloc(width * height * sizeof(DATA32));
__imlib_GrabXImageToRGBA(im->data, 0, 0, width, height, __imlib_GrabXImageToRGBA(im->data, 0, 0, width, height,

View File

@ -16,8 +16,8 @@
#include "script.h" #include "script.h"
#include "loaderpath.h" #include "loaderpath.h"
pImlibExternalFilter filters = NULL; static pImlibExternalFilter filters = NULL;
int dyn_initialised = 0; static int dyn_initialised = 0;
#define MALLOCSHOW #define MALLOCSHOW
#define FREESHOW #define FREESHOW
@ -87,7 +87,7 @@ __imlib_dynamic_filters_init()
{ {
MALLOCSHOW; MALLOCSHOW;
filters = malloc(sizeof(ImlibExternalFilter)); filters = malloc(sizeof(ImlibExternalFilter));
filters->filename = ""; filters->filename = (char *)"";
filters->next = NULL; filters->next = NULL;
ptr = filters; ptr = filters;
#ifdef FDEBUG #ifdef FDEBUG

View File

@ -14,6 +14,7 @@ struct imlib_filter_info
typedef struct _imlib_external_filter ImlibExternalFilter; typedef struct _imlib_external_filter ImlibExternalFilter;
typedef struct _imlib_external_filter *pImlibExternalFilter; typedef struct _imlib_external_filter *pImlibExternalFilter;
struct _imlib_external_filter struct _imlib_external_filter
{ {
char *name; char *name;
@ -24,20 +25,15 @@ struct _imlib_external_filter
void *handle; void *handle;
char **filters; char **filters;
void (*init_filter)( struct imlib_filter_info *info ); void (*init_filter)( struct imlib_filter_info *info );
void (*deinit_filter)(); void (*deinit_filter)(void);
void *(*exec_filter)( char *filter, void *im, pIFunctionParam params ); void *(*exec_filter)( char *filter, void *im, pIFunctionParam params );
pImlibExternalFilter next; pImlibExternalFilter next;
}; };
__hidden void __imlib_dynamic_filters_init(); __hidden void __imlib_dynamic_filters_init(void);
__hidden void __imlib_dynamic_filters_deinit(); __hidden void __imlib_dynamic_filters_deinit(void);
__hidden pImlibExternalFilter __imlib_get_dynamic_filter( char *name ); __hidden pImlibExternalFilter __imlib_get_dynamic_filter( char *name );
__hidden char **__imlib_ListFilters(int *num_ret); __hidden char **__imlib_ListFilters(int *num_ret);
__hidden pImlibExternalFilter __imlib_LoadFilter( char *file ); __hidden pImlibExternalFilter __imlib_LoadFilter( char *file );
#endif #endif

View File

@ -378,9 +378,9 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
bpp -= (lx + 1); bpp -= (lx + 1);
} }
if (((unsigned)(ty) < clh) && (len > 0)) if (((unsigned)ty < (unsigned)clh) && (len > 0))
sfunc(color, tpp, len); sfunc(color, tpp, len);
if (((unsigned)(by) < clh) && (len > 0)) if (((unsigned)by < (unsigned)clh) && (len > 0))
sfunc(color, bpp, len); sfunc(color, bpp, len);
} }
@ -448,9 +448,9 @@ __imlib_Ellipse_FillToData(int xc, int yc, int a, int b, DATA32 color,
bpp -= lx; bpp -= lx;
} }
if (((unsigned)(ty) < clh) && (len > 0)) if (((unsigned)ty < (unsigned)clh) && (len > 0))
sfunc(color, tpp, len); sfunc(color, tpp, len);
if (((unsigned)(by) < clh) && (len > 0)) if (((unsigned)by < (unsigned)clh) && (len > 0))
sfunc(color, bpp, len); sfunc(color, bpp, len);
dx -= a2; dx -= a2;
@ -535,9 +535,9 @@ __imlib_Ellipse_FillToData_AA(int xc, int yc, int a, int b, DATA32 color,
bpp -= (lx + 1); bpp -= (lx + 1);
} }
if (((unsigned)(ty) < clh) && (len > 0)) if (((unsigned)ty < (unsigned)clh) && (len > 0))
sfunc(color, tpp, len); sfunc(color, tpp, len);
if (((unsigned)(by) < clh) && (len > 0)) if (((unsigned)by < (unsigned)clh) && (len > 0))
sfunc(color, bpp, len); 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); bpp -= (lx + 1);
} }
if (((unsigned)(ty) < clh) && (len > 0)) if (((unsigned)ty < (unsigned)clh) && (len > 0))
sfunc(color, tpp, len); sfunc(color, tpp, len);
if (((unsigned)(by) < clh) && (len > 0)) if (((unsigned)by < (unsigned)clh) && (len > 0))
sfunc(color, bpp, len); sfunc(color, bpp, len);
A_VAL(&col1) = ((xx - (x << 16)) >> 8); A_VAL(&col1) = ((xx - (x << 16)) >> 8);

View File

@ -265,8 +265,6 @@ font_modify_cache_cb(Imlib_Hash * hash, const char *key, void *data,
dir = fdata; 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 */ 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; return 1;
hash = 0;
key = 0;
} }
void void
@ -316,9 +314,6 @@ font_flush_free_glyph_cb(Imlib_Hash * hash, const char *key, void *data,
FT_Done_Glyph(fg->glyph); FT_Done_Glyph(fg->glyph);
free(fg); free(fg);
return 1; return 1;
hash = 0;
key = 0;
fdata = 0;
} }
void void

View File

@ -22,7 +22,7 @@ void
imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h) imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h)
{ {
int use_kerning; int use_kerning;
int pen_x, pen_y; int pen_x /*, pen_y */ ;
int start_x, end_x; int start_x, end_x;
int chr; int chr;
FT_UInt prev_index; FT_UInt prev_index;
@ -30,7 +30,7 @@ imlib_font_query_size(ImlibFont * fn, const char *text, int *w, int *h)
start_x = 0; start_x = 0;
end_x = 0; end_x = 0;
pen_x = 0; pen_x = 0;
pen_y = 0; /* pen_y = 0; */
use_kerning = FT_HAS_KERNING(fn->ft.face); use_kerning = FT_HAS_KERNING(fn->ft.face);
prev_index = 0; prev_index = 0;
for (chr = 0; text[chr];) 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; FT_UInt index;
Imlib_Font_Glyph *fg; Imlib_Font_Glyph *fg;
ImlibFont *fn_in_chain; ImlibFont *fn_in_chain;
int chr_x, chr_y, chr_w; int chr_x, /*chr_y, */ chr_w;
int gl; int gl;
gl = imlib_font_utf8_get_next((unsigned char *)text, &chr); 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; continue;
chr_x = (pen_x >> 8) + fg->glyph_out->left; 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; chr_w = fg->glyph_out->bitmap.width;
if (pen_x == 0) if (pen_x == 0)
@ -104,14 +104,13 @@ imlib_font_query_advance(ImlibFont * fn, const char *text, int *h_adv,
int *v_adv) int *v_adv)
{ {
int use_kerning; int use_kerning;
int pen_x, pen_y; int pen_x;
int start_x; int start_x;
int chr; int chr;
FT_UInt prev_index; FT_UInt prev_index;
start_x = 0; start_x = 0;
pen_x = 0; pen_x = 0;
pen_y = 0;
use_kerning = FT_HAS_KERNING(fn->ft.face); use_kerning = FT_HAS_KERNING(fn->ft.face);
prev_index = 0; prev_index = 0;
for (chr = 0; text[chr];) for (chr = 0; text[chr];)
@ -119,7 +118,6 @@ imlib_font_query_advance(ImlibFont * fn, const char *text, int *h_adv,
FT_UInt index; FT_UInt index;
Imlib_Font_Glyph *fg; Imlib_Font_Glyph *fg;
ImlibFont *fn_in_chain; ImlibFont *fn_in_chain;
int chr_x, chr_y, chr_w;
int gl; int gl;
gl = imlib_font_utf8_get_next((unsigned char *)text, &chr); 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) if (!fg)
continue; 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; pen_x += fg->glyph->advance.x >> 8;
prev_index = index; 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 *cx, int *cy, int *cw, int *ch)
{ {
int use_kerning; int use_kerning;
int pen_x, pen_y; int pen_x;
int prev_chr_end; int prev_chr_end;
int chr; int chr;
int asc, desc; int asc, desc;
FT_UInt prev_index; FT_UInt prev_index;
pen_x = 0; pen_x = 0;
pen_y = 0;
use_kerning = FT_HAS_KERNING(fn->ft.face); use_kerning = FT_HAS_KERNING(fn->ft.face);
prev_index = 0; prev_index = 0;
prev_chr_end = 0; prev_chr_end = 0;
@ -176,7 +169,7 @@ imlib_font_query_char_coords(ImlibFont * fn, const char *text, int pos,
FT_UInt index; FT_UInt index;
Imlib_Font_Glyph *fg; Imlib_Font_Glyph *fg;
ImlibFont *fn_in_chain; ImlibFont *fn_in_chain;
int chr_x, chr_y, chr_w; int chr_x, chr_w;
int gl, kern; int gl, kern;
FT_Vector delta; FT_Vector delta;
@ -200,7 +193,6 @@ imlib_font_query_char_coords(ImlibFont * fn, const char *text, int pos,
if (kern < 0) if (kern < 0)
kern = 0; kern = 0;
chr_x = ((pen_x - kern) >> 8) + fg->glyph_out->left; 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); chr_w = fg->glyph_out->bitmap.width + (kern >> 8);
if (text[chr]) 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 *cx, int *cy, int *cw, int *ch)
{ {
int use_kerning; int use_kerning;
int pen_x, pen_y; int pen_x;
int prev_chr_end; int prev_chr_end;
int chr; int chr;
int asc, desc; int asc, desc;
FT_UInt prev_index; FT_UInt prev_index;
pen_x = 0; pen_x = 0;
pen_y = 0;
use_kerning = FT_HAS_KERNING(fn->ft.face); use_kerning = FT_HAS_KERNING(fn->ft.face);
prev_index = 0; prev_index = 0;
prev_chr_end = 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; FT_UInt index;
Imlib_Font_Glyph *fg; Imlib_Font_Glyph *fg;
ImlibFont *fn_in_chain; ImlibFont *fn_in_chain;
int chr_x, chr_y, chr_w; int chr_x, chr_w;
int gl, kern; int gl, kern;
FT_Vector delta; 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) if (kern < 0)
kern = 0; kern = 0;
chr_x = ((pen_x - kern) >> 8) + fg->glyph_out->left; 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); chr_w = fg->glyph_out->bitmap.width + (kern >> 8);
if (text[chr]) if (text[chr])
{ {

View File

@ -15,8 +15,6 @@ static DATA8 rtab[256], gtab[256], btab[256];
static void static void
Tmp_HandleXError(Display * d, XErrorEvent * ev) Tmp_HandleXError(Display * d, XErrorEvent * ev)
{ {
d = NULL;
ev = NULL;
_x_err = 1; _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 is_pixmap = 0, created_mask = 0, is_shm = 0, is_mshm = 0;
char domask; char domask;
int i; 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; int width, height, clipx, clipy;
XShmSegmentInfo shminfo, mshminfo; XShmSegmentInfo shminfo, mshminfo;
XImage *xim, *mxim; XImage *xim, *mxim;
@ -537,8 +535,6 @@ __imlib_GrabDrawableToRGBA(DATA32 * data, int ox, int oy, int ow, int oh,
domask = (pdomask) ? *pdomask : 0; domask = (pdomask) ? *pdomask : 0;
/* FIXME: oh isn't used - i wonder if there's a bug looming... */ /* FIXME: oh isn't used - i wonder if there's a bug looming... */
oh = 0; oh = 0;
origw = w;
origh = h;
if (grab) if (grab)
XGrabServer(d); XGrabServer(d);
XSync(d, False); XSync(d, False);

View File

@ -565,7 +565,7 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
break; break;
} }
if ((unsigned)(px) < clw) if ((unsigned)(px) < (unsigned)clw)
{ {
aa = (yy - (y << 16)) >> 8; 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) if (ca < 255)
MULT(A_VAL(&color), ca, A_VAL(&color), tmp); MULT(A_VAL(&color), ca, A_VAL(&color), tmp);
if ((unsigned)(py) < clh) if ((unsigned)(py) < (unsigned)clh)
pfunc(color, p); pfunc(color, p);
if ((unsigned)(py + 1) < clh) if ((unsigned)(py + 1) < (unsigned)clh)
{ {
A_VAL(&color) = aa; A_VAL(&color) = aa;
if (ca < 255) if (ca < 255)
@ -624,7 +624,7 @@ __imlib_Line_DrawToData_AA(int x0, int y0, int x1, int y1, DATA32 color,
break; break;
} }
if ((unsigned)(py) < clh) if ((unsigned)(py) < (unsigned)clh)
{ {
aa = (xx - (x << 16)) >> 8; 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) if (ca < 255)
MULT(A_VAL(&color), ca, A_VAL(&color), tmp); MULT(A_VAL(&color), ca, A_VAL(&color), tmp);
if ((unsigned)(px) < clw) if ((unsigned)(px) < (unsigned)clw)
pfunc(color, p); pfunc(color, p);
if ((unsigned)(px + 1) < clw) if ((unsigned)(px + 1) < (unsigned)clw)
{ {
A_VAL(&color) = aa; A_VAL(&color) = aa;
if (ca < 255) if (ca < 255)

View File

@ -356,27 +356,20 @@ do { \
switch(e->type) \ switch(e->type) \
{ \ { \
case SHALLOW_EDGE: \ case SHALLOW_EDGE: \
{ \
elx = (e->xx - (2 * e->dxx)) >> 16; \ elx = (e->xx - (2 * e->dxx)) >> 16; \
erx = (e->xx + (2 * e->dxx)) >> 16; \ erx = (e->xx + (2 * e->dxx)) >> 16; \
if (e->dxx < 0) \ if (e->dxx < 0) \
{ lx = elx; elx = erx; erx = lx; } \ { lx = elx; elx = erx; erx = lx; } \
break; \ break; \
} \ default: \
case STEEP_EDGE: \ case STEEP_EDGE: \
{ \
lx = (e->xx >> 16); \ lx = (e->xx >> 16); \
elx = erx = lx; \ elx = erx = lx; \
break; \ break; \
} \
case HORZ_EDGE: \ case HORZ_EDGE: \
{ \
elx = e->v0->x; \ elx = e->v0->x; \
erx = e->v1->x; \ erx = e->v1->x; \
break; \ break; \
} \
default: \
break; \
} \ } \
} while (0) } while (0)

View File

@ -97,7 +97,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
} }
for (i = 31; i >= 0; i--) for (i = 31; i >= 0; i--)
{ {
if (rm >= (1 << i)) if (rm >= (1U << i))
{ {
rshift = i - 7; rshift = i - 7;
break; break;
@ -105,7 +105,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
} }
for (i = 31; i >= 0; i--) for (i = 31; i >= 0; i--)
{ {
if (gm >= (1 << i)) if (gm >= (1U << i))
{ {
gshift = i - 7; gshift = i - 7;
break; break;
@ -113,7 +113,7 @@ __imlib_RenderGetPixel(Display * d, Drawable w, Visual * v, Colormap cm,
} }
for (i = 31; i >= 0; i--) for (i = 31; i >= 0; i--)
{ {
if (bm >= (1 << i)) if (bm >= (1U << i))
{ {
bshift = i - 7; bshift = i - 7;
break; break;
@ -140,11 +140,12 @@ static void
__imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy, __imlib_generic_render(DATA32 * src, int jump, int w, int h, int dx, int dy,
XImage * xim, Visual * v, Context * ct) 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; unsigned int rmask, gmask, bmask;
int i, rshift, gshift, bshift; 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}, {0, 32, 8, 40, 2, 34, 10, 42},
{48, 16, 56, 24, 50, 18, 58, 26}, {48, 16, 56, 24, 50, 18, 58, 26},
{12, 44, 4, 36, 14, 46, 6, 38}, {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; bshift = 0;
for (i = 31; i >= 0; i--) for (i = 31; i >= 0; i--)
{ {
if (rmask >= (1 << i)) if (rmask >= (1U << i))
{ {
rshift = i - 7; rshift = i - 7;
break; 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--) for (i = 31; i >= 0; i--)
{ {
if (gmask >= (1 << i)) if (gmask >= (1U << i))
{ {
gshift = i - 7; gshift = i - 7;
break; 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--) for (i = 31; i >= 0; i--)
{ {
if (bmask >= (1 << i)) if (bmask >= (1U << i))
{ {
bshift = i - 7; bshift = i - 7;
break; break;
@ -529,7 +530,6 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m,
char dither_mask, int mat, ImlibColorModifier * cmod, char dither_mask, int mat, ImlibColorModifier * cmod,
ImlibOp op) ImlibOp op)
{ {
Context *ct;
int dx1, dy1, dx2, dy2, dw, dh, tsx, tsy; int dx1, dy1, dx2, dy2, dw, dh, tsx, tsy;
ImlibImage *back; ImlibImage *back;
@ -580,7 +580,7 @@ __imlib_RenderImageSkewed(Display * d, ImlibImage * im, Drawable w, Drawable m,
dy1 = 0; dy1 = 0;
} }
ct = __imlib_GetContext(d, v, cm, depth); __imlib_GetContext(d, v, cm, depth);
back = __imlib_CreateImage(dw, dh, NULL); back = __imlib_CreateImage(dw, dh, NULL);
back->data = calloc(dw * dh, sizeof(DATA32)); back->data = calloc(dw * dh, sizeof(DATA32));

View File

@ -2925,9 +2925,6 @@ __imlib_RGBA_to_RGB565_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -2997,9 +2994,6 @@ __imlib_RGBA_to_RGB565_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3067,9 +3061,6 @@ __imlib_RGBA_to_BGR565_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3139,9 +3130,6 @@ __imlib_RGBA_to_BGR565_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3209,9 +3197,6 @@ __imlib_RGBA_to_RGB555_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3281,9 +3266,6 @@ __imlib_RGBA_to_RGB555_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3351,9 +3333,6 @@ __imlib_RGBA_to_BGR555_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3423,9 +3402,6 @@ __imlib_RGBA_to_BGR555_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3521,9 +3497,6 @@ __imlib_RGBA_to_RGB332_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3601,9 +3574,6 @@ __imlib_RGBA_to_RGB332_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3699,9 +3669,6 @@ __imlib_RGBA_to_RGB666_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3779,9 +3746,6 @@ __imlib_RGBA_to_RGB666_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3877,9 +3841,6 @@ __imlib_RGBA_to_RGB232_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -3957,9 +3918,6 @@ __imlib_RGBA_to_RGB232_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4055,9 +4013,6 @@ __imlib_RGBA_to_RGB222_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4135,9 +4090,6 @@ __imlib_RGBA_to_RGB222_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4233,9 +4185,6 @@ __imlib_RGBA_to_RGB221_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4313,9 +4262,6 @@ __imlib_RGBA_to_RGB221_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4411,9 +4357,6 @@ __imlib_RGBA_to_RGB121_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4491,9 +4434,6 @@ __imlib_RGBA_to_RGB121_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4589,9 +4529,6 @@ __imlib_RGBA_to_RGB111_fast(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4669,9 +4606,6 @@ __imlib_RGBA_to_RGB111_dither(DATA32 * src, int src_jump,
} }
} }
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4694,9 +4628,6 @@ __imlib_RGBA_to_RGB1_fast(DATA32 * src, int src_jump,
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4719,9 +4650,6 @@ __imlib_RGBA_to_RGB1_dither(DATA32 * src, int src_jump,
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4739,14 +4667,11 @@ __imlib_RGBA_to_A1_fast(DATA32 * src, int src_jump,
{ {
for (x = 0; x < w; x++) for (x = 0; x < w; x++)
{ {
WRITE1_RGBA_A1(src, dest, threshold); WRITE1_RGBA_A1(src, dest, (DATA32) threshold);
} }
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4769,9 +4694,6 @@ __imlib_RGBA_to_A1_dither(DATA32 * src, int src_jump,
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
static void static void
@ -4797,11 +4719,9 @@ __imlib_RGBA_to_RGB8888_fast(DATA32 * src, int src_jump,
} }
else else
memcpy(dest, src, h * w * sizeof(DATA32)); memcpy(dest, src, h * w * sizeof(DATA32));
return;
dx = 0;
dy = 0;
} }
#if 0 /* Unused */
static void static void
__imlib_RGBA_to_BGR8888_fast(DATA32 * src, int src_jump, __imlib_RGBA_to_BGR8888_fast(DATA32 * src, int src_jump,
DATA8 * dst, int dow, DATA8 * dst, int dow,
@ -4823,10 +4743,8 @@ __imlib_RGBA_to_BGR8888_fast(DATA32 * src, int src_jump,
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
#endif
static void static void
__imlib_RGBA_to_RGB888_fast(DATA32 * src, int src_jump, __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; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
#if 0 /* Unused */
static void static void
__imlib_RGBA_to_BGR888_fast(DATA32 * src, int src_jump, __imlib_RGBA_to_BGR888_fast(DATA32 * src, int src_jump,
DATA8 * dest, int dow, DATA8 * dest, int dow,
@ -4873,11 +4789,10 @@ __imlib_RGBA_to_BGR888_fast(DATA32 * src, int src_jump,
src += src_jump; src += src_jump;
dest += dest_jump; dest += dest_jump;
} }
return;
dx = 0;
dy = 0;
} }
#endif
#if 0 /* Unused */
static void static void
__imlib_RGBA_to_Nothing(DATA32 * src, int src_jump, __imlib_RGBA_to_Nothing(DATA32 * src, int src_jump,
DATA8 * dest, int dow, DATA8 * dest, int dow,
@ -4885,6 +4800,7 @@ __imlib_RGBA_to_Nothing(DATA32 * src, int src_jump,
{ {
/*\ Nothing: Dummy function \ */ /*\ Nothing: Dummy function \ */
} }
#endif
ImlibRGBAFunction ImlibRGBAFunction
__imlib_GetRGBAFunction(int depth, __imlib_GetRGBAFunction(int depth,

View File

@ -258,11 +258,6 @@ __imlib_SharpenImage(ImlibImage * im, int rad)
return; return;
else else
{ {
int mul, mul2, tot;
mul = (rad * 4) + 1;
mul2 = rad;
tot = mul - (mul2 * 4);
for (y = 1; y < (im->h - 1); y++) for (y = 1; y < (im->h - 1); y++)
{ {
p1 = im->data + 1 + (y * im->w); p1 = im->data + 1 + (y * im->w);

View File

@ -2,13 +2,14 @@
#define __RGBADRAW 1 #define __RGBADRAW 1
#define IN_SEGMENT(x, sx, sw) \ #define IN_SEGMENT(x, sx, sw) \
((unsigned)((x) - (sx)) < (sw)) ((unsigned)((x) - (sx)) < (unsigned)(sw))
#define IN_RANGE(x, y, w, h) \ #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) \ #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) \ #define CLIP_RECT_TO_RECT(x, y, w, h, rx, ry, rw, rh) \
{ \ { \

View File

@ -128,19 +128,19 @@ __check_inside_coords(int x, int y, int dxh, int dyh, int dxv, int dyv,
sw <<= _ROTATE_PREC; sw <<= _ROTATE_PREC;
sh <<= _ROTATE_PREC; sh <<= _ROTATE_PREC;
if (((unsigned)x >= sw) || ((unsigned)y >= sh)) if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh))
return 0; return 0;
x += dxh * dw; x += dxh * dw;
y += dyh * dw; y += dyh * dw;
if (((unsigned)x >= sw) || ((unsigned)y >= sh)) if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh))
return 0; return 0;
x += dxv * dh; x += dxv * dh;
y += dyv * dh; y += dyv * dh;
if (((unsigned)x >= sw) || ((unsigned)y >= sh)) if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh))
return 0; return 0;
x -= dxh * dw; x -= dxh * dw;
y -= dyh * dw; y -= dyh * dw;
if (((unsigned)x >= sw) || ((unsigned)y >= sh)) if (((unsigned)x >= (unsigned)sw) || ((unsigned)y >= (unsigned)sh))
return 0; return 0;
return 1; return 1;
@ -172,7 +172,7 @@ __imlib_RotateSample(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
i = dw - 1; i = dw - 1;
do 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)]; *dest = src[(x >> _ROTATE_PREC) + ((y >> _ROTATE_PREC) * sow)];
else else
*dest = 0; *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) + DATA32 *src_x_y = (src + (x >> _ROTATE_PREC) +
((y >> _ROTATE_PREC) * sow)); ((y >> _ROTATE_PREC) * sow));
if ((unsigned)x < sw) if ((unsigned)x < (unsigned)sw)
{ {
if ((unsigned)y < sh) if ((unsigned)y < (unsigned)sh)
{ {
/*\ 12 /*\ 12
* |*| 34 * |*| 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)) else if ((unsigned)(x - sw) < (_ROTATE_PREC_MAX))
{ {
if ((unsigned)y < sh) if ((unsigned)y < (unsigned)sh)
{ {
/*\ 1. /*\ 1.
* |*| 3. * |*| 3.
@ -283,7 +283,7 @@ __imlib_RotateAA(DATA32 * src, DATA32 * dest, int sow, int sw, int sh,
} }
else if ((unsigned)(~x) < _ROTATE_PREC_MAX) else if ((unsigned)(~x) < _ROTATE_PREC_MAX)
{ {
if ((unsigned)y < sh) if ((unsigned)y < (unsigned)sh)
{ {
/*\ .2 /*\ .2
* |*| .4 * |*| .4

View File

@ -29,8 +29,6 @@ TmpXError(Display * d, XErrorEvent * ev)
{ {
_x_err = 1; _x_err = 1;
return 0; return 0;
d = NULL;
ev = NULL;
} }
void void
@ -67,7 +65,7 @@ __imlib_ShmGetXImage(Display * d, Visual * v, Drawable draw, int depth,
/* get the shm addr for this data chunk */ /* get the shm addr for this data chunk */
if (xim->data != (char *)-1) if (xim->data != (char *)-1)
{ {
XErrorHandler ph; XErrorHandler ph = NULL;
if (x_does_shm == 2) if (x_does_shm == 2)
{ {
@ -149,7 +147,6 @@ int
__imlib_GetMaxXImageCount(Display * d) __imlib_GetMaxXImageCount(Display * d)
{ {
return list_max_count; return list_max_count;
d = NULL;
} }
void void
@ -163,7 +160,6 @@ int
__imlib_GetMaxXImageTotalSize(Display * d) __imlib_GetMaxXImageTotalSize(Display * d)
{ {
return list_max_mem; return list_max_mem;
d = NULL;
} }
void void