[pacman-dev] [PATCH 05/15] standardize format functions

Simon Gomizelj simongmzlj at gmail.com
Wed Mar 6 12:51:46 EST 2013


Signed-off-by: Simon Gomizelj <simongmzlj at gmail.com>
---
 src/pacman/util.c | 16 ++++++++--------
 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 aa352e3..f326849 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -1479,7 +1479,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;
@@ -1497,7 +1497,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]"));
@@ -1534,25 +1534,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 f579b7e..0a2a6f7 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)));
-- 
1.8.1.5



More information about the pacman-dev mailing list