Skip to content

Commit 3b1918b

Browse files
committed
Use ZEND_BYTES_SWAP32() for php_pack_reverse_int32()
1 parent 0efbbbd commit 3b1918b

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
@@ -96,10 +96,7 @@ ZEND_ATTRIBUTE_CONST static inline uint16_t php_pack_reverse_int16(uint16_t arg)
9696
/* {{{ php_pack_reverse_int32 */
9797
ZEND_ATTRIBUTE_CONST static inline uint32_t php_pack_reverse_int32(uint32_t arg)
9898
{
99-
uint32_t result;
100-
result = ((arg & 0xFF) << 24) | ((arg & 0xFF00) << 8) | ((arg >> 8) & 0xFF00) | ((arg >> 24) & 0xFF);
101-
102-
return result;
99+
return ZEND_BYTES_SWAP32(arg);
103100
}
104101
/* }}} */
105102

0 commit comments

Comments
 (0)