Skip to content

Commit

Permalink
vtoh(): Save '&' instrs by casting to U8
Browse files Browse the repository at this point in the history
  • Loading branch information
khwilliamson committed Jul 24, 2021
1 parent dfe5b3b commit 84bdbe8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions perl.h
Expand Up @@ -4220,11 +4220,11 @@ my_swap16(const U16 x) {
# define htovl(x) vtohl(x)
# define htovs(x) vtohs(x)
#elif BYTEORDER == 0x4321 || BYTEORDER == 0x87654321
# define vtohl(x) ((((x)&0xFF)<<24) \
+(((x)>>24)&0xFF) \
# define vtohl(x) ((((U8) (x)) << 24) \
+((U8) ((x) >> 24)) \
+(((x)&0x0000FF00)<<8) \
+(((x)&0x00FF0000)>>8) )
# define vtohs(x) ((((x)&0xFF)<<8) + (((x)>>8)&0xFF))
# define vtohs(x) ((((U8) (x)) << 8) + ((U8) ((x) >> 8)))
# define htovl(x) vtohl(x)
# define htovs(x) vtohs(x)
#else
Expand Down

0 comments on commit 84bdbe8

Please sign in to comment.