[PATCH] fixed problems from dead enums

Bart Massey bart at cs.pdx.edu
Tue Mar 10 23:00:09 PDT 2009


---
 aux/xcb_bitops.h     |    2 +-
 image/test_formats.c |    2 +-
 image/test_swap.c    |    8 ++++----
 image/xcb_image.c    |   28 ++++++++++++++--------------
 image/xcb_image.h    |   16 ++++++++--------
 5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/aux/xcb_bitops.h b/aux/xcb_bitops.h
index a6872a1..9413a7f 100644
--- a/aux/xcb_bitops.h
+++ b/aux/xcb_bitops.h
@@ -196,7 +196,7 @@ xcb_bit_reverse(uint32_t x, uint8_t n) {
  * as appropriate.
  * @ingroup xcb__bitops
  */
-_X_INLINE static xcb_image_order_t
+_X_INLINE static uint32_t
 xcb_host_byte_order(void) {
   uint32_t           endian_test = 0x01020304;
 
diff --git a/image/test_formats.c b/image/test_formats.c
index be3b217..5b38e5e 100644
--- a/image/test_formats.c
+++ b/image/test_formats.c
@@ -104,7 +104,7 @@ static xcb_gcontext_t create_gcontext(xcb_connection_t *c,
 
 typedef struct {
 	char *name;
-	xcb_image_format_t format;
+	uint32_t format;
 	uint8_t depth;
 } format_t;
 
diff --git a/image/test_swap.c b/image/test_swap.c
index becf26b..7e64e47 100644
--- a/image/test_swap.c
+++ b/image/test_swap.c
@@ -34,7 +34,7 @@
 #include "../aux/xcb_aux.h"
 #include "xcb_image.h"
 
-xcb_image_format_t  formats[] = {
+uint32_t formats[] = {
     XCB_IMAGE_FORMAT_Z_PIXMAP,
     XCB_IMAGE_FORMAT_XY_PIXMAP,
     XCB_IMAGE_FORMAT_XY_BITMAP,
@@ -52,7 +52,7 @@ int units[] = {
 };
 #define NUNIT SIZE(units)
 
-xcb_image_order_t   byte_orders[] = {
+uint32_t  byte_orders[] = {
     XCB_IMAGE_ORDER_LSB_FIRST,
     XCB_IMAGE_ORDER_MSB_FIRST
 };
@@ -125,7 +125,7 @@ convert_test (xcb_image_t *test, xcb_image_t *a)
 }
 
 static char *
-order_name (xcb_image_order_t order) {
+order_name (uint32_t order) {
   if (order == XCB_IMAGE_ORDER_MSB_FIRST)
     return "MSB";
   else
@@ -154,7 +154,7 @@ int main (int argc, char **argv) {
   xcb_image_t	*dst_image;
   int		dst_format_i, dst_bpp_i, dst_unit_i, dst_byte_order_i, dst_bit_order_i;
   int		src_format_i, src_bpp_i, src_unit_i, src_byte_order_i, src_bit_order_i;
-  xcb_image_format_t	dst_format, src_format;
+  uint32_t	dst_format, src_format;
   int		dst_bpp, src_bpp;
   int		dst_unit, src_unit;
   int		dst_byte_order, src_byte_order;
diff --git a/image/xcb_image.c b/image/xcb_image.c
index 413bdc5..77c8233 100644
--- a/image/xcb_image.c
+++ b/image/xcb_image.c
@@ -48,8 +48,8 @@ find_format_by_depth (const xcb_setup_t *setup, uint8_t depth)
 }
 
 
-static xcb_image_format_t
-effective_format(xcb_image_format_t format, uint8_t bpp)
+static uint32_t
+effective_format(uint32_t format, uint8_t bpp)
 {
     if (format == XCB_IMAGE_FORMAT_Z_PIXMAP && bpp != 1)
 	    return format;
@@ -59,9 +59,9 @@ effective_format(xcb_image_format_t format, uint8_t bpp)
 
 static int
 format_valid (uint8_t depth, uint8_t bpp, uint8_t unit,
-	      xcb_image_format_t format, uint8_t xpad)
+	      uint32_t format, uint8_t xpad)
 {
-  xcb_image_format_t  ef = effective_format(format, bpp);
+  uint32_t  ef = effective_format(format, bpp);
   if (depth > bpp)
       return 0;
   switch(ef) {
@@ -122,7 +122,7 @@ image_format_valid (xcb_image_t *image) {
 void
 xcb_image_annotate (xcb_image_t *image)
 {
-  xcb_image_format_t  ef = effective_format(image->format, image->bpp);
+  uint32_t  ef = effective_format(image->format, image->bpp);
   switch (ef) {
   case XCB_IMAGE_FORMAT_XY_PIXMAP:
       image->stride = xcb_roundup(image->width, image->scanline_pad) >> 3;
@@ -144,7 +144,7 @@ xcb_image_t *
 xcb_image_create_native (xcb_connection_t *  c,
 			 uint16_t            width,
 			 uint16_t            height,
-			 xcb_image_format_t  format,
+			 uint32_t            format,
 			 uint8_t             depth,
 			 void *              base,
 			 uint32_t            bytes,
@@ -152,7 +152,7 @@ xcb_image_create_native (xcb_connection_t *  c,
 {
   const xcb_setup_t *  setup = xcb_get_setup(c);
   xcb_format_t *       fmt;
-  xcb_image_format_t   ef = format;
+  uint32_t             ef = format;
   
   if (ef == XCB_IMAGE_FORMAT_Z_PIXMAP && depth == 1)
       ef = XCB_IMAGE_FORMAT_XY_PIXMAP;
@@ -193,13 +193,13 @@ xcb_image_create_native (xcb_connection_t *  c,
 xcb_image_t *
 xcb_image_create (uint16_t           width,
 		  uint16_t           height,
-		  xcb_image_format_t format,
+		  uint32_t           format,
 		  uint8_t            xpad,
 		  uint8_t            depth,
 		  uint8_t            bpp,
 		  uint8_t            unit,
-		  xcb_image_order_t  byte_order,
-		  xcb_image_order_t  bit_order,
+		  uint32_t           byte_order,
+		  uint32_t           bit_order,
 		  void *             base,
 		  uint32_t           bytes,
 		  uint8_t *          data)
@@ -305,7 +305,7 @@ xcb_image_get (xcb_connection_t *  conn,
 	       uint16_t            width,
 	       uint16_t            height,
 	       uint32_t            plane_mask,
-	       xcb_image_format_t  format)
+	       uint32_t            format)
 {
   xcb_get_image_cookie_t   image_cookie;
   xcb_get_image_reply_t *  imrep;
@@ -378,7 +378,7 @@ xcb_image_native (xcb_connection_t *  c,
   xcb_image_t *        tmp_image = 0;
   const xcb_setup_t *  setup = xcb_get_setup(c);
   xcb_format_t *       fmt = 0;
-  xcb_image_format_t   ef = effective_format(image->format, image->bpp);
+  uint32_t             ef = effective_format(image->format, image->bpp);
   uint8_t              bpp = 1;
 
   if (image->depth > 1 || ef == XCB_IMAGE_FORMAT_Z_PIXMAP) {
@@ -901,7 +901,7 @@ bit_order(xcb_image_t *i)
 static uint32_t 
 conversion_byte_swap(xcb_image_t *src, xcb_image_t *dst)
 {
-    xcb_image_format_t ef = effective_format(src->format, src->bpp);
+    uint32_t ef = effective_format(src->format, src->bpp);
     
     /* src_ef == dst_ef in all callers of this function */
     if (ef == XCB_IMAGE_FORMAT_XY_PIXMAP) {
@@ -916,7 +916,7 @@ xcb_image_t *
 xcb_image_convert (xcb_image_t *  src,
 		   xcb_image_t *  dst)
 {
-  xcb_image_format_t  ef = effective_format(src->format, src->bpp);
+  uint32_t  ef = effective_format(src->format, src->bpp);
 
   /* Things will go horribly wrong here if a bad
      image is passed in, so we check some things
diff --git a/image/xcb_image.h b/image/xcb_image.h
index 3b54da3..e9dcc79 100644
--- a/image/xcb_image.h
+++ b/image/xcb_image.h
@@ -93,7 +93,7 @@ struct xcb_image_t
 {
   uint16_t           width;   /**< Width in pixels, excluding pads etc. */
   uint16_t           height;   /**< Height in pixels. */
-  xcb_image_format_t format;   /**< Format. */
+  uint32_t           format;   /**< Format. */
   uint8_t            scanline_pad;   /**< Right pad in bits.  Valid pads
 				      *   are 8, 16, 32.
 				      */
@@ -124,7 +124,7 @@ struct xcb_image_t
 				    *   and set only by
 				    *   xcb_image_get().
 				    */
-  xcb_image_order_t  byte_order;   /**< Component byte order
+  uint32_t           byte_order;   /**< Component byte order
 				    *   for z-pixmap, byte
 				    *   order of scanline unit
 				    *   for xy-bitmap and
@@ -132,7 +132,7 @@ struct xcb_image_t
 				    *   order for z-pixmap
 				    *   when bpp == 4.
 				    */
-  xcb_image_order_t  bit_order;    /**< Bit order of
+  uint32_t           bit_order;    /**< Bit order of
 				    *   scanline unit for
 				    *   xy-bitmap and
 				    *   xy-pixmap.
@@ -214,13 +214,13 @@ xcb_image_annotate (xcb_image_t *image);
 xcb_image_t *
 xcb_image_create (uint16_t           width,
 		  uint16_t           height,
-		  xcb_image_format_t format,
+		  uint32_t           format,
 		  uint8_t            xpad,
 		  uint8_t            depth,
 		  uint8_t            bpp,
 		  uint8_t            unit,
-		  xcb_image_order_t  byte_order,
-		  xcb_image_order_t  bit_order,
+		  uint32_t           byte_order,
+		  uint32_t           bit_order,
 		  void *             base,
 		  uint32_t           bytes,
 		  uint8_t *          data);
@@ -256,7 +256,7 @@ xcb_image_t *
 xcb_image_create_native (xcb_connection_t *  c,
 			 uint16_t            width,
 			 uint16_t            height,
-			 xcb_image_format_t  format,
+			 uint32_t            format,
 			 uint8_t             depth,
 			 void *              base,
 			 uint32_t            bytes,
@@ -311,7 +311,7 @@ xcb_image_get (xcb_connection_t *  conn,
 	       uint16_t            width,
 	       uint16_t            height,
 	       uint32_t            plane_mask,
-	       xcb_image_format_t  format);
+	       uint32_t            format);
 
 
 /**
-- 
1.6.1.3


------- =_aaaaaaaaaa0
Content-Type: text/plain;
	name="0001-fixed-python-to-generate-define-instead-of-const-fo.patch";
	charset="us-ascii"
Content-ID: <14194.1236752041.3 at adara.cs.pdx.edu>



More information about the Xcb mailing list