diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-04-23 16:02:54 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-04-23 16:02:54 +0000 |
commit | 74b0f23a3aca3c0dedd09a3143afc1141f37d1fd (patch) | |
tree | b1e97eb62c23889c8d1f15f8affcd5417019484b | |
parent | 976f3e6b59ac2071647c86d884e808af10dd48d4 (diff) |
(read_disk_entry): New macro.
-rw-r--r-- | ufs/ufs.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -186,6 +186,21 @@ swab_long (long arg) | ((arg & 0xff0000) >> 8) | ((arg & 0xff000000) >> 24)); } + +/* Return *ENTRYP, after byteswapping it if necessary */ +#define read_disk_entry(entryp) \ +({ \ + if (!swab_disk || sizeof (*entryp) == 1) \ + *entryp; \ + else if (sizeof (*entryp) == 2) \ + swab_short (*entryp); \ + else if (sizeof (*entry) == 4) \ + swab_long (*entryp); \ + else \ + abort; \ +}) + + |