tidy up some __attribute__ usage
parent
e44bb7afb7
commit
42de4cf905
|
@ -225,8 +225,7 @@ struct {
|
|||
/**
|
||||
* mkDprintf - debugging output (-vv); overridden by quiet (-q)
|
||||
*/
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -262,9 +261,8 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE)
|
|||
/**
|
||||
* err_exit - error output and terminate; ignores quiet (-q)
|
||||
*/
|
||||
static void err_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -300,7 +298,7 @@ static void license(void)
|
|||
/**
|
||||
* usage - print a list of the parameters to the program
|
||||
*/
|
||||
static void usage(void) __attribute__ ((noreturn));
|
||||
__attribute__ ((noreturn))
|
||||
static void usage(void)
|
||||
{
|
||||
copyright();
|
||||
|
@ -987,7 +985,7 @@ static void dump_attr_record(ATTR_RECORD *a)
|
|||
/**
|
||||
* dump_mft_record
|
||||
*/
|
||||
static void dump_mft_record(MFT_RECORD *m) __attribute__((unused));
|
||||
__attribute__((unused))
|
||||
static void dump_mft_record(MFT_RECORD *m)
|
||||
{
|
||||
ATTR_RECORD *a;
|
||||
|
|
|
@ -177,8 +177,7 @@ GEN_PRINTF(Vprintf, msg_out, &opt.verbose, TRUE)
|
|||
GEN_PRINTF(Qprintf, msg_out, &opt.quiet, FALSE)
|
||||
static GEN_PRINTF(Printf, msg_out, NULL, FALSE)
|
||||
|
||||
static void perr_printf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void perr_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -192,8 +191,7 @@ static void perr_printf(const char *fmt, ...)
|
|||
fflush(msg_out);
|
||||
}
|
||||
|
||||
static void err_printf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -205,9 +203,8 @@ static void err_printf(const char *fmt, ...)
|
|||
fflush(msg_out);
|
||||
}
|
||||
|
||||
static int err_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -220,9 +217,8 @@ static int err_exit(const char *fmt, ...)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -238,7 +234,7 @@ static int perr_exit(const char *fmt, ...)
|
|||
}
|
||||
|
||||
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
__attribute__((noreturn))
|
||||
static void usage(void)
|
||||
{
|
||||
Eprintf("\nUsage: %s [OPTIONS] SOURCE\n"
|
||||
|
|
|
@ -67,8 +67,7 @@ GEN_PRINTF(Eprintf, stderr, NULL, FALSE)
|
|||
GEN_PRINTF(Vprintf, stdout, &opt.verbose, TRUE)
|
||||
GEN_PRINTF(Qprintf, stdout, NULL, FALSE)
|
||||
|
||||
static void perr_printf(int newline, const char *fmt, ...)
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
__attribute__((format(printf, 2, 3)))
|
||||
static void perr_printf(int newline, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -88,8 +87,7 @@ static void perr_printf(int newline, const char *fmt, ...)
|
|||
#define perr_print(...) perr_printf(0, __VA_ARGS__)
|
||||
#define perr_println(...) perr_printf(1, __VA_ARGS__)
|
||||
|
||||
static void err_printf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -107,9 +105,8 @@ static void err_printf(const char *fmt, ...)
|
|||
*
|
||||
* Print and error message and exit the program.
|
||||
*/
|
||||
static int err_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -128,9 +125,8 @@ static int err_exit(const char *fmt, ...)
|
|||
*
|
||||
* Print and error message and exit the program
|
||||
*/
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -153,7 +149,7 @@ static int perr_exit(const char *fmt, ...)
|
|||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
__attribute__((noreturn))
|
||||
static void usage(void)
|
||||
{
|
||||
|
||||
|
|
|
@ -120,10 +120,9 @@ static int logfile_close(logfile_file *logfile)
|
|||
* Use when you wish to exit and collate all the cleanups together.
|
||||
* if you don't have some parameter to pass, just pass NULL.
|
||||
*/
|
||||
void device_err_exit(ntfs_volume *vol, ntfs_inode *ni,
|
||||
ntfs_attr *na, const char *fmt, ...) __attribute__ ((noreturn))
|
||||
__attribute__ ((format(printf, 4, 5)));
|
||||
void device_err_exit(ntfs_volume *vol, ntfs_inode *ni,
|
||||
__attribute__ ((noreturn))
|
||||
__attribute__ ((format(printf, 4, 5)))
|
||||
static void device_err_exit(ntfs_volume *vol, ntfs_inode *ni,
|
||||
ntfs_attr *na, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -148,9 +147,9 @@ void device_err_exit(ntfs_volume *vol, ntfs_inode *ni,
|
|||
/**
|
||||
* log_err_exit -
|
||||
*/
|
||||
void log_err_exit(u8 *buf, const char *fmt, ...) __attribute__ ((noreturn))
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
void log_err_exit(u8 *buf, const char *fmt, ...)
|
||||
__attribute__ ((noreturn))
|
||||
__attribute__((format(printf, 2, 3)))
|
||||
static void log_err_exit(u8 *buf, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
@ -169,8 +168,8 @@ void log_err_exit(u8 *buf, const char *fmt, ...)
|
|||
/**
|
||||
* usage -
|
||||
*/
|
||||
void usage(const char *exec_name) __attribute__ ((noreturn));
|
||||
void usage(const char *exec_name)
|
||||
__attribute__ ((noreturn))
|
||||
static void usage(const char *exec_name)
|
||||
{
|
||||
Eprintf("%s v%s (libntfs %s) - Interpret and display information "
|
||||
"about the journal\n($LogFile) of an NTFS volume.\n"
|
||||
|
|
|
@ -95,7 +95,7 @@ struct {
|
|||
char *volume;
|
||||
} opt;
|
||||
|
||||
static int usage(void) __attribute__((noreturn));
|
||||
__attribute__((noreturn))
|
||||
static int usage(void)
|
||||
{
|
||||
printf("%s v%s (libntfs %s)\n"
|
||||
|
@ -113,7 +113,7 @@ static int usage(void)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
static void version(void) __attribute__((noreturn));
|
||||
__attribute__((noreturn))
|
||||
static void version(void)
|
||||
{
|
||||
printf("%s v%s\n\n"
|
||||
|
|
|
@ -91,8 +91,7 @@ static struct {
|
|||
/**
|
||||
* mkDprintf - debugging output (-vv); overridden by quiet (-q)
|
||||
*/
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -128,8 +127,8 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE)
|
|||
/**
|
||||
* err_exit - error output and terminate; ignores quiet (-q)
|
||||
*/
|
||||
static void err_exit(const char *fmt, ...) __attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -167,8 +166,8 @@ static void license(void)
|
|||
/**
|
||||
* usage - print a list of the parameters to the program
|
||||
*/
|
||||
void usage(void) __attribute__ ((noreturn));
|
||||
void usage (void)
|
||||
__attribute__ ((noreturn))
|
||||
static void usage (void)
|
||||
{
|
||||
copyright();
|
||||
fprintf(stderr, "Usage: %s [options] device [base-mft-record]\n"
|
||||
|
|
|
@ -220,8 +220,7 @@ static s64 rounded_up_division(s64 numer, s64 denom)
|
|||
*
|
||||
* Print an error message.
|
||||
*/
|
||||
static void perr_printf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void perr_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -236,8 +235,7 @@ static void perr_printf(const char *fmt, ...)
|
|||
fflush(stderr);
|
||||
}
|
||||
|
||||
static void err_printf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_printf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -255,9 +253,8 @@ static void err_printf(const char *fmt, ...)
|
|||
*
|
||||
* Print and error message and exit the program.
|
||||
*/
|
||||
static int err_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -276,9 +273,8 @@ static int err_exit(const char *fmt, ...)
|
|||
*
|
||||
* Print and error message and exit the program
|
||||
*/
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static int perr_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -301,7 +297,7 @@ static int perr_exit(const char *fmt, ...)
|
|||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void usage(void) __attribute__((noreturn));
|
||||
__attribute__((noreturn))
|
||||
static void usage(void)
|
||||
{
|
||||
|
||||
|
|
|
@ -100,8 +100,7 @@ struct {
|
|||
/**
|
||||
* mkDprintf - debugging output (-vv); overridden by quiet (-q)
|
||||
*/
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void mkDprintf(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -137,9 +136,8 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE)
|
|||
/**
|
||||
* err_exit - error output and terminate; ignores quiet (-q)
|
||||
*/
|
||||
static void err_exit(const char *fmt, ...)
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)));
|
||||
__attribute__((noreturn))
|
||||
__attribute__((format(printf, 1, 2)))
|
||||
static void err_exit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
@ -174,8 +172,8 @@ static void license(void)
|
|||
/**
|
||||
* usage - print a list of the parameters to the program
|
||||
*/
|
||||
void usage(void) __attribute__ ((noreturn));
|
||||
void usage (void)
|
||||
__attribute__ ((noreturn))
|
||||
static void usage (void)
|
||||
{
|
||||
copyright();
|
||||
fprintf(stderr, "Usage: %s [options] device inode [attr-type "
|
||||
|
|
Loading…
Reference in New Issue