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

ib subversion at mplayerhq.hu
Mon Apr 4 15:02:56 CEST 2011


Author: ib
Date: Mon Apr  4 15:02:56 2011
New Revision: 33202

Log:
Use appropriate data type uint32_t for 32 bpp bitmap data.

Don't use int.

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

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Mon Apr  4 14:40:20 2011	(r33201)
+++ trunk/gui/util/bitmap.c	Mon Apr  4 15:02:56 2011	(r33202)
@@ -216,7 +216,7 @@ void bpFree(txSample *bf)
     memset(bf, 0, sizeof(*bf));
 }
 
-int Convert32to1(txSample *in, txSample *out, int adaptivlimit)
+int Convert32to1(txSample *in, txSample *out, uint32_t transparent)
 {
     out->Width     = in->Width;
     out->Height    = in->Height;
@@ -230,14 +230,14 @@ int Convert32to1(txSample *in, txSample 
         return 0;
     } else {
         int i, b, c = 0;
-        unsigned int *buf = NULL;
+        uint32_t *buf     = NULL;
         unsigned char tmp = 0;
         int nothaveshape  = 1;
 
-        buf = (unsigned int *)in->Image;
+        buf = (uint32_t *)in->Image;
 
         for (b = 0, i = 0; i < (int)(out->Width * out->Height); i++) {
-            if ((int)buf[i] != adaptivlimit)
+            if (buf[i] != transparent)
                 tmp = (tmp >> 1) | 128;
             else {
                 tmp    = tmp >> 1;

Modified: trunk/gui/util/bitmap.h
==============================================================================
--- trunk/gui/util/bitmap.h	Mon Apr  4 14:40:20 2011	(r33201)
+++ trunk/gui/util/bitmap.h	Mon Apr  4 15:02:56 2011	(r33202)
@@ -19,6 +19,8 @@
 #ifndef MPLAYER_GUI_BITMAP_H
 #define MPLAYER_GUI_BITMAP_H
 
+#include <inttypes.h>
+
 typedef struct {
     unsigned long Width;
     unsigned long Height;
@@ -29,6 +31,6 @@ typedef struct {
 
 void bpFree(txSample *bf);
 int bpRead(char *fname, txSample *bf);
-int Convert32to1(txSample *in, txSample *out, int adaptivlimit);
+int Convert32to1(txSample *in, txSample *out, uint32_t transparent);
 
 #endif /* MPLAYER_GUI_BITMAP_H */


More information about the MPlayer-cvslog mailing list