xpm uses g_strcasecmp now

-Yosh
This commit is contained in:
Manish Singh 1998-01-31 09:13:49 +00:00
parent fe69e5ceb1
commit 88bcda0a20
6 changed files with 36 additions and 50 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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;