From: Tjerk Meesters Date: Thu, 9 Oct 2014 23:20:10 +0000 (+0800) Subject: pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG X-Git-Tag: POST_NATIVE_TLS_MERGE^2~76^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a765d313ecf750dbb7f1b92b5c19981f57407ac;p=php pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG --- diff --git a/ext/standard/pack.c b/ext/standard/pack.c index a690b7bee8..a95c226b97 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -82,7 +82,7 @@ static int machine_endian_long_map[4]; static int big_endian_long_map[4]; static int little_endian_long_map[4]; -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 /* Mappings of bytes from quads (64bit) for all endian environments */ static int machine_endian_longlong_map[8]; static int big_endian_longlong_map[8]; @@ -209,7 +209,7 @@ PHP_FUNCTION(pack) case 'Q': case 'J': case 'P': -#if SIZEOF_LONG < 8 +#if SIZEOF_ZEND_LONG < 8 efree(argv); efree(formatcodes); efree(formatargs); @@ -298,7 +298,7 @@ PHP_FUNCTION(pack) INC_OUTPUTPOS(arg,4) /* 32 bit per arg */ break; -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 case 'q': case 'Q': case 'J': @@ -457,7 +457,7 @@ PHP_FUNCTION(pack) break; } -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 case 'q': case 'Q': case 'J': @@ -471,7 +471,7 @@ PHP_FUNCTION(pack) } while (arg-- > 0) { - php_pack(argv[currentarg++], 8, map, &output[outputpos]); + php_pack(&argv[currentarg++], 8, map, &output[outputpos]); outputpos += 8; } break; @@ -675,7 +675,7 @@ PHP_FUNCTION(unpack) case 'Q': case 'J': case 'P': -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 size = 8; break; #else @@ -907,7 +907,7 @@ PHP_FUNCTION(unpack) break; } -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 case 'q': case 'Q': case 'J': @@ -1043,7 +1043,7 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[2] = 2; little_endian_long_map[3] = 3; -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 machine_endian_longlong_map[0] = 0; machine_endian_longlong_map[1] = 1; machine_endian_longlong_map[2] = 2; @@ -1102,7 +1102,7 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[2] = size - 3; little_endian_long_map[3] = size - 4; -#if SIZEOF_LONG > 4 +#if SIZEOF_ZEND_LONG > 4 machine_endian_longlong_map[0] = size - 8; machine_endian_longlong_map[1] = size - 7; machine_endian_longlong_map[2] = size - 6;