From 6c54d30fee9051e8cb5458e357e9ee41fda87db7 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 12 Aug 2010 04:26:57 +0000 Subject: these files don't need to include nearly so many headers --- sys/ntfs/ntfs_compr.c | 49 +++++++++++++++++++------------------------------ sys/ntfs/ntfs_conv.c | 18 +++--------------- 2 files changed, 22 insertions(+), 45 deletions(-) (limited to 'sys') diff --git a/sys/ntfs/ntfs_compr.c b/sys/ntfs/ntfs_compr.c index 50d08ed3b5e..5bbbacac5e1 100644 --- a/sys/ntfs/ntfs_compr.c +++ b/sys/ntfs/ntfs_compr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_compr.c,v 1.4 2009/08/13 16:00:53 jasper Exp $ */ +/* $OpenBSD: ntfs_compr.c,v 1.5 2010/08/12 04:26:56 tedu Exp $ */ /* $NetBSD: ntfs_compr.c,v 1.1 2002/12/23 17:38:31 jdolecek Exp $ */ /*- @@ -31,16 +31,7 @@ #include #include -#include -#include -#include -#include #include -#include -#include -#include - -#include #include #include @@ -48,15 +39,13 @@ #define GET_UINT16(addr) (*((u_int16_t *)(addr))) int -ntfs_uncompblock( - u_int8_t * buf, - u_int8_t * cbuf) +ntfs_uncompblock(u_int8_t * buf, u_int8_t * cbuf) { - u_int32_t ctag; - int len, dshift, lmask; - int blen, boff; - int i, j; - int pos, cpos; + u_int32_t ctag; + int len, dshift, lmask; + int blen, boff; + int i, j; + int pos, cpos; len = GET_UINT16(cbuf) & 0xFFF; dprintf(("ntfs_uncompblock: block length: %d + 3, 0x%x,0x%04x\n", @@ -69,7 +58,7 @@ ntfs_uncompblock( } memcpy(buf, cbuf + 2, len + 1); bzero(buf + len + 1, NTFS_COMPBLOCK_SIZE - 1 - len); - return len + 3; + return (len + 3); } cpos = 2; pos = 0; @@ -84,7 +73,8 @@ ntfs_uncompblock( } boff = -1 - (GET_UINT16(cbuf + cpos) >> dshift); blen = 3 + (GET_UINT16(cbuf + cpos) & lmask); - for (j = 0; (j < blen) && (pos < NTFS_COMPBLOCK_SIZE); j++) { + for (j = 0; (j < blen) && + (pos < NTFS_COMPBLOCK_SIZE); j++) { buf[pos] = buf[pos + boff]; pos++; } @@ -95,21 +85,20 @@ ntfs_uncompblock( ctag >>= 1; } } - return len + 3; + return (len + 3); } int -ntfs_uncompunit( - struct ntfsmount * ntmp, - u_int8_t * uup, - u_int8_t * cup) +ntfs_uncompunit(struct ntfsmount * ntmp, u_int8_t * uup, u_int8_t * cup) { - int i; - int off = 0; - int new; + int i; + int off = 0; + int new; - for (i = 0; i * NTFS_COMPBLOCK_SIZE < ntfs_cntob(NTFS_COMPUNIT_CL); i++) { - new = ntfs_uncompblock(uup + i * NTFS_COMPBLOCK_SIZE, cup + off); + for (i = 0; i * NTFS_COMPBLOCK_SIZE < ntfs_cntob(NTFS_COMPUNIT_CL); + i++) { + new = ntfs_uncompblock(uup + i * NTFS_COMPBLOCK_SIZE, + cup + off); if (new == 0) return (EINVAL); off += new; diff --git a/sys/ntfs/ntfs_conv.c b/sys/ntfs/ntfs_conv.c index 683d32be269..1eab868c013 100644 --- a/sys/ntfs/ntfs_conv.c +++ b/sys/ntfs/ntfs_conv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_conv.c,v 1.7 2009/08/13 16:00:53 jasper Exp $ */ +/* $OpenBSD: ntfs_conv.c,v 1.8 2010/08/12 04:26:56 tedu Exp $ */ /* $NetBSD: ntfs_conv.c,v 1.1 2002/12/23 17:38:32 jdolecek Exp $ */ /*- @@ -36,24 +36,12 @@ #include #include #include -#include -#include -#include #include -#include -#include -#include - -#include /* #define NTFS_DEBUG 1 */ #include -#include #include -#include #include -#include -#include /* UTF-8 encoding stuff */ @@ -91,8 +79,8 @@ ntfs_utf8_wget(const char **str) case 3: if ((s[1] & 0xC0) != 0x80 || (s[2] & 0xC0) != 0x80) goto encoding_error; - rune = ((s[0] & 0x1F) << 12) | ((s[1] & 0x3F) << 6) - | (s[2] & 0x3F); + rune = ((s[0] & 0x1F) << 12) | ((s[1] & 0x3F) << 6) | + (s[2] & 0x3F); break; } -- cgit v1.2.3