From 2dd77cd1ffee942b3bb3ba76ba743b20b599f4a3 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 27 Sep 2012 14:00:21 +0100 Subject: [PATCH] s/long long/size_t/ for file line numbers in logging code The __LINE__ macro value is specified to fit in the size_t type, so use that instead of 'long long' in the logging code Signed-off-by: Daniel P. Berrange --- src/util/logging.c | 14 +++++++------- src/util/logging.h | 6 +++--- tests/testutils.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/util/logging.c b/src/util/logging.c index 4222b92bb8..aaebdc3f5f 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -99,7 +99,7 @@ static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT; static int virLogResetFilters(void); static int virLogResetOutputs(void); static void virLogOutputToFd(const char *category, virLogPriority priority, - const char *funcname, long long linenr, + const char *funcname, int linenr, const char *timestamp, unsigned int flags, const char *rawstr, const char *str, @@ -605,7 +605,7 @@ cleanup: static int virLogFormatString(char **msg, const char *funcname, - long long linenr, + int linenr, virLogPriority priority, const char *str) { @@ -619,7 +619,7 @@ virLogFormatString(char **msg, * to just grep for it to find the right place. */ if ((funcname != NULL)) { - ret = virAsprintf(msg, "%d: %s : %s:%lld : %s\n", + ret = virAsprintf(msg, "%d: %s : %s:%d : %s\n", virThreadSelfID(), virLogPriorityString(priority), funcname, linenr, str); } else { @@ -664,7 +664,7 @@ virLogVersionString(const char **rawmsg, char **msg) * the message may be stored, sent to output or just discarded */ void virLogMessage(const char *category, virLogPriority priority, const char *funcname, - long long linenr, unsigned int flags, const char *fmt, ...) + int linenr, unsigned int flags, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -686,7 +686,7 @@ void virLogMessage(const char *category, virLogPriority priority, const char *fu * the message may be stored, sent to output or just discarded */ void virLogVMessage(const char *category, virLogPriority priority, const char *funcname, - long long linenr, unsigned int flags, const char *fmt, + int linenr, unsigned int flags, const char *fmt, va_list vargs) { static bool logVersionStderr = true; @@ -813,7 +813,7 @@ static void virLogStackTraceToFd(int fd) static void virLogOutputToFd(const char *category ATTRIBUTE_UNUSED, virLogPriority priority ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, - long long linenr ATTRIBUTE_UNUSED, + int linenr ATTRIBUTE_UNUSED, const char *timestamp, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, @@ -885,7 +885,7 @@ static int virLogPrioritySyslog(virLogPriority priority) static void virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED, virLogPriority priority, const char *funcname ATTRIBUTE_UNUSED, - long long linenr ATTRIBUTE_UNUSED, + int linenr ATTRIBUTE_UNUSED, const char *timestamp ATTRIBUTE_UNUSED, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, diff --git a/src/util/logging.h b/src/util/logging.h index 88fb7859a8..818388ad82 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -97,7 +97,7 @@ typedef enum { * Callback function used to output messages */ typedef void (*virLogOutputFunc) (const char *category, virLogPriority priority, - const char *funcname, long long linenr, + const char *funcname, int linenr, const char *timestamp, unsigned int flags, const char *rawstr, const char *str, @@ -139,11 +139,11 @@ extern int virLogParseDefaultPriority(const char *priority); extern int virLogParseFilters(const char *filters); extern int virLogParseOutputs(const char *output); extern void virLogMessage(const char *category, virLogPriority priority, - const char *funcname, long long linenr, + const char *funcname, int linenr, unsigned int flags, const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7); extern void virLogVMessage(const char *category, virLogPriority priority, - const char *funcname, long long linenr, + const char *funcname, int linenr, unsigned int flags, const char *fmt, va_list vargs) ATTRIBUTE_FMT_PRINTF(6, 0); diff --git a/tests/testutils.c b/tests/testutils.c index 86be3f5df6..82ebabf04d 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -483,7 +483,7 @@ static void virtTestLogOutput(const char *category ATTRIBUTE_UNUSED, virLogPriority priority ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED, - long long lineno ATTRIBUTE_UNUSED, + int linenr ATTRIBUTE_UNUSED, const char *timestamp, unsigned int flags, const char *rawstr ATTRIBUTE_UNUSED, -- GitLab