fix gcc warnings about set-but-unused and shadows of y1.

NOTE: did not touch mess that is jpeg, someone else can deal with it :-P



SVN revision: 67353
This commit is contained in:
Gustavo Sverzut Barbieri 2012-01-19 16:49:47 +00:00
parent 883923028e
commit 9a47bffc98
13 changed files with 49 additions and 73 deletions

View File

@ -642,10 +642,9 @@ mem_cache_adjust(void)
{ {
int pval = cache_max_adjust; int pval = cache_max_adjust;
int max = 0; int max = 0;
int mem_used;
if (mem_total <= 0) return; if (mem_total <= 0) return;
mem_used = mem_total - mem_free - mem_cached - mem_buffers; //int mem_used = mem_total - mem_free - mem_cached - mem_buffers;
#if 0 // this lets the image cache to grow to fill all real free ram, if #if 0 // this lets the image cache to grow to fill all real free ram, if
// there is any (ie ram unused by disk cache) // there is any (ie ram unused by disk cache)
if (mem_free < mem_total) if (mem_free < mem_total)

View File

@ -35,7 +35,7 @@ _evas_map_calc_geom_change(Evas_Object *obj)
static void static void
_evas_map_calc_map_geometry(Evas_Object *obj) _evas_map_calc_map_geometry(Evas_Object *obj)
{ {
Evas_Coord x1, x2, y1, y2; Evas_Coord x1, x2, yy1, yy2;
const Evas_Map_Point *p, *p_end; const Evas_Map_Point *p, *p_end;
Eina_Bool ch = EINA_FALSE; Eina_Bool ch = EINA_FALSE;
@ -82,7 +82,7 @@ _evas_map_calc_map_geometry(Evas_Object *obj)
p = obj->cur.map->points; p = obj->cur.map->points;
p_end = p + obj->cur.map->count; p_end = p + obj->cur.map->count;
x1 = x2 = lround(p->x); x1 = x2 = lround(p->x);
y1 = y2 = lround(p->y); yy1 = yy2 = lround(p->y);
p++; p++;
for (; p < p_end; p++) for (; p < p_end; p++)
{ {
@ -92,21 +92,21 @@ _evas_map_calc_map_geometry(Evas_Object *obj)
y = lround(p->y); y = lround(p->y);
if (x < x1) x1 = x; if (x < x1) x1 = x;
if (x > x2) x2 = x; if (x > x2) x2 = x;
if (y < y1) y1 = y; if (y < yy1) yy1 = y;
if (y > y2) y2 = y; if (y > yy2) yy2 = y;
} }
// this causes clip-out bugs now mapped objs canbe opaque!!! // this causes clip-out bugs now mapped objs canbe opaque!!!
// // add 1 pixel of fuzz around the map region to ensure updates are correct // // add 1 pixel of fuzz around the map region to ensure updates are correct
// x1 -= 1; y1 -= 1; // x1 -= 1; yy1 -= 1;
// x2 += 1; y2 += 1; // x2 += 1; yy2 += 1;
if (obj->cur.map->normal_geometry.x != x1) ch = 1; if (obj->cur.map->normal_geometry.x != x1) ch = 1;
if (obj->cur.map->normal_geometry.y != y1) ch = 1; if (obj->cur.map->normal_geometry.y != yy1) ch = 1;
if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1; if (obj->cur.map->normal_geometry.w != (x2 - x1)) ch = 1;
if (obj->cur.map->normal_geometry.h != (y2 - y1)) ch = 1; if (obj->cur.map->normal_geometry.h != (yy2 - yy1)) ch = 1;
obj->cur.map->normal_geometry.x = x1; obj->cur.map->normal_geometry.x = x1;
obj->cur.map->normal_geometry.y = y1; obj->cur.map->normal_geometry.y = yy1;
obj->cur.map->normal_geometry.w = (x2 - x1); obj->cur.map->normal_geometry.w = (x2 - x1);
obj->cur.map->normal_geometry.h = (y2 - y1); obj->cur.map->normal_geometry.h = (yy2 - yy1);
if (ch) _evas_map_calc_geom_change(obj); if (ch) _evas_map_calc_geom_change(obj);
} }
@ -896,7 +896,7 @@ evas_map_util_3d_lighting(Evas_Map *m,
for (i = 0; i < m->count; i++) for (i = 0; i < m->count; i++)
{ {
double x, y, z; double x, y, z;
double nx, ny, nz, x1, y1, z1, x2, y2, z2, ln, br; double nx, ny, nz, x1, yy1, z1, x2, yy2, z2, ln, br;
int h, j, mr, mg, mb; int h, j, mr, mg, mb;
x = m->points[i].x; x = m->points[i].x;
@ -907,15 +907,15 @@ evas_map_util_3d_lighting(Evas_Map *m,
j = (i + 1) % 4 + (i & ~0x3); // next point j = (i + 1) % 4 + (i & ~0x3); // next point
x1 = m->points[h].x - x; x1 = m->points[h].x - x;
y1 = m->points[h].y - y; yy1 = m->points[h].y - y;
z1 = m->points[h].z - z; z1 = m->points[h].z - z;
x2 = m->points[j].x - x; x2 = m->points[j].x - x;
y2 = m->points[j].y - y; yy2 = m->points[j].y - y;
z2 = m->points[j].z - z; z2 = m->points[j].z - z;
nx = (y1 * z2) - (z1 * y2); nx = (yy1 * z2) - (z1 * yy2);
ny = (z1 * x2) - (x1 * z2); ny = (z1 * x2) - (x1 * z2);
nz = (x1 * y2) - (y1 * x2); nz = (x1 * yy2) - (yy1 * x2);
ln = (nx * nx) + (ny * ny) + (nz * nz); ln = (nx * nx) + (ny * ny) + (nz * nz);
ln = sqrt(ln); ln = sqrt(ln);

View File

@ -230,7 +230,7 @@ evas_object_clip_changes_clean(Evas_Object *obj)
} }
void void
evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v) evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v __UNUSED__)
{ {
Eina_Rectangle *r; Eina_Rectangle *r;
Evas_Object *clipper; Evas_Object *clipper;
@ -241,7 +241,6 @@ evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int i
if (obj->smart.smart) goto end; if (obj->smart.smart) goto end;
/* FIXME: was_v isn't used... why? */ /* FIXME: was_v isn't used... why? */
was_v = 0;
if (!obj->clip.clipees) if (!obj->clip.clipees)
{ {
EINA_ARRAY_ITER_NEXT(rects, i, r, it) EINA_ARRAY_ITER_NEXT(rects, i, r, it)

View File

@ -133,7 +133,7 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
int num_active_edges; int num_active_edges;
int n; int n;
int i, j, k; int i, j, k;
int y0, y1, yi; int yy0, yy1, yi;
int ext_x, ext_y, ext_w, ext_h; int ext_x, ext_y, ext_w, ext_h;
int *sorted_index; int *sorted_index;
@ -211,14 +211,14 @@ evas_common_polygon_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Po
k++; k++;
} }
y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5)); yy0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5)); yy1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
k = 0; k = 0;
num_active_edges = 0; num_active_edges = 0;
spans = NULL; spans = NULL;
for (yi = y0; yi <= y1; yi++) for (yi = yy0; yi <= yy1; yi++)
{ {
for (; (k < n) && (point[sorted_index[k]].y <= ((double)yi + 0.5)); k++) for (; (k < n) && (point[sorted_index[k]].y <= ((double)yi + 0.5)); k++)
{ {

View File

@ -90,7 +90,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
DATA32 *buf, *dptr; DATA32 *buf, *dptr;
DATA32 **row_ptr; DATA32 **row_ptr;
DATA32 *ptr, *dst_ptr, *src_data, *dst_data; DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
int dst_jump;
int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h; int dst_clip_x, dst_clip_y, dst_clip_w, dst_clip_h;
int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0; int m_clip_x = 0, m_clip_y = 0, m_clip_w = 0, m_clip_h = 0, mdx = 0, mdy = 0;
int src_w, src_h, dst_w, dst_h; int src_w, src_h, dst_w, dst_h;
@ -248,7 +247,7 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
row_ptr = alloca(dst_clip_h * sizeof(DATA32 *)); row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
/* figure out dst jump */ /* figure out dst jump */
dst_jump = dst_w - dst_clip_w; //dst_jump = dst_w - dst_clip_w;
/* figure out dest start ptr */ /* figure out dest start ptr */
dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w); dst_ptr = dst_data + dst_clip_x + (dst_clip_y * dst_w);

View File

@ -3,7 +3,7 @@
DATA32 *pix, *dptr, *pbuf, **yp; DATA32 *pix, *dptr, *pbuf, **yp;
int r, g, b, a, rr, gg, bb, aa; int r, g, b, a, rr, gg, bb, aa;
int *xp, xap, yap, pos; int *xp, xap, yap, pos;
int dyy, dxx; //int dyy, dxx;
int w = dst_clip_w; int w = dst_clip_w;
#ifdef EVAS_SLI #ifdef EVAS_SLI
int ysli = dst_clip_y; int ysli = dst_clip_y;
@ -11,8 +11,8 @@
dptr = dst_ptr; dptr = dst_ptr;
pos = (src_region_y * src_w) + src_region_x; pos = (src_region_y * src_w) + src_region_x;
dyy = dst_clip_y - dst_region_y; //dyy = dst_clip_y - dst_region_y;
dxx = dst_clip_x - dst_region_x; //dxx = dst_clip_x - dst_region_x;
xp = xpoints;// + dxx; xp = xpoints;// + dxx;
yp = ypoints;// + dyy; yp = ypoints;// + dyy;

View File

@ -3,7 +3,7 @@
DATA32 *dptr, *sptr, *pix, *pbuf; DATA32 *dptr, *sptr, *pix, *pbuf;
int a, r, g, b, rx, gx, bx, ax; int a, r, g, b, rx, gx, bx, ax;
int xap, yap, pos; int xap, yap, pos;
int dyy, dxx; //int dyy, dxx;
#ifdef EVAS_SLI #ifdef EVAS_SLI
int ysli = dst_clip_y; int ysli = dst_clip_y;
#endif #endif
@ -14,8 +14,8 @@
dptr = dst_ptr; dptr = dst_ptr;
pos = (src_region_y * src_w) + src_region_x; pos = (src_region_y * src_w) + src_region_x;
dyy = dst_clip_y - dst_region_y; //dyy = dst_clip_y - dst_region_y;
dxx = dst_clip_x - dst_region_x; //dxx = dst_clip_x - dst_region_x;
xp = xpoints;// + dxx; xp = xpoints;// + dxx;
yp = ypoints;// + dyy; yp = ypoints;// + dyy;

View File

@ -3,7 +3,7 @@
DATA32 *dptr, *pix, *pbuf, **yp; DATA32 *dptr, *pix, *pbuf, **yp;
int r, g, b, a, rr, gg, bb, aa; int r, g, b, a, rr, gg, bb, aa;
int *xp, xap, yap, pos; int *xp, xap, yap, pos;
int dyy, dxx; //int dyy, dxx;
int w = dst_clip_w; int w = dst_clip_w;
#ifdef EVAS_SLI #ifdef EVAS_SLI
int ysli = dst_clip_y; int ysli = dst_clip_y;
@ -11,8 +11,8 @@
dptr = dst_ptr; dptr = dst_ptr;
pos = (src_region_y * src_w) + src_region_x; pos = (src_region_y * src_w) + src_region_x;
dyy = dst_clip_y - dst_region_y; //dyy = dst_clip_y - dst_region_y;
dxx = dst_clip_x - dst_region_x; //dxx = dst_clip_x - dst_region_x;
xp = xpoints;// + dxx; xp = xpoints;// + dxx;
yp = ypoints;// + dyy; yp = ypoints;// + dyy;

View File

@ -358,20 +358,14 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
} }
static void static void
eng_output_flush(void *data) eng_output_flush(void *data __UNUSED__)
{ {
Render_Engine *re;
re = (Render_Engine *)data;
evas_buffer_outbuf_buf_switch_buffer(re->ob); evas_buffer_outbuf_buf_switch_buffer(re->ob);
} }
static void static void
eng_output_idle_flush(void *data) eng_output_idle_flush(void *data __UNUSED__)
{ {
Render_Engine *re;
re = (Render_Engine *)data;
} }
static Eina_Bool static Eina_Bool

View File

@ -25,7 +25,6 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
) )
{ {
Outbuf *buf; Outbuf *buf;
int bpp;
buf = calloc(1, sizeof(Outbuf)); buf = calloc(1, sizeof(Outbuf));
if (!buf) return NULL; if (!buf) return NULL;
@ -47,11 +46,6 @@ evas_buffer_outbuf_buf_setup_fb(int w, int h, Outbuf_Depth depth, void *dest, in
buf->func.switch_buffer = switch_buffer; buf->func.switch_buffer = switch_buffer;
buf->switch_data = switch_data; buf->switch_data = switch_data;
bpp = sizeof(DATA32);
if ((buf->depth == OUTBUF_DEPTH_RGB_24BPP_888_888) ||
(buf->depth == OUTBUF_DEPTH_BGR_24BPP_888_888))
bpp = 3;
if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) && if ((buf->depth == OUTBUF_DEPTH_ARGB_32BPP_8888_8888) &&
(buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32)))) (buf->dest) && (buf->dest_row_bytes == (buf->w * sizeof(DATA32))))
{ {

View File

@ -74,7 +74,7 @@ _output_setup(int w, int h, int rot, int vt, int dev, int refresh)
/* engine api this module provides */ /* engine api this module provides */
static void * static void *
eng_info(Evas *e) eng_info(Evas *e __UNUSED__)
{ {
Evas_Engine_Info_FB *info; Evas_Engine_Info_FB *info;
info = calloc(1, sizeof(Evas_Engine_Info_FB)); info = calloc(1, sizeof(Evas_Engine_Info_FB));
@ -82,7 +82,6 @@ eng_info(Evas *e)
info->magic.magic = rand(); info->magic.magic = rand();
info->render_mode = EVAS_RENDER_MODE_BLOCKING; info->render_mode = EVAS_RENDER_MODE_BLOCKING;
return info; return info;
e = NULL;
} }
static void static void
@ -231,19 +230,13 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
} }
static void static void
eng_output_flush(void *data) eng_output_flush(void *data __UNUSED__)
{ {
Render_Engine *re;
re = (Render_Engine *)data;
} }
static void static void
eng_output_idle_flush(void *data) eng_output_idle_flush(void *data __UNUSED__)
{ {
Render_Engine *re;
re = (Render_Engine *)data;
} }
static Eina_Bool static Eina_Bool

View File

@ -25,7 +25,7 @@ evas_fb_outbuf_fb_setup_fb(int w, int h, int rot, Outbuf_Depth depth, int vt_no,
/* setup window and/or fb */ /* setup window and/or fb */
/* if (dithered) create backbuf */ /* if (dithered) create backbuf */
Outbuf *buf; Outbuf *buf;
int fb_fd = -1; int fb_fd;
int fb_depth; int fb_depth;
fb_depth = -1; fb_depth = -1;
@ -51,6 +51,11 @@ evas_fb_outbuf_fb_setup_fb(int w, int h, int rot, Outbuf_Depth depth, int vt_no,
return NULL; return NULL;
} }
fb_fd = fb_postinit(buf->priv.fb.fb); fb_fd = fb_postinit(buf->priv.fb.fb);
if (fb_fd < 1)
{
free(buf);
return NULL;
}
if (rot == 0 || rot == 180) if (rot == 0 || rot == 180)
{ {

View File

@ -591,11 +591,8 @@ eng_image_border_set(void *data __UNUSED__, void *image, int l __UNUSED__, int r
} }
static void static void
eng_image_border_get(void *data __UNUSED__, void *image, int *l __UNUSED__, int *r __UNUSED__, int *t __UNUSED__, int *b __UNUSED__) eng_image_border_get(void *data __UNUSED__, void *image __UNUSED__, int *l __UNUSED__, int *r __UNUSED__, int *t __UNUSED__, int *b __UNUSED__)
{ {
RGBA_Image *im;
im = image;
} }
static char * static char *
@ -704,18 +701,16 @@ eng_image_size_get(void *data __UNUSED__, void *image, int *w, int *h)
static void * static void *
eng_image_size_set(void *data __UNUSED__, void *image, int w, int h) eng_image_size_set(void *data __UNUSED__, void *image, int w, int h)
{ {
Image_Entry *im; Image_Entry *im = image;
if (!im) return NULL;
im = image; return evas_cache_image_size_set(im, w, h);
return evas_cache_image_size_set(image, w, h);
} }
static void * static void *
eng_image_dirty_region(void *data __UNUSED__, void *image, int x, int y, int w, int h) eng_image_dirty_region(void *data __UNUSED__, void *image, int x, int y, int w, int h)
{ {
Image_Entry *im = image; Image_Entry *im = image;
if (!im) return NULL;
if (!image) return NULL;
return evas_cache_image_dirty(im, x, y, w, h); return evas_cache_image_dirty(im, x, y, w, h);
} }
@ -931,11 +926,10 @@ static void *
eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha) eng_image_map_surface_new(void *data __UNUSED__, int w, int h, int alpha)
{ {
void *surface; void *surface;
DATA32 *pixels;
surface = evas_cache_image_copied_data(evas_common_image_cache_get(), surface = evas_cache_image_copied_data(evas_common_image_cache_get(),
w, h, NULL, alpha, w, h, NULL, alpha,
EVAS_COLORSPACE_ARGB8888); EVAS_COLORSPACE_ARGB8888);
pixels = evas_cache_image_pixels(surface); evas_cache_image_pixels(surface);
return surface; return surface;
} }
@ -2519,7 +2513,7 @@ evgl_glShaderSource(GLuint shader, GLsizei count, const char** string, const GLi
static void static void
evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) evgl_glGetShaderPrecisionFormat(GLenum shadertype __UNUSED__, GLenum precisiontype __UNUSED__, GLint* range, GLint* precision)
{ {
if (range) if (range)
{ {
@ -2531,7 +2525,6 @@ evgl_glGetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint*
precision[0] = 24; // floor(-log2((1.0/16777218.0))); precision[0] = 24; // floor(-log2((1.0/16777218.0)));
} }
return; return;
shadertype = precisiontype = 0;
} }
static void static void