FILE *file;
unsigned char *data, *ptr;
int pc, c, i, j, k, ncolors, cpp, comment, transp, quote,
- context, len, token, done;
+ context, len, /*token,*/ done;
char line[65536], s[65536], tok[65536], col[65536];
XColor xcol;
struct _cmap
*cmap;
int lookup[128][128];
+ i = 0;
+ j = 0;
+
transp = 0;
done = 0;
+ cmap = NULL;
file = fopen(f, "r");
if (!file)
/* Color Table */
if (j < ncolors)
{
- int colptr = 0;
+ /* int colptr = 0; not used */
int slen;
tok[0] = 0;
{
if (cpp == 1)
for (i = 0; i < ncolors; i++)
- lookup[cmap[i].str[0]][cmap[i].str[1]] = i;
+ lookup[(int)cmap[i].str[0]][(int)cmap[i].str[1]] = i;
if (cpp == 2)
for (i = 0; i < ncolors; i++)
- lookup[cmap[i].str[0]][cmap[i].str[1]] = i;
+ lookup[(int)cmap[i].str[0]][(int)cmap[i].str[1]] = i;
context++;
}
}
for (i = 0; ((i < 65536) && (line[i])); i++)
{
col[0] = line[i];
- if (cmap[lookup[col[0]][0]].transp)
+ if (cmap[lookup[(int)col[0]][0]].transp)
{
*ptr++ = 255;
*ptr++ = 0;
}
else
{
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].r;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].g;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].b;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].r;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].g;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].b;
}
}
}
for (i = 0; ((i < 65536) && (line[i])); i++)
{
col[0] = line[i];
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].r;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].g;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][0]].b;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].r;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].g;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][0]].b;
}
}
}
{
col[0] = line[i++];
col[1] = line[i];
- if (cmap[lookup[col[0]][col[1]]].transp)
+ if (cmap[lookup[(int)col[0]][(int)col[1]]].transp)
{
*ptr++ = 255;
*ptr++ = 0;
}
else
{
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].r;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].g;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].b;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].r;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].g;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].b;
}
}
}
{
col[0] = line[i++];
col[1] = line[i];
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].r;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].g;
- *ptr++ = (unsigned char)cmap[lookup[col[0]][col[1]]].b;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].r;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].g;
+ *ptr++ = (unsigned char)cmap[lookup[(int)col[0]][(int)col[1]]].b;
}
}
}