Skip to content

Commit fafcaa3

Browse files
committed
Use ZEND_BYTES_SWAP32() for php_pack_reverse_int32()
1 parent 6dee7ae commit fafcaa3

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ext/standard/pack.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ ZEND_ATTRIBUTE_CONST static inline uint16_t php_pack_reverse_int16(uint16_t arg)
9999
/* {{{ php_pack_reverse_int32 */
100100
ZEND_ATTRIBUTE_CONST static inline uint32_t php_pack_reverse_int32(uint32_t arg)
101101
{
102-
uint32_t result;
103-
result = ((arg & 0xFF) << 24) | ((arg & 0xFF00) << 8) | ((arg >> 8) & 0xFF00) | ((arg >> 24) & 0xFF);
104-
105-
return result;
102+
return ZEND_BYTES_SWAP32(arg);
106103
}
107104
/* }}} */
108105

0 commit comments

Comments
 (0)