From d33e7eaae43b6d2f6d1cba7e71208740ad65c274 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 19 Aug 2004 21:01:11 +0000 Subject: [PATCH] Fix fallout from previous error output changes. (Logical change 1.503) --- libntfs/device.c | 3 ++- libntfs/dir.c | 2 +- libntfs/lcnalloc.c | 14 +++++++------- libntfs/volume.c | 6 ++++-- ntfsprogs/ntfsundelete.c | 2 ++ 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/libntfs/device.c b/libntfs/device.c index 3b4d8fe4..f11bbc38 100644 --- a/libntfs/device.c +++ b/libntfs/device.c @@ -495,7 +495,8 @@ s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size) if (dev->d_ops->ioctl(dev, FDGETPRM, &this_floppy) >= 0) { Dprintf("FDGETPRM nr 512 byte blocks = %lu (0x%lx)\n", - this_floppy.size, this_floppy.size); + (unsigned long)this_floppy.size, + (unsigned long)this_floppy.size); return (s64)this_floppy.size * 512 / block_size; } } diff --git a/libntfs/dir.c b/libntfs/dir.c index a1c09b87..2be99423 100644 --- a/libntfs/dir.c +++ b/libntfs/dir.c @@ -663,7 +663,7 @@ int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos, parent_mref = ntfs_mft_get_parent_ref(dir_ni); if (parent_mref == ERR_MREF(-1)) { - Dprintf("Parent directory not found: %s\n", errno); + Dperror("Parent directory not found"); goto dir_err_out; } diff --git a/libntfs/lcnalloc.c b/libntfs/lcnalloc.c index 39a0bf0c..4d78c440 100644 --- a/libntfs/lcnalloc.c +++ b/libntfs/lcnalloc.c @@ -303,8 +303,8 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, s64 count, LCN start_lcn, */ Dprintf("%s(): Adding run (lcn 0x%llx, len 0x%llx), " "prev_lcn = 0x%llx, lcn = 0x%llx, " - "bmp_pos = 0x%llx, prev_run_len = 0x%x, " - "rlpos = %i.\n", __FUNCTION__, + "bmp_pos = 0x%llx, prev_run_len = " + "0x%llx, rlpos = %i.\n", __FUNCTION__, (long long)(lcn + bmp_pos), 1LL, (long long)prev_lcn, (long long)lcn, (long long)bmp_pos, @@ -600,8 +600,8 @@ switch_to_data1_zone: search_zone = 2; } break; case 4: - Dprintf("%s(): Switching from data2 zone to " - "data1 zone.\n"); + Dputs("Switching from data2 zone to data1 " + "zone."); /* Update data2 zone position. */ if (rlpos) { LCN tc; @@ -701,9 +701,9 @@ switch_to_data1_zone: search_zone = 2; (long long)zone_end, (long long)vol->data1_zone_pos); } - Dprintf("%s(): After outer while loop.\n"); + Dputs("After outer while loop."); done_ret: - Dprintf("%s(): At done_ret.\n"); + Dputs("At done_ret."); /* Add runlist terminator element. */ rl[rlpos].vcn = rl[rlpos - 1].vcn + rl[rlpos - 1].length; rl[rlpos].lcn = LCN_RL_NOT_MAPPED; @@ -725,7 +725,7 @@ done_ret: } } done_err_ret: - Dprintf("%s(): At done_err_ret (follows done_ret).\n"); + Dputs("At done_err_ret (follows done_ret).n"); free(buf); /* Done! */ if (!err) diff --git a/libntfs/volume.c b/libntfs/volume.c index 3bac6683..66622eff 100644 --- a/libntfs/volume.c +++ b/libntfs/volume.c @@ -397,12 +397,12 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long rwflag) { LCN mft_zone_size, mft_lcn; s64 br; - const char *OK = "OK"; - const char *FAILED = "FAILED"; ntfs_volume *vol; NTFS_BOOT_SECTOR *bs; int eo; #ifdef DEBUG + const char *OK = "OK"; + const char *FAILED = "FAILED"; BOOL debug = 1; #else BOOL debug = 0; @@ -585,8 +585,10 @@ error_exit: ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long rwflag) { s64 l; +#ifdef DEBUG const char *OK = "OK"; const char *FAILED = "FAILED"; +#endif ntfs_volume *vol; u8 *m = NULL, *m2 = NULL; ntfs_attr_search_ctx *ctx = NULL; diff --git a/ntfsprogs/ntfsundelete.c b/ntfsprogs/ntfsundelete.c index 96e37373..62a3bf3a 100644 --- a/ntfsprogs/ntfsundelete.c +++ b/ntfsprogs/ntfsundelete.c @@ -55,7 +55,9 @@ static const char *EXEC_NAME = "ntfsundelete"; static const char *MFTFILE = "mft"; +#ifdef DEBUG static const char *UNNAMED = ""; +#endif static const char *NONE = ""; static const char *UNKNOWN = "unknown"; static struct options opts;