Commit 6ae141d6 authored by Paul Eggert's avatar Paul Eggert
Browse files

* image.c: (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):

(jpeg_load, gif_load): Rename locals to avoid shadowing.
parent 2037898d
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
(x_edge_detection): Remove unnecessary cast that (x_edge_detection): Remove unnecessary cast that
gcc -Wbad-function-cast diagnoses. gcc -Wbad-function-cast diagnoses.
(gif_load): Fix pointer signedness. (gif_load): Fix pointer signedness.
(clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
(jpeg_load, gif_load): Rename locals to avoid shadowing.
   
2011-03-11 Paul Eggert <eggert@cs.ucla.edu> 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
   
...@@ -1557,9 +1557,9 @@ clear_image_cache (struct frame *f, Lisp_Object filter) ...@@ -1557,9 +1557,9 @@ clear_image_cache (struct frame *f, Lisp_Object filter)
FOR_EACH_FRAME (tail, frame) FOR_EACH_FRAME (tail, frame)
{ {
struct frame *f = XFRAME (frame); struct frame *fr = XFRAME (frame);
if (FRAME_IMAGE_CACHE (f) == c) if (FRAME_IMAGE_CACHE (fr) == c)
clear_current_matrices (f); clear_current_matrices (fr);
} }
++windows_or_buffers_changed; ++windows_or_buffers_changed;
...@@ -2651,11 +2651,11 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e ...@@ -2651,11 +2651,11 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
if (LA1 == XBM_TK_NUMBER) if (LA1 == XBM_TK_NUMBER)
{ {
char *p = strrchr (buffer, '_'); char *q = strrchr (buffer, '_');
p = p ? p + 1 : buffer; q = q ? q + 1 : buffer;
if (strcmp (p, "width") == 0) if (strcmp (q, "width") == 0)
*width = value; *width = value;
else if (strcmp (p, "height") == 0) else if (strcmp (q, "height") == 0)
*height = value; *height = value;
} }
expect (XBM_TK_NUMBER); expect (XBM_TK_NUMBER);
...@@ -4604,14 +4604,14 @@ x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjus ...@@ -4604,14 +4604,14 @@ x_detect_edges (struct frame *f, struct image *img, int *matrix, int color_adjus
for (x = 1; x < img->width - 1; ++x, ++p) for (x = 1; x < img->width - 1; ++x, ++p)
{ {
int r, g, b, y1, x1; int r, g, b, yy, xx;
r = g = b = i = 0; r = g = b = i = 0;
for (y1 = y - 1; y1 < y + 2; ++y1) for (yy = y - 1; yy < y + 2; ++yy)
for (x1 = x - 1; x1 < x + 2; ++x1, ++i) for (xx = x - 1; xx < x + 2; ++xx, ++i)
if (matrix[i]) if (matrix[i])
{ {
XColor *t = COLOR (colors, x1, y1); XColor *t = COLOR (colors, xx, yy);
r += matrix[i] * t->red; r += matrix[i] * t->red;
g += matrix[i] * t->green; g += matrix[i] * t->green;
b += matrix[i] * t->blue; b += matrix[i] * t->blue;
...@@ -6364,10 +6364,10 @@ jpeg_load (struct frame *f, struct image *img) ...@@ -6364,10 +6364,10 @@ jpeg_load (struct frame *f, struct image *img)
if (rc == 1) if (rc == 1)
{ {
/* Called from my_error_exit. Display a JPEG error. */ /* Called from my_error_exit. Display a JPEG error. */
char buffer[JMSG_LENGTH_MAX]; char buf[JMSG_LENGTH_MAX];
cinfo.err->format_message ((j_common_ptr) &cinfo, buffer); cinfo.err->format_message ((j_common_ptr) &cinfo, buf);
image_error ("Error reading JPEG image `%s': %s", img->spec, image_error ("Error reading JPEG image `%s': %s", img->spec,
build_string (buffer)); build_string (buf));
} }
/* Close the input file and destroy the JPEG object. */ /* Close the input file and destroy the JPEG object. */
...@@ -7300,9 +7300,9 @@ gif_load (struct frame *f, struct image *img) ...@@ -7300,9 +7300,9 @@ gif_load (struct frame *f, struct image *img)
for (x = 0; x < image_width; x++) for (x = 0; x < image_width; x++)
{ {
int i = raster[(y * image_width) + x]; int c = raster[(y * image_width) + x];
XPutPixel (ximg, x + img->corners[LEFT_CORNER], XPutPixel (ximg, x + img->corners[LEFT_CORNER],
row + img->corners[TOP_CORNER], pixel_colors[i]); row + img->corners[TOP_CORNER], pixel_colors[c]);
} }
row += interlace_increment[pass]; row += interlace_increment[pass];
...@@ -7313,9 +7313,9 @@ gif_load (struct frame *f, struct image *img) ...@@ -7313,9 +7313,9 @@ gif_load (struct frame *f, struct image *img)
for (y = 0; y < image_height; ++y) for (y = 0; y < image_height; ++y)
for (x = 0; x < image_width; ++x) for (x = 0; x < image_width; ++x)
{ {
int i = raster[y * image_width + x]; int c = raster[y * image_width + x];
XPutPixel (ximg, x + img->corners[LEFT_CORNER], XPutPixel (ximg, x + img->corners[LEFT_CORNER],
y + img->corners[TOP_CORNER], pixel_colors[i]); y + img->corners[TOP_CORNER], pixel_colors[c]);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment