Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / fs / mfs / utility.c
blobb4c96b68a83dbba22036fe7d12d9d38e0ce4c6f9
1 #include "fs.h"
2 #include "buf.h"
3 #include "inode.h"
4 #include "super.h"
7 /*===========================================================================*
8 * conv2 *
9 *===========================================================================*/
10 unsigned conv2(norm, w)
11 int norm; /* TRUE if no swap, FALSE for byte swap */
12 int w; /* promotion of 16-bit word to be swapped */
14 /* Possibly swap a 16-bit word between 8086 and 68000 byte order. */
15 if (norm) return( (unsigned) w & 0xFFFF);
16 return( ((w&BYTE) << 8) | ( (w>>8) & BYTE));
20 /*===========================================================================*
21 * conv4 *
22 *===========================================================================*/
23 long conv4(norm, x)
24 int norm; /* TRUE if no swap, FALSE for byte swap */
25 long x; /* 32-bit long to be byte swapped */
27 /* Possibly swap a 32-bit long between 8086 and 68000 byte order. */
28 unsigned lo, hi;
29 long l;
31 if (norm) return(x); /* byte order was already ok */
32 lo = conv2(FALSE, (int) x & 0xFFFF); /* low-order half, byte swapped */
33 hi = conv2(FALSE, (int) (x>>16) & 0xFFFF); /* high-order half, swapped */
34 l = ( (long) lo <<16) | hi;
35 return(l);