forked from enlightenment/efl
evas xpm loader - remove tabs and clean up formatting
just non-code changes here...
This commit is contained in:
parent
4a9f28a677
commit
205ef8a756
|
@ -1712,7 +1712,6 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
Eina_Bool res = EINA_FALSE;
|
||||
|
||||
done = 0;
|
||||
// transp = -1;
|
||||
transp = 1;
|
||||
|
||||
/* if immediate_load is 1, then dont delay image laoding as below, or */
|
||||
|
@ -1721,11 +1720,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
length = eina_file_size_get(f);
|
||||
position = 0;
|
||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
if (length < 9)
|
||||
{
|
||||
// ERR("XPM ERROR: file size, %zd, is to small", length);
|
||||
goto on_error;
|
||||
}
|
||||
if (length < 9) goto on_error;
|
||||
|
||||
map = eina_file_map_all(f, load_data ? EINA_FILE_WILLNEED : EINA_FILE_RANDOM);
|
||||
if (!map)
|
||||
|
@ -1769,10 +1764,8 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
c = (char) map[position++];
|
||||
if (!quote)
|
||||
{
|
||||
if ((pc == '/') && (c == '*'))
|
||||
comment = 1;
|
||||
else if ((pc == '*') && (c == '/') && (comment))
|
||||
comment = 0;
|
||||
if ((pc == '/') && (c == '*')) comment = 1;
|
||||
else if ((pc == '*') && (c == '/') && (comment)) comment = 0;
|
||||
}
|
||||
if (!comment)
|
||||
{
|
||||
|
@ -1790,7 +1783,6 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
/* Header */
|
||||
if (sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp) != 4)
|
||||
{
|
||||
// ERR("XPM ERROR: XPM file malformed header");
|
||||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
goto on_error;
|
||||
}
|
||||
|
@ -1896,8 +1888,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
{
|
||||
if (strlen(col) < (sizeof(col) - 2))
|
||||
strcat(col, " ");
|
||||
else
|
||||
done = 1;
|
||||
else done = 1;
|
||||
}
|
||||
if ((strlen(col) + strlen(s)) < (sizeof(col) - 1))
|
||||
strcat(col, s);
|
||||
|
@ -1934,8 +1925,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
{
|
||||
if (strlen(col) < ( sizeof(col) - 2))
|
||||
strcat(col, " ");
|
||||
else
|
||||
done = 1;
|
||||
else done = 1;
|
||||
}
|
||||
if ((strlen(col) + strlen(s)) < (sizeof(col) - 1))
|
||||
strcat(col, s);
|
||||
|
@ -2116,13 +2106,9 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
g = (unsigned char)cm->g;
|
||||
b = (unsigned char)cm->b;
|
||||
if (cm->transp)
|
||||
{
|
||||
*ptr = RGB_JOIN(r, g, b);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ptr = ARGB_JOIN(0xff, r, g, b);
|
||||
}
|
||||
|
||||
ptr++;
|
||||
count++;
|
||||
|
@ -2138,9 +2124,7 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
Eina_Rbtree *l;
|
||||
|
||||
for (j = 0; j < cpp; j++, i++)
|
||||
{
|
||||
col[j] = line[i];
|
||||
}
|
||||
col[j] = 0;
|
||||
i--;
|
||||
|
||||
|
@ -2169,10 +2153,8 @@ evas_image_load_file_xpm(Eina_File *f, Evas_Image_Property *prop, void *pixels,
|
|||
else if (c > 127) c = 127;
|
||||
if (c =='\\')
|
||||
{
|
||||
if (++backslash < 2)
|
||||
line[i++] = c;
|
||||
else
|
||||
backslash = 0;
|
||||
if (++backslash < 2) line[i++] = c;
|
||||
else backslash = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue