summaryrefslogtreecommitdiff
path: root/pack.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-20 07:31:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-20 07:31:55 +0000
commit39563af99459820ada08e30e379c84b4560c3fe9 (patch)
tree5844d64e2d5e0b5a7b9dfc259037778db84b12aa /pack.c
parent8f54a9b4704e5416290a5670519ae7bc869de0e8 (diff)
downloadruby-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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/pack.c b/pack.c
index d06cec1c6f..5538600449 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