diff options
author | Simon Gomizelj <simongmzlj@gmail.com> | 2013-03-01 13:52:14 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-07 15:55:03 +1000 |
commit | ea42d03ea153a17edc792844c572f0d3d0803bd6 (patch) | |
tree | ec42f2db47c33146edca8e302beda4092487c7b2 /src | |
parent | ce5ee8a065a590564982191c76cb325ab05e04e2 (diff) | |
download | pacman-ea42d03ea153a17edc792844c572f0d3d0803bd6.tar.xz |
standardize format functions
Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/util.c | 16 | ||||
-rw-r--r-- | src/pacman/util.h | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c index 51d6ecd7..22fdb361 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1478,7 +1478,7 @@ int select_question(int count) /* presents a prompt and gets a Y/N answer */ __attribute__((format(printf, 2, 0))) -static int question(short preset, char *fmt, va_list args) +static int question(short preset, const char *format, va_list args) { char response[32]; FILE *stream; @@ -1496,7 +1496,7 @@ static int question(short preset, char *fmt, va_list args) fflush(stderr); fprintf(stream, ":: "); - vfprintf(stream, fmt, args); + vfprintf(stream, format, args); if(preset) { fprintf(stream, " %s ", _("[Y/n]")); @@ -1533,25 +1533,25 @@ static int question(short preset, char *fmt, va_list args) return 0; } -int yesno(char *fmt, ...) +int yesno(const char *format, ...) { int ret; va_list args; - va_start(args, fmt); - ret = question(1, fmt, args); + va_start(args, format); + ret = question(1, format, args); va_end(args); return ret; } -int noyes(char *fmt, ...) +int noyes(const char *format, ...) { int ret; va_list args; - va_start(args, fmt); - ret = question(0, fmt, args); + va_start(args, format); + ret = question(0, format, args); va_end(args); return ret; diff --git a/src/pacman/util.h b/src/pacman/util.h index f579b7ec..0a2a6f75 100644 --- a/src/pacman/util.h +++ b/src/pacman/util.h @@ -72,9 +72,9 @@ void print_packages(const alpm_list_t *packages); void select_display(const alpm_list_t *pkglist); int select_question(int count); int multiselect_question(char *array, int count); -int colon_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); -int yesno(char *fmt, ...) __attribute__((format(printf, 1, 2))); -int noyes(char *fmt, ...) __attribute__((format(printf, 1, 2))); +int colon_printf(const char *format, ...) __attribute__((format(printf, 1, 2))); +int yesno(const char *format, ...) __attribute__((format(printf, 1, 2))); +int noyes(const char *format, ...) __attribute__((format(printf, 1, 2))); int pm_printf(alpm_loglevel_t level, const char *format, ...) __attribute__((format(printf,2,3))); int pm_asprintf(char **string, const char *format, ...) __attribute__((format(printf,2,3))); |