summaryrefslogtreecommitdiff
path: root/ufs/ufs.h
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-04-23 18:46:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-04-23 18:46:41 +0000
commiteb186a7fc9ce5b4c35986128e52372142af8fc37 (patch)
tree5e4e4d82820af84373825048327864baf8d019eb /ufs/ufs.h
parentb9050c0aaed61138e1df38d094e1c3bbf8d91e6a (diff)
(swab_long): Cleaner now.
(swab_long_long): New function.
Diffstat (limited to 'ufs/ufs.h')
-rw-r--r--ufs/ufs.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/ufs/ufs.h b/ufs/ufs.h
index 2c1a3fde..c09ddeeb 100644
--- a/ufs/ufs.h
+++ b/ufs/ufs.h
@@ -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 */