From 74aa601afcdba8b30932a3c3d7c0d2485ecc6e42 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Sat, 16 Feb 2013 10:36:41 +0100 Subject: [PATCH] evas: improve portability of bmp loader. On system like 64bits windows it is not a guaranty that a sizeof (long) == sizeof (void*), we are better using the right type. This generate a warning that we could have seen with just cross compilation. --- .../evas/loaders/bmp/evas_image_load_bmp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modules/evas/loaders/bmp/evas_image_load_bmp.c b/src/modules/evas/loaders/bmp/evas_image_load_bmp.c index 21a9af03b3..c6458163e3 100644 --- a/src/modules/evas/loaders/bmp/evas_image_load_bmp.c +++ b/src/modules/evas/loaders/bmp/evas_image_load_bmp.c @@ -768,7 +768,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key else { if ((x & 0x7) != 0) p++; - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -823,7 +823,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key else { if ((x & 0x1) != 0) p++; - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1012,7 +1012,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1191,7 +1191,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1225,7 +1225,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1264,7 +1264,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1352,7 +1352,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1392,7 +1392,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; } @@ -1430,7 +1430,7 @@ evas_image_load_file_data_bmp(Image_Entry *ie, const char *file, const char *key } else { - fix = (int)(((unsigned long)p) & 0x3); + fix = (int)(((uintptr_t)p) & 0x3); if (fix > 0) p += 4 - fix; // align row read if (p >= buffer_end) break; }