diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-05 10:27:34 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-02-05 10:27:34 +0000 |
commit | 9b64dfe3b8f0343ebf97ae80d3a4ec3f4bd115b3 (patch) | |
tree | 7acd7b77321fdbc63149b47fde3bace6f7733614 /pack.c | |
parent | 06d4e3b42d836b762c29cdc9dc7181caf14dcdec (diff) |
990205
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'pack.c')
-rw-r--r-- | pack.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -16,7 +16,7 @@ #define define_swapx(x, xtype) \ static xtype \ -TAKEN_PASTE(swap,x)(z) \ +TOKEN_PASTE(swap,x)(z) \ xtype z; \ { \ xtype r; \ @@ -64,9 +64,8 @@ define_swapx(s,short); +(((x)&0x0000000000FF0000)<<24) \ +(((x)&0x0000FF0000000000)>>24) \ +(((x)&0x00000000FF000000)<<8) \ - +(((x)&0x000000FF00000000)>>8) + +(((x)&0x000000FF00000000)>>8) ) #else - define_swapx(l,long); #endif #endif @@ -223,7 +222,7 @@ endian() #ifdef FLOAT_SWAPPER #define FLOAT_CONVWITH(y) FLOAT_SWAPPER y; #define HTONF(x,y) (memcpy(&y,&x,sizeof(float)), \ - x = htonf((FLOAT_SWAPPER)y), \ + y = htonf((FLOAT_SWAPPER)y), \ memcpy(&x,&y,sizeof(float)), \ x) #define HTOVF(x,y) (memcpy(&y,&x,sizeof(float)), \ @@ -249,7 +248,7 @@ endian() #ifdef DOUBLE_SWAPPER #define DOUBLE_CONVWITH(y) DOUBLE_SWAPPER y; #define HTOND(x,y) (memcpy(&y,&x,sizeof(double)), \ - x = htond((DOUBLE_SWAPPER)y), \ + y = htond((DOUBLE_SWAPPER)y), \ memcpy(&x,&y,sizeof(double)), \ x) #define HTOVD(x,y) (memcpy(&y,&x,sizeof(double)), \ |