diff options
author | phk <phk@FreeBSD.org> | 2003-01-29 18:37:29 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-01-29 18:37:29 +0000 |
commit | 15d50f061e050b6315ee59f48683bd4de5ddcdd3 (patch) | |
tree | 3a7874f816c9dd68e8422f55e43dae9d7c91a576 /sys | |
parent | 637cc179f5d0e82dfd99e85e20f6200d21ad09c9 (diff) | |
download | FreeBSD-src-15d50f061e050b6315ee59f48683bd4de5ddcdd3.zip FreeBSD-src-15d50f061e050b6315ee59f48683bd4de5ddcdd3.tar.gz |
Sort these functions as the author instructed.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_enc.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/geom/geom_enc.c b/sys/geom/geom_enc.c index 427650d..ce18892 100644 --- a/sys/geom/geom_enc.c +++ b/sys/geom/geom_enc.c @@ -82,14 +82,6 @@ g_dec_le2(const u_char *p) return((p[1] << 8) | p[0]); } -void -g_enc_le2(u_char *p, uint16_t u) -{ - - p[0] = u & 0xff; - p[1] = (u >> 8) & 0xff; -} - uint32_t g_dec_le4(const u_char *p) { @@ -97,25 +89,31 @@ g_dec_le4(const u_char *p) return((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]); } +uint64_t +g_dec_le8(const u_char *p) +{ + + return(g_dec_le4(p) | ((uint64_t)(g_dec_le4(p + 4)) << 32)); +} void -g_enc_le4(u_char *p, uint32_t u) +g_enc_le2(u_char *p, uint16_t u) { p[0] = u & 0xff; p[1] = (u >> 8) & 0xff; - p[2] = (u >> 16) & 0xff; - p[3] = (u >> 24) & 0xff; } -uint64_t -g_dec_le8(const u_char *p) +void +g_enc_le4(u_char *p, uint32_t u) { - return(g_dec_le4(p) | ((uint64_t)(g_dec_le4(p + 4)) << 32)); + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; + p[2] = (u >> 16) & 0xff; + p[3] = (u >> 24) & 0xff; } - void g_enc_le8(u_char *p, uint64_t u) { @@ -123,4 +121,3 @@ g_enc_le8(u_char *p, uint64_t u) g_enc_le4(p, u); g_enc_le4(p + 4, u >> 32); } - |