From 676e14b8437e49f54de307d55261474812ce4174 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 20 Nov 2000 07:31:55 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- pack.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'pack.c') diff --git a/pack.c b/pack.c index d06cec1c6..553860044 100644 --- a/pack.c +++ b/pack.c @@ -71,13 +71,13 @@ TOKEN_PASTE(swap,x)(z) \ } #if SIZEOF_SHORT == 2 -#define swaps(x) ((((x)&0xFF)<<8) + (((x)>>8)&0xFF)) +#define swaps(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF)) #else #if SIZEOF_SHORT == 4 #define swaps(x) ((((x)&0xFF)<<24) \ - +(((x)>>24)&0xFF) \ - +(((x)&0x0000FF00)<<8) \ - +(((x)&0x00FF0000)>>8) ) + |(((x)>>24)&0xFF) \ + |(((x)&0x0000FF00)<<8) \ + |(((x)&0x00FF0000)>>8) ) #else define_swapx(s,short); #endif @@ -85,19 +85,19 @@ define_swapx(s,short); #if SIZEOF_LONG == 4 #define swapl(x) ((((x)&0xFF)<<24) \ - +(((x)>>24)&0xFF) \ - +(((x)&0x0000FF00)<<8) \ - +(((x)&0x00FF0000)>>8) ) + |(((x)>>24)&0xFF) \ + |(((x)&0x0000FF00)<<8) \ + |(((x)&0x00FF0000)>>8) ) #else #if SIZEOF_LONG == 8 #define swapl(x) ((((x)&0x00000000000000FF)<<56) \ - +(((x)&0xFF00000000000000)>>56) \ - +(((x)&0x000000000000FF00)<<40) \ - +(((x)&0x00FF000000000000)>>40) \ - +(((x)&0x0000000000FF0000)<<24) \ - +(((x)&0x0000FF0000000000)>>24) \ - +(((x)&0x00000000FF000000)<<8) \ - +(((x)&0x000000FF00000000)>>8)) + |(((x)&0xFF00000000000000)>>56) \ + |(((x)&0x000000000000FF00)<<40) \ + |(((x)&0x00FF000000000000)>>40) \ + |(((x)&0x0000000000FF0000)<<24) \ + |(((x)&0x0000FF0000000000)>>24) \ + |(((x)&0x00000000FF000000)<<8) \ + |(((x)&0x000000FF00000000)>>8)) #else define_swapx(l,long); #endif -- cgit