nlopess Sat Apr 25 16:42:24 2009 UTC
Modified files:
/php-src/ext/date/lib parse_tz.c
Log:
MFB: fix strict aliasing issues
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_tz.c?r1=1.40&r2=1.41&diff_format=u
Index: php-src/ext/date/lib/parse_tz.c
diff -u php-src/ext/date/lib/parse_tz.c:1.40
php-src/ext/date/lib/parse_tz.c:1.41
--- php-src/ext/date/lib/parse_tz.c:1.40 Tue Mar 10 23:39:12 2009
+++ php-src/ext/date/lib/parse_tz.c Sat Apr 25 16:42:24 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_tz.c,v 1.40 2009/03/10 23:39:12 helly Exp $ */
+/* $Id: parse_tz.c,v 1.41 2009/04/25 16:42:24 nlopess Exp $ */
#include "timelib.h"
@@ -45,7 +45,7 @@
#define timelib_conv_int(l) ((l & 0x000000ff) << 24) + ((l & 0x0000ff00) << 8)
+ ((l & 0x00ff0000) >> 8) + ((l & 0xff000000) >> 24)
#endif
-static void read_preamble(char **tzf, timelib_tzinfo *tz)
+static void read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
{
/* skip ID */
*tzf += 4;
@@ -63,7 +63,7 @@
*tzf += 13;
}
-static void read_header(char **tzf, timelib_tzinfo *tz)
+static void read_header(const unsigned char **tzf, timelib_tzinfo *tz)
{
uint32_t buffer[6];
@@ -77,7 +77,7 @@
*tzf += sizeof(buffer);
}
-static void read_transistions(char **tzf, timelib_tzinfo *tz)
+static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz)
{
int32_t *buffer = NULL;
uint32_t i;
@@ -106,7 +106,7 @@
tz->trans_idx = cbuffer;
}
-static void read_types(char **tzf, timelib_tzinfo *tz)
+static void read_types(const unsigned char **tzf, timelib_tzinfo *tz)
{
unsigned char *buffer;
int32_t *leap_buffer;
@@ -187,7 +187,7 @@
}
}
-static void read_location(char **tzf, timelib_tzinfo *tz)
+static void read_location(const unsigned char **tzf, timelib_tzinfo *tz)
{
uint32_t buffer[3];
uint32_t comments_len;
@@ -296,11 +296,11 @@
if (seek_to_tz_position(&tzf, timezone, tzdb)) {
tmp = timelib_tzinfo_ctor(timezone);
- read_preamble((char**) &tzf, tmp);
- read_header((char**) &tzf, tmp);
- read_transistions((char**) &tzf, tmp);
- read_types((char**) &tzf, tmp);
- read_location((char**) &tzf, tmp);
+ read_preamble(&tzf, tmp);
+ read_header(&tzf, tmp);
+ read_transistions(&tzf, tmp);
+ read_types(&tzf, tmp);
+ read_location(&tzf, tmp);
} else {
tmp = NULL;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php