diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-11-20 07:31:55 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-11-20 07:31:55 +0000 |
commit | 39563af99459820ada08e30e379c84b4560c3fe9 (patch) | |
tree | 5844d64e2d5e0b5a7b9dfc259037778db84b12aa /pack.c | |
parent | 8f54a9b4704e5416290a5670519ae7bc869de0e8 (diff) | |
download | ruby-39563af99459820ada08e30e379c84b4560c3fe9.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -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 |