Skip to content

Commit 2a765d3

Browse files
committed
pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG
1 parent 284358b commit 2a765d3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ext/standard/pack.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static int machine_endian_long_map[4];
8282
static int big_endian_long_map[4];
8383
static int little_endian_long_map[4];
8484

85-
#if SIZEOF_LONG > 4
85+
#if SIZEOF_ZEND_LONG > 4
8686
/* Mappings of bytes from quads (64bit) for all endian environments */
8787
static int machine_endian_longlong_map[8];
8888
static int big_endian_longlong_map[8];
@@ -209,7 +209,7 @@ PHP_FUNCTION(pack)
209209
case 'Q':
210210
case 'J':
211211
case 'P':
212-
#if SIZEOF_LONG < 8
212+
#if SIZEOF_ZEND_LONG < 8
213213
efree(argv);
214214
efree(formatcodes);
215215
efree(formatargs);
@@ -298,7 +298,7 @@ PHP_FUNCTION(pack)
298298
INC_OUTPUTPOS(arg,4) /* 32 bit per arg */
299299
break;
300300

301-
#if SIZEOF_LONG > 4
301+
#if SIZEOF_ZEND_LONG > 4
302302
case 'q':
303303
case 'Q':
304304
case 'J':
@@ -457,7 +457,7 @@ PHP_FUNCTION(pack)
457457
break;
458458
}
459459

460-
#if SIZEOF_LONG > 4
460+
#if SIZEOF_ZEND_LONG > 4
461461
case 'q':
462462
case 'Q':
463463
case 'J':
@@ -471,7 +471,7 @@ PHP_FUNCTION(pack)
471471
}
472472

473473
while (arg-- > 0) {
474-
php_pack(argv[currentarg++], 8, map, &output[outputpos]);
474+
php_pack(&argv[currentarg++], 8, map, &output[outputpos]);
475475
outputpos += 8;
476476
}
477477
break;
@@ -675,7 +675,7 @@ PHP_FUNCTION(unpack)
675675
case 'Q':
676676
case 'J':
677677
case 'P':
678-
#if SIZEOF_LONG > 4
678+
#if SIZEOF_ZEND_LONG > 4
679679
size = 8;
680680
break;
681681
#else
@@ -907,7 +907,7 @@ PHP_FUNCTION(unpack)
907907
break;
908908
}
909909

910-
#if SIZEOF_LONG > 4
910+
#if SIZEOF_ZEND_LONG > 4
911911
case 'q':
912912
case 'Q':
913913
case 'J':
@@ -1043,7 +1043,7 @@ PHP_MINIT_FUNCTION(pack)
10431043
little_endian_long_map[2] = 2;
10441044
little_endian_long_map[3] = 3;
10451045

1046-
#if SIZEOF_LONG > 4
1046+
#if SIZEOF_ZEND_LONG > 4
10471047
machine_endian_longlong_map[0] = 0;
10481048
machine_endian_longlong_map[1] = 1;
10491049
machine_endian_longlong_map[2] = 2;
@@ -1102,7 +1102,7 @@ PHP_MINIT_FUNCTION(pack)
11021102
little_endian_long_map[2] = size - 3;
11031103
little_endian_long_map[3] = size - 4;
11041104

1105-
#if SIZEOF_LONG > 4
1105+
#if SIZEOF_ZEND_LONG > 4
11061106
machine_endian_longlong_map[0] = size - 8;
11071107
machine_endian_longlong_map[1] = size - 7;
11081108
machine_endian_longlong_map[2] = size - 6;

0 commit comments

Comments
 (0)