forked from enlightenment/efl
parent
c54bd4052c
commit
1a72827555
|
@ -24,7 +24,7 @@
|
|||
(((x) & 0xff00 ) >> 8))
|
||||
|
||||
#define SPANS_COMMON(x1, w1, x2, w2) \
|
||||
(!(( (int)((x2) + (w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (w1)))))
|
||||
(!(( (int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1)))))
|
||||
|
||||
#define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \
|
||||
((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh))))
|
||||
|
@ -35,16 +35,16 @@
|
|||
{ \
|
||||
if ((int)_x < (int)(_cx)) \
|
||||
{ \
|
||||
if ((int)_w + (_x - (int)(_cx)) < 0) _w = 0; \
|
||||
else _w += (_x - (int)(_cx)); \
|
||||
if ((int)_w + ((int)_x - (int)(_cx)) < 0) _w = 0; \
|
||||
else _w += ((int)_x - (int)(_cx)); \
|
||||
_x = (_cx); \
|
||||
} \
|
||||
if ((int)(_x + _w) > (int)((_cx) + (_cw))) \
|
||||
_w = (_cx) + (_cw) - _x; \
|
||||
if ((int)_y < (int)(_cy)) \
|
||||
{ \
|
||||
if ((int)_h + (_y - (int)(_cy)) < 0) _h = 0; \
|
||||
else _h += (_y - (int)(_cy)); \
|
||||
if ((int)_h + ((int)_y - (int)(_cy)) < 0) _h = 0; \
|
||||
else _h += ((int)_y - (int)(_cy)); \
|
||||
_y = (_cy); \
|
||||
} \
|
||||
if ((int)(_y + _h) > (int)((_cy) + (_ch))) \
|
||||
|
|
|
@ -535,7 +535,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key
|
|||
goto close_file;
|
||||
}
|
||||
|
||||
if ((w != ie->w) || (h != ie->h))
|
||||
if ((w != (int)ie->w) || (h != (int)ie->h))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||
goto close_file;
|
||||
|
|
|
@ -174,7 +174,6 @@ evas_image_load_file_head_jpeg_internal(Image_Entry *ie, FILE *f, int *error)
|
|||
if (ie->scale > 1)
|
||||
{
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
rewind(f);
|
||||
jpeg_create_decompress(&cinfo);
|
||||
jpeg_stdio_src(&cinfo, f);
|
||||
|
|
|
@ -88,7 +88,8 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key
|
|||
if (fstat(fd, &ss) < 0) goto close_file;
|
||||
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
if (ss.st_size < (sizeof(tga_header) + sizeof(tga_footer))) goto close_file;
|
||||
if (ss.st_size < (off_t)(sizeof(tga_header) + sizeof(tga_footer)))
|
||||
goto close_file;
|
||||
seg = mmap(0, ss.st_size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (seg == MAP_FAILED) goto close_file;
|
||||
filedata = seg;
|
||||
|
@ -103,7 +104,7 @@ evas_image_load_file_head_tga(Image_Entry *ie, const char *file, const char *key
|
|||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
footer_present = 1;
|
||||
}
|
||||
filedata = (char *)filedata + sizeof(tga_header);
|
||||
filedata = (unsigned char *)filedata + sizeof(tga_header);
|
||||
vinverted = !(header->descriptor & TGA_DESC_VERTICAL);
|
||||
switch (header->imageType)
|
||||
{
|
||||
|
@ -165,7 +166,8 @@ evas_image_load_file_data_tga(Image_Entry *ie, const char *file, const char *key
|
|||
if (fstat(fd, &ss) < 0) goto close_file;
|
||||
|
||||
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
|
||||
if (ss.st_size < (sizeof(tga_header) + sizeof(tga_footer))) goto close_file;
|
||||
if (ss.st_size < (off_t)(sizeof(tga_header) + sizeof(tga_footer)))
|
||||
goto close_file;
|
||||
seg = mmap(0, ss.st_size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
if (seg == MAP_FAILED) goto close_file;
|
||||
filedata = seg;
|
||||
|
@ -180,7 +182,7 @@ evas_image_load_file_data_tga(Image_Entry *ie, const char *file, const char *key
|
|||
*error = EVAS_LOAD_ERROR_CORRUPT_FILE;
|
||||
footer_present = 1;
|
||||
}
|
||||
filedata = (char *)filedata + sizeof(tga_header);
|
||||
filedata = (unsigned char *)filedata + sizeof(tga_header);
|
||||
vinverted = !(header->descriptor & TGA_DESC_VERTICAL);
|
||||
switch (header->imageType)
|
||||
{
|
||||
|
@ -206,7 +208,7 @@ evas_image_load_file_data_tga(Image_Entry *ie, const char *file, const char *key
|
|||
IMG_TOO_BIG(w, h))
|
||||
goto close_file;
|
||||
|
||||
if ((w != ie->w) || (h != ie->h))
|
||||
if ((w != (int)ie->w) || (h != (int)ie->h))
|
||||
{
|
||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||
goto close_file;
|
||||
|
@ -479,7 +481,7 @@ module_open(Evas_Module *em)
|
|||
}
|
||||
|
||||
static void
|
||||
module_close(Evas_Module *em)
|
||||
module_close(Evas_Module *em __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue