[MPlayer-cvslog] r37092 - in trunk/gui: skin/skin.c util/bitmap.c util/bitmap.h

ib subversion at mplayerhq.hu
Thu Mar 27 20:50:30 CET 2014


Author: ib
Date: Thu Mar 27 20:50:30 2014
New Revision: 37092

Log:
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.

Modified:
   trunk/gui/skin/skin.c
   trunk/gui/util/bitmap.c
   trunk/gui/util/bitmap.h

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Thu Mar 27 14:43:19 2014	(r37091)
+++ trunk/gui/skin/skin.c	Thu Mar 27 20:50:30 2014	(r37092)
@@ -365,7 +365,7 @@ static int item_base(char *in)
             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 @@ static int item_button(char *in)
         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 @@ static int item_hpotmeter(char *in)
         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 @@ static int item_hpotmeter(char *in)
         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 @@ static int item_pimage(char *in)
         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;

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Thu Mar 27 14:43:19 2014	(r37091)
+++ trunk/gui/util/bitmap.c	Thu Mar 27 20:50:30 2014	(r37092)
@@ -162,8 +162,8 @@ static int pngRead(const char *fname, gu
         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 pngRead(const char *fname, gu
  */
 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 @@ static int convert_ARGB(guiImage *img)
 
         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 @@ void bpFree(guiImage *img)
 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 @@ int bpRenderMask(const guiImage *in, gui
     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 @@ int bpRenderMask(const guiImage *in, gui
     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;
 }

Modified: trunk/gui/util/bitmap.h
==============================================================================
--- trunk/gui/util/bitmap.h	Thu Mar 27 14:43:19 2014	(r37091)
+++ trunk/gui/util/bitmap.h	Thu Mar 27 20:50:30 2014	(r37092)
@@ -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);


More information about the MPlayer-cvslog mailing list