File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 19
19
#include "phar_internal.h"
20
20
21
21
#ifdef WORDS_BIGENDIAN
22
- # define PHAR_GET_32 (buffer ) (((((unsigned char*)(buffer))[3]) << 24) \
23
- | ((((unsigned char*)(buffer))[2]) << 16) \
24
- | ((((unsigned char*)(buffer))[1]) << 8) \
25
- | (((unsigned char*)(buffer))[0]))
26
- # define PHAR_GET_16 (buffer ) (((((unsigned char*)(buffer))[1]) << 8) \
27
- | (((unsigned char*)(buffer))[0]))
22
+ static inline php_uint32 phar_fix_32 (php_uint32 buffer )
23
+ {
24
+ return ((((unsigned char * )& buffer )[3 ]) << 24 ) |
25
+ ((((unsigned char * )& buffer )[2 ]) << 16 ) |
26
+ ((((unsigned char * )& buffer )[1 ]) << 8 ) |
27
+ (((unsigned char * )& buffer )[0 ]);
28
+ }
29
+ static inline php_uint16 phar_fix_16 (php_uint16 buffer )
30
+ {
31
+ return ((((unsigned char * )& buffer )[1 ]) << 8 ) | ((unsigned char * )& buffer )[0 ];
32
+ }
33
+ # define PHAR_GET_32 (buffer ) phar_fix_32((php_uint32)(buffer))
34
+ # define PHAR_GET_16 (buffer ) phar_fix_16((php_uint16)(buffer))
28
35
# define PHAR_SET_32 (buffer ) PHAR_GET_32(buffer)
29
36
# define PHAR_SET_16 (buffer ) PHAR_GET_16(buffer)
30
37
#else
You can’t perform that action at this time.
0 commit comments