From 71c1fe3af863463e67bf223ef5a6fe3e987af598 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Fri, 16 Apr 2004 20:54:34 +0000 Subject: [PATCH] Update (Logical change 1.374) --- ChangeLog | 6 ++++-- ntfsprogs/cluster.c | 4 ---- ntfsprogs/mkntfs.c | 4 ++-- ntfsprogs/ntfscat.c | 6 ++++-- ntfsprogs/ntfsclone.c | 9 +-------- ntfsprogs/ntfsresize.c | 7 +------ ntfsprogs/utils.c | 5 ----- ntfsprogs/utils.h | 10 ++++++++++ 8 files changed, 22 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index da217838..01e9a0cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,10 +11,12 @@ xx/xx/2004 - 1.9.2-WIP $LogFile. (Szaka) - Fix incorrect getopt_long() usage: converted argv[optind-1] to optarg so utilities won't do bogus and unexpected things. (Szaka) - - Add new API security.[hc]::ntfs_sid_is_valid(), ntfs_sid_to_mbs(), and - ntfs_sid_to_mbs_size(). + - Add new API security.[hc]::ntfs_sid_is_valid(), ntfs_sid_to_mbs(), + and ntfs_sid_to_mbs_size(). - Big enhancement of ntfsinfo. (Yuval, me) - Split mkntfs into multiple functions. (Yuval) + - Compiler warning fixes in utilities related to GEN_PRINTF() and other + things. (Yuval) 05/04/2004 - 1.9.1 - Make mkntfs create bootable volumes and fixes/updates. - Update with SuSE 9.1 beta 1 versions of GNU build system. diff --git a/ntfsprogs/cluster.c b/ntfsprogs/cluster.c index 5f3bfcaf..fc281dfe 100644 --- a/ntfsprogs/cluster.c +++ b/ntfsprogs/cluster.c @@ -31,10 +31,6 @@ #include "cluster.h" #include "utils.h" -DEC_PRINTF (Eprintf) -DEC_PRINTF (Vprintf) -DEC_PRINTF (Qprintf) - #define RED "" #define YELLOW "" #define GREEN "" diff --git a/ntfsprogs/mkntfs.c b/ntfsprogs/mkntfs.c index e47fd902..315fea83 100644 --- a/ntfsprogs/mkntfs.c +++ b/ntfsprogs/mkntfs.c @@ -227,8 +227,7 @@ static void Dprintf(const char *fmt, ...) /** * Eprintf - error output; ignores quiet (-q) */ -void Eprintf(const char *fmt, ...); -void Eprintf(const char *fmt, ...) +int Eprintf(const char *fmt, ...) { va_list ap; @@ -236,6 +235,7 @@ void Eprintf(const char *fmt, ...) va_start(ap, fmt); vfprintf(stderr, fmt, ap); va_end(ap); + return 0; } /* Generate code for Vprintf() function: Verbose output (-v). */ diff --git a/ntfsprogs/ntfscat.c b/ntfsprogs/ntfscat.c index 5f7d2d99..304ba129 100644 --- a/ntfsprogs/ntfscat.c +++ b/ntfsprogs/ntfscat.c @@ -299,10 +299,12 @@ int main (int argc, char *argv[]) ntfs_inode_close (inode); ntfs_umount (vol, FALSE); +#if 0 if (result) - ;//Printf ("failed\n"); + Printf ("failed\n"); else - ;//Printf ("success\n"); + Printf ("success\n"); +#endif return result; } diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 0009a9a0..82a8246f 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -119,17 +119,10 @@ int wiped_timestamp_data = 0; #define read_all(f, p, n) io_all((f), (p), (n), 0) #define write_all(f, p, n) io_all((f), (p), (n), 1) -/* FIXME: They should be #included but Eprintf conflicts with mkntfs's Eprintf */ -extern int Eprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Vprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Qprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -/* FIXME: should be 'static' */ -extern int Printf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); - GEN_PRINTF(Eprintf, stderr, NULL, FALSE) GEN_PRINTF(Vprintf, msg_out, &opt.verbose, TRUE) GEN_PRINTF(Qprintf, msg_out, &opt.quiet, FALSE) -GEN_PRINTF(Printf, msg_out, NULL, FALSE) +static GEN_PRINTF(Printf, msg_out, NULL, FALSE) static void perr_printf(const char *fmt, ...) diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index d0765097..86d134e0 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -156,14 +156,9 @@ s64 max_free_cluster_range = 0; #define rounded_up_division(a, b) (((a) + (b - 1)) / (b)) -/* FIXME: They should be included but Eprintf conflicts with mkntfs's Eprintf */ -extern int Eprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Vprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Qprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); - GEN_PRINTF(Eprintf, stderr, NULL, FALSE) GEN_PRINTF(Vprintf, stdout, &opt.verbose, TRUE) -GEN_PRINTF(Qprintf, stdout, NULL, FALSE) +GEN_PRINTF(Qprintf, stdout, NULL, FALSE) /** * perr_printf diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index 4a42cae1..36cbf37e 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -58,11 +58,6 @@ const char *ntfs_gpl = "This program is free software, released under the GNU " #define NTFS_TIME_OFFSET ((s64)(369 * 365 + 89) * 24 * 3600 * 10000000) -/* These utilities require the following functions */ -extern int Eprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Vprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); -extern int Qprintf (const char *format, ...) __attribute__ ((format (printf, 1, 2))); - /** * utils_set_locale */ diff --git a/ntfsprogs/utils.h b/ntfsprogs/utils.h index e605da63..73678a84 100644 --- a/ntfsprogs/utils.h +++ b/ntfsprogs/utils.h @@ -70,6 +70,16 @@ extern const char *ntfs_gpl; return ret; \ } +/* utils.c's utilities require the following functions implemented. + * Example of implementation is: + * GEN_PRINTF (Eprintf, stderr, NULL, FALSE) + * GEN_PRINTF (Vprintf, stderr, &opts.verbose, TRUE) + * GEN_PRINTF (Qprintf, stderr, &opts.quiet, FALSE) + */ +extern DEC_PRINTF(Eprintf) +extern DEC_PRINTF(Vprintf) +extern DEC_PRINTF(Qprintf) + struct _IO_FILE; int ntfs_printf (struct _IO_FILE *stream, int *control, BOOL trigger,