summaryrefslogtreecommitdiffstats
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
commit676e14b8437e49f54de307d55261474812ce4174 (patch)
tree5844d64e2d5e0b5a7b9dfc259037778db84b12aa /pack.c
parent9b82cee79ef2577f943c3fd43fd414449a0ddb82 (diff)
downloadruby-676e14b8437e49f54de307d55261474812ce4174.tar.gz
ruby-676e14b8437e49f54de307d55261474812ce4174.tar.xz
ruby-676e14b8437e49f54de307d55261474812ce4174.zip
matz
git-svn-id: http://svn.ruby-lang.org/repos/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 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