1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

Mark log callback format string const

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-02-24 09:38:59 -06:00
parent 6735807c0f
commit 7c14e48776
8 changed files with 10 additions and 10 deletions

View File

@ -74,8 +74,8 @@ typedef enum _pmloglevel_t {
PM_LOG_FUNCTION = (1 << 3)
} pmloglevel_t;
typedef void (*alpm_cb_log)(pmloglevel_t, char *, va_list);
int alpm_logaction(char *fmt, ...);
typedef void (*alpm_cb_log)(pmloglevel_t, const char *, va_list);
int alpm_logaction(const char *fmt, ...);
/*
* Downloading

View File

@ -42,7 +42,7 @@
* @param fmt output format
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
int SYMEXPORT alpm_logaction(char *fmt, ...)
int SYMEXPORT alpm_logaction(const char *fmt, ...)
{
int ret;
va_list args;
@ -88,7 +88,7 @@ int SYMEXPORT alpm_logaction(char *fmt, ...)
/** @} */
void _alpm_log(pmloglevel_t flag, char *fmt, ...)
void _alpm_log(pmloglevel_t flag, const char *fmt, ...)
{
va_list args;
alpm_cb_log logcb = alpm_option_get_logcb();

View File

@ -29,7 +29,7 @@
#define ALPM_LOG_FUNC
#endif
void _alpm_log(pmloglevel_t flag, char *fmt, ...) __attribute__((format(printf,2,3)));
void _alpm_log(pmloglevel_t flag, const char *fmt, ...) __attribute__((format(printf,2,3)));
#endif /* _ALPM_LOG_H */

View File

@ -669,7 +669,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
}
/* Callback to handle notifications from the library */
void cb_log(pmloglevel_t level, char *fmt, va_list args)
void cb_log(pmloglevel_t level, const char *fmt, va_list args)
{
if(!fmt || strlen(fmt) == 0) {
return;

View File

@ -41,7 +41,7 @@ void cb_dl_total(off_t total);
void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total);
/* callback to handle messages/notifications from pacman library */
void cb_log(pmloglevel_t level, char *fmt, va_list args);
void cb_log(pmloglevel_t level, const char *fmt, va_list args);
#endif /* _PM_CALLBACK_H */

View File

@ -37,7 +37,7 @@ static void cleanup(int signum) {
exit(signum);
}
static void output_cb(pmloglevel_t level, char *fmt, va_list args)
static void output_cb(pmloglevel_t level, const char *fmt, va_list args)
{
if(strlen(fmt)) {
switch(level) {

View File

@ -39,7 +39,7 @@ static void cleanup(int signum) {
exit(signum);
}
static void output_cb(pmloglevel_t level, char *fmt, va_list args)
static void output_cb(pmloglevel_t level, const char *fmt, va_list args)
{
if(strlen(fmt)) {
switch(level) {

View File

@ -24,7 +24,7 @@
#define BASENAME "testpkg"
static void output_cb(pmloglevel_t level, char *fmt, va_list args)
static void output_cb(pmloglevel_t level, const char *fmt, va_list args)
{
if(fmt[0] == '\0') {
return;