diff options
author | Dan McGee <dan@archlinux.org> | 2007-04-26 18:59:02 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-04-26 18:59:02 -0400 |
commit | 6a1dfdf2928dbdecc5b0f2f8a7648e7f5ea84341 (patch) | |
tree | 6c3a5869854cc65310b5b05b365bf0c9667549ef | |
parent | 7bbcaaaae90770247f72cf213498b6934d949023 (diff) | |
download | pacman-6a1dfdf2928dbdecc5b0f2f8a7648e7f5ea84341.tar.xz |
Set the correct type on the log callback function
Somehow missed this earlier when changing everything to types.
unsigned short -> pmloglevel_t wherever necessary.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/alpm.h | 2 | ||||
-rw-r--r-- | src/pacman/callback.c | 2 | ||||
-rw-r--r-- | src/pacman/callback.h | 2 | ||||
-rw-r--r-- | src/util/testpkg.c | 3 |
4 files changed, 5 insertions, 4 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 1d7c0004..44c7e10f 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -70,7 +70,7 @@ typedef enum _pmloglevel_t { PM_LOG_FUNCTION = 0x10 } pmloglevel_t; -typedef void (*alpm_cb_log)(unsigned short, char *); +typedef void (*alpm_cb_log)(pmloglevel_t, char *); int alpm_logaction(char *fmt, ...); /* diff --git a/src/pacman/callback.c b/src/pacman/callback.c index bbd513d1..cc1b31c6 100644 --- a/src/pacman/callback.c +++ b/src/pacman/callback.c @@ -567,7 +567,7 @@ void cb_dl_progress(const char *filename, int xfered, int total) } /* Callback to handle notifications from the library */ -void cb_log(unsigned short level, char *msg) +void cb_log(pmloglevel_t level, char *msg) { char str[LOG_STR_LEN] = ""; diff --git a/src/pacman/callback.h b/src/pacman/callback.h index bc7038d3..8494154a 100644 --- a/src/pacman/callback.h +++ b/src/pacman/callback.h @@ -38,7 +38,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent, void cb_dl_progress(const char *filename, int xfered, int total); /* callback to handle messages/notifications from pacman library */ -void cb_log(unsigned short level, char *msg); +void cb_log(pmloglevel_t level, char *msg); #endif /* _PM_CALLBACK_H */ diff --git a/src/util/testpkg.c b/src/util/testpkg.c index a64e6b34..66569f1e 100644 --- a/src/util/testpkg.c +++ b/src/util/testpkg.c @@ -28,12 +28,13 @@ #include <alpm.h> -void output_cb(unsigned short level, char *msg) +void output_cb(pmloglevel_t level, char *msg) { if(strlen(msg)) { switch(level) { case PM_LOG_ERROR: printf("error: "); break; case PM_LOG_WARNING: printf("warning: "); break; + default: break; } puts(msg); } |