set debug level via patchable variable, and fix some debug printf warnings

This commit is contained in:
joda 2001-03-29 10:51:16 +00:00
parent 46d4ad76ad
commit 35fd1893df
2 changed files with 14 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfs.h,v 1.11 2001/02/13 19:53:52 jdolecek Exp $ */
/* $NetBSD: ntfs.h,v 1.12 2001/03/29 10:51:16 joda Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@ -327,13 +327,12 @@ typedef int (vop_t) __P((void *));
#endif /* NetBSD */
#if defined(NTFS_DEBUG)
#define dprintf(a) printf a
#if NTFS_DEBUG > 1
#define ddprintf(a) printf a
#else
#define ddprintf(a)
#endif
#else
extern int ntfs_debug;
#define DPRINTF(X, Y) do { if(ntfs_debug >= (X)) printf Y; } while(0)
#define dprintf(a) DPRINTF(1, a)
#define ddprintf(a) DPRINTF(2, a)
#else /* NTFS_DEBUG */
#define DPRINTF(X, Y)
#define dprintf(a)
#define ddprintf(a)
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfs_subr.c,v 1.26 2001/02/13 19:53:52 jdolecek Exp $ */
/* $NetBSD: ntfs_subr.c,v 1.27 2001/03/29 10:51:16 joda Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko (semenu@FreeBSD.org)
@ -55,6 +55,10 @@
#include <ntfs/ntfs_compr.h>
#include <ntfs/ntfs_ihash.h>
#if defined(NTFS_DEBUG)
int ntfs_debug = NTFS_DEBUG;
#endif
#if defined(__FreeBSD__)
MALLOC_DEFINE(M_NTFSNTVATTR, "NTFS vattr", "NTFS file attribute information");
MALLOC_DEFINE(M_NTFSRDATA, "NTFS res data", "NTFS resident data");
@ -1493,7 +1497,7 @@ ntfs_writentvattr_plain(
return ENOTTY;
}
ddprintf(("ntfs_writentvattr_plain: data in run: %d chains\n",
ddprintf(("ntfs_writentvattr_plain: data in run: %lu chains\n",
vap->va_vruncnt));
off = roff;
@ -1599,7 +1603,7 @@ ntfs_readntvattr_plain(
struct buf *bp;
size_t tocopy;
ddprintf(("ntfs_readntvattr_plain: data in run: %d chains\n",
ddprintf(("ntfs_readntvattr_plain: data in run: %lu chains\n",
vap->va_vruncnt));
off = roff;