andrey                                   Wed, 09 Dec 2009 18:11:03 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=291926

Log:
Fix compilation warnings

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h	2009-12-09 17:47:38 UTC (rev 291925)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_portability.h	2009-12-09 18:11:03 UTC (rev 291926)
@@ -235,49 +235,46 @@
 #define uint1korr(A)	(*(((uint8_t*)(A))))

 /* Bit values are sent in reverted order of bytes, compared to normal !!! */
-#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((zend_uchar*) (A))[1])) +\
-									((uint16_t) (((zend_uchar*) (A))[0]) << 8)))
-#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[2])) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 16)))
+#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((unsigned char*) (A))[1])) +\
+                                   ((uint16_t) (((unsigned char*) (A))[0]) << 8)))
+#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
+                                   (((uint32_t) (((unsigned char*) (A))[0])) << 16)))
+#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
+                                   (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[0])) << 24)))
+#define bit_uint5korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[4])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[3])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 24)) +\
+                                    (((uint64_t) (((unsigned char*) (A))[0])) << 32))
+#define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[5])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[3])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[1])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0]) << 8)))) <<\
+                                     32))
+#define bit_uint7korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[6])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[5])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[3])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0])) << 16))) <<\
+                                     32))
+#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[7])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[6])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[5])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0])) << 24))) <<\
+                                    32))

-#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 24)))

-#define bit_uint5korr(A)  ((uint64_t)(((uint32_t) ((zend_uchar) (A)[4])) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[3])) << 8) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[2])) << 16) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[1])) << 24)) +\
-                               (((uint64_t) ((zend_uchar*) (A)[0])) << 32))
-
-#define bit_uint6korr(A)	((uint64_t)(((uint32_t) (((zend_uchar*) (A))[5])) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[3])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[1])) +\
-									(((uint32_t) (((zend_uchar*) (A))[0]) << 8)))) << 32))
-
-#define bit_uint7korr(A)	((uint64_t)(((uint32_t) (((zend_uchar*) (A))[6])) +\
-									(((uint32_t) (((zend_uchar*) (A))[5])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[3])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[2])) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 16))) << 32))
-
-
-#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[7])) +\
-									(((uint32_t) (((zend_uchar*) (A))[6])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[5])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 24))) << 32))
-
-
 /*
 ** Define-funktions for reading and storing in machine independent format
 **  (low byte first)

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h	2009-12-09 17:47:38 UTC (rev 291925)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_portability.h	2009-12-09 18:11:03 UTC (rev 291926)
@@ -235,49 +235,46 @@
 #define uint1korr(A)	(*(((uint8_t*)(A))))

 /* Bit values are sent in reverted order of bytes, compared to normal !!! */
-#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((zend_uchar*) (A))[1])) +\
-									((uint16_t) (((zend_uchar*) (A))[0]) << 8)))
-#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[2])) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 16)))
+#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((unsigned char*) (A))[1])) +\
+                                   ((uint16_t) (((unsigned char*) (A))[0]) << 8)))
+#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
+                                   (((uint32_t) (((unsigned char*) (A))[0])) << 16)))
+#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
+                                   (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[0])) << 24)))
+#define bit_uint5korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[4])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[3])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[1])) << 24)) +\
+                                    (((uint64_t) (((unsigned char*) (A))[0])) << 32))
+#define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[5])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[3])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[1])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0]) << 8)))) <<\
+                                     32))
+#define bit_uint7korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[6])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[5])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 16) +\
+                                   (((uint32_t) (((unsigned char*) (A))[3])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[2])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0])) << 16))) <<\
+                                     32))
+#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[7])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[6])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[5])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[4])) << 24)) +\
+                        (((uint64_t) (((uint32_t) (((unsigned char*) (A))[3])) +\
+                                    (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\
+                                    (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\
+                                    (((uint32_t) (((unsigned char*) (A))[0])) << 24))) <<\
+                                    32))

-#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 24)))

-#define bit_uint5korr(A)  ((uint64_t)(((uint32_t) ((zend_uchar) (A)[4])) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[3])) << 8) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[2])) << 16) +\
-                                  (((uint32_t) ((zend_uchar*) (A)[1])) << 24)) +\
-                               (((uint64_t) ((zend_uchar*) (A)[0])) << 32))
-
-#define bit_uint6korr(A)	((uint64_t)(((uint32_t) (((zend_uchar*) (A))[5])) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[3])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[1])) +\
-									(((uint32_t) (((zend_uchar*) (A))[0]) << 8)))) << 32))
-
-#define bit_uint7korr(A)	((uint64_t)(((uint32_t) (((zend_uchar*) (A))[6])) +\
-									(((uint32_t) (((zend_uchar*) (A))[5])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[3])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[2])) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 16))) << 32))
-
-
-#define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((zend_uchar*) (A))[7])) +\
-									(((uint32_t) (((zend_uchar*) (A))[6])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[5])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[4])) << 24)) +\
-									(((uint64_t) (((uint32_t) (((zend_uchar*) (A))[3])) +\
-									(((uint32_t) (((zend_uchar*) (A))[2])) << 8) +\
-									(((uint32_t) (((zend_uchar*) (A))[1])) << 16) +\
-									(((uint32_t) (((zend_uchar*) (A))[0])) << 24))) << 32))
-
-
 /*
 ** Define-funktions for reading and storing in machine independent format
 **  (low byte first)
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to