# HG changeset patch # User ib # Date 1395949830 0 # Node ID a17b55521dd2d1b67bdaae4bcb9d6da9930f488e # Parent efec4d517450e11c6079b0d74d9a11d1b91532d0 Don't use data type long. AVCodecContext's width and height (where this information comes from) are also just integer. Additionally, make Image an unsigned char pointer. diff -r efec4d517450 -r a17b55521dd2 gui/skin/skin.c --- a/gui/skin/skin.c Thu Mar 27 13:43:19 2014 +0000 +++ b/gui/skin/skin.c Thu Mar 27 19:50:30 2014 +0000 @@ -365,7 +365,7 @@ skin_error(MSGTR_GUI_MSG_SkinMemoryError); return 1; } - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] mask: %lux%lu\n", currWin->Mask.Width, currWin->Mask.Height); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] mask: %ux%u\n", currWin->Mask.Width, currWin->Mask.Height); } if (is_bar) @@ -477,7 +477,7 @@ if (skinImageRead(file, &item->Bitmap) != 0) return 1; - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %lux%lu)\n", item->Bitmap.Width, item->Bitmap.Height); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %ux%u)\n", item->Bitmap.Width, item->Bitmap.Height); } return 0; @@ -665,7 +665,7 @@ if (skinImageRead(buf, &item->Bitmap) != 0) return 1; - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (potmeter bitmap: %lux%lu)\n", item->Bitmap.Width, item->Bitmap.Height); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (potmeter bitmap: %ux%u)\n", item->Bitmap.Width, item->Bitmap.Height); } item->Mask.Image = NULL; @@ -677,7 +677,7 @@ if (skinImageRead(buf, &item->Mask) != 0) return 1; - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (button bitmap: %lux%lu)\n", item->Mask.Width, item->Mask.Height); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (button bitmap: %ux%u)\n", item->Mask.Width, item->Mask.Height); } return 0; @@ -800,7 +800,7 @@ if (skinImageRead(buf, &item->Bitmap) != 0) return 1; - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %lux%lu)\n", item->Bitmap.Width, item->Bitmap.Height); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[skin] (bitmap: %ux%u)\n", item->Bitmap.Width, item->Bitmap.Height); } return 0; diff -r efec4d517450 -r a17b55521dd2 gui/util/bitmap.c --- a/gui/util/bitmap.c Thu Mar 27 13:43:19 2014 +0000 +++ b/gui/util/bitmap.c Thu Mar 27 19:50:30 2014 +0000 @@ -162,8 +162,8 @@ img->ImageSize = bpl * img->Height; mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] file: %s\n", fname); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] size: %lux%lu, color depth: %u\n", img->Width, img->Height, img->Bpp); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] image size: %lu\n", img->ImageSize); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] size: %ux%u, color depth: %u\n", img->Width, img->Height, img->Bpp); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] image size: %u\n", img->ImageSize); img->Image = malloc(img->ImageSize); @@ -193,8 +193,8 @@ */ static int convert_ARGB(guiImage *img) { - char *orgImage; - unsigned long i, c; + unsigned char *orgImage; + unsigned int i, c; if (img->Bpp == 24) { orgImage = img->Image; @@ -205,11 +205,11 @@ if (!img->Image) { free(orgImage); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", img->ImageSize); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %u\n", img->ImageSize); return False; } - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 32 bpp conversion size: %lu\n", img->ImageSize); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 32 bpp conversion size: %u\n", img->ImageSize); for (i = 0, c = 0; i < img->ImageSize; i += 4, c += 3) *(uint32_t *)&img->Image[i] = ALPHA_OPAQUE | AV_RB24(&orgImage[c]); @@ -286,8 +286,8 @@ int bpRenderMask(const guiImage *in, guiImage *out) { uint32_t *buf; - unsigned long x, y; - unsigned long i = 0, c = 0; + unsigned int x, y; + unsigned int i = 0, c = 0; unsigned char tmp = 0, b = 1; int shaped = 0; @@ -298,7 +298,7 @@ out->Image = calloc(1, out->ImageSize); if (!out->Image) { - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", out->ImageSize); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %u\n", out->ImageSize); return False; } @@ -333,7 +333,7 @@ if (!shaped) bpFree(out); - mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 1 bpp conversion size: %lu\n", out->ImageSize); + mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 1 bpp conversion size: %u\n", out->ImageSize); return True; } diff -r efec4d517450 -r a17b55521dd2 gui/util/bitmap.h --- a/gui/util/bitmap.h Thu Mar 27 13:43:19 2014 +0000 +++ b/gui/util/bitmap.h Thu Mar 27 19:50:30 2014 +0000 @@ -27,11 +27,11 @@ #define IS_TRANSPARENT(c) ((ALPHA_OPAQUE | (c)) == GUI_TRANSPARENT) typedef struct { - unsigned long Width; - unsigned long Height; + unsigned int Width; + unsigned int Height; unsigned int Bpp; - unsigned long ImageSize; - char *Image; + unsigned int ImageSize; + unsigned char *Image; } guiImage; void bpFree(guiImage *img);