diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-04-23 18:46:41 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-04-23 18:46:41 +0000 |
commit | 323a9a48e8fff909535923556a7c361b3790f131 (patch) | |
tree | c9f70e4a3f460741a6a2a25324047b14146eccd0 /ufs | |
parent | bed974f2fe563d446432d1c3a7d1addd67a3d3e9 (diff) |
(swab_long): Cleaner now.
(swab_long_long): New function.
Diffstat (limited to 'ufs')
-rw-r--r-- | ufs/ufs.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -181,10 +181,15 @@ swab_short (short arg) extern inline long swab_long (long arg) { - return (((arg & 0xff) << 24) - | ((arg & 0xff00) << 8) - | ((arg & 0xff0000) >> 8) - | ((arg & 0xff000000) >> 24)); + return ((swab_short (arg & 0xffff) << 16) + | swab_short ((arg & 0xffff0000) >> 16)); +} + +extern inline long long +swab_long_long (long long arg) +{ + return ((swab_long (arg & 0xffffffff) << 32) + | swab_long ((arg & 0xffffffff00000000) >> 32)); } /* Return ENTRY, after byteswapping it if necessary */ |