Commit 88bcda0a authored by Manish Singh's avatar Manish Singh
Browse files

xpm uses g_strcasecmp now

-Yosh
parent fe69e5ce
Sat Jan 31 00:16:22 PST 1998 Manish Singh <yosh@gimp.org>
* plug-ins/xpm/xpm.c: Changed to use g_strcasecmp
Fri Jan 30 13:47:57 1998 Federico Mena <federico@bananoid.nuclecu.unam.mx>
* app/gradient.c: Applied patch from Wolfgang Hofer
......
......@@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool,
srcPR.x=x;
srcPR.y=y;
srcPR.rowstride = srcPR.bytes * block->width;
srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes;
srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride +
/*off*/x * srcPR.bytes;
destPR.data = temp_buf_data (edge_buf) +
(y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes;
y * destPR.rowstride + x * edge_buf->bytes;
/* look at this debuggin info.*/
printf("Pixel region dump %d %d\n", x, endx);
printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index);
printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h);
printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data);
printf("bdata:%d edata:%d\n", block->data, edge_buf->data);
copy_region (&srcPR, &destPR);
}
......
......@@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool,
srcPR.x=x;
srcPR.y=y;
srcPR.rowstride = srcPR.bytes * block->width;
srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes;
srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride +
/*off*/x * srcPR.bytes;
destPR.data = temp_buf_data (edge_buf) +
(y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes;
y * destPR.rowstride + x * edge_buf->bytes;
/* look at this debuggin info.*/
printf("Pixel region dump %d %d\n", x, endx);
printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index);
printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h);
printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data);
printf("bdata:%d edata:%d\n", block->data, edge_buf->data);
copy_region (&srcPR, &destPR);
}
......
......@@ -1945,9 +1945,17 @@ construct_edge_map (Tool *tool,
srcPR.x=x;
srcPR.y=y;
srcPR.rowstride = srcPR.bytes * block->width;
srcPR.data = temp_buf_data (block) + offy * srcPR.rowstride + offx * srcPR.bytes;
srcPR.data = temp_buf_data (block) + /*off*/y * srcPR.rowstride +
/*off*/x * srcPR.bytes;
destPR.data = temp_buf_data (edge_buf) +
(y - edge_buf->y) * destPR.rowstride + (x - edge_buf->x) * edge_buf->bytes;
y * destPR.rowstride + x * edge_buf->bytes;
/* look at this debuggin info.*/
printf("Pixel region dump %d %d\n", x, endx);
printf("rowstride:%d bytes:%d index:%d\n",srcPR.rowstride,srcPR.bytes, index);
printf("x:%d y:%d w:%d h:%d\n",srcPR.x, srcPR.y, srcPR.w, srcPR.h);
printf("sdata:%d ddata:%d\n",srcPR.data, destPR.data);
printf("bdata:%d edata:%d\n", block->data, edge_buf->data);
copy_region (&srcPR, &destPR);
}
......
......@@ -60,9 +60,6 @@ static void run (char *name,
static gint32
load_image (char *filename);
static int
cmp_icase (char *s1, char *s2);
static void
parse_colors (XpmImage *xpm_image,
guchar **cmap);
......@@ -312,24 +309,6 @@ load_image (char *filename)
static int
cmp_icase (char *s1, char *s2)
{
register int c1, c2;
while (*s1 && *s2)
{
c1 = tolower(*s1++); c2 = tolower(*s2++);
if (c1 != c2)
return (c1 - c2);
}
return (int) (*s1 - *s2);
}
static void
parse_colors (XpmImage *xpm_image, guchar **cmap)
{
......@@ -371,7 +350,7 @@ parse_colors (XpmImage *xpm_image, guchar **cmap)
/* parse if it's not transparent. the assumption is that
g_new will memset the buffer to zeros */
if (cmp_icase(colorspec, "None") != 0) {
if (g_strcasecmp(colorspec, "None") != 0) {
XParseColor (display, colormap, colorspec, &xcolor);
(*cmap)[j++] = xcolor.red >> 8;
(*cmap)[j++] = xcolor.green >> 8;
......
......@@ -60,9 +60,6 @@ static void run (char *name,
static gint32
load_image (char *filename);
static int
cmp_icase (char *s1, char *s2);
static void
parse_colors (XpmImage *xpm_image,
guchar **cmap);
......@@ -312,24 +309,6 @@ load_image (char *filename)
static int
cmp_icase (char *s1, char *s2)
{
register int c1, c2;
while (*s1 && *s2)
{
c1 = tolower(*s1++); c2 = tolower(*s2++);
if (c1 != c2)
return (c1 - c2);
}
return (int) (*s1 - *s2);
}
static void
parse_colors (XpmImage *xpm_image, guchar **cmap)
{
......@@ -371,7 +350,7 @@ parse_colors (XpmImage *xpm_image, guchar **cmap)
/* parse if it's not transparent. the assumption is that
g_new will memset the buffer to zeros */
if (cmp_icase(colorspec, "None") != 0) {
if (g_strcasecmp(colorspec, "None") != 0) {
XParseColor (display, colormap, colorspec, &xcolor);
(*cmap)[j++] = xcolor.red >> 8;
(*cmap)[j++] = xcolor.green >> 8;
......
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