提交 2dd77cd1 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 de29867e
...@@ -99,7 +99,7 @@ static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT; ...@@ -99,7 +99,7 @@ static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT;
static int virLogResetFilters(void); static int virLogResetFilters(void);
static int virLogResetOutputs(void); static int virLogResetOutputs(void);
static void virLogOutputToFd(const char *category, virLogPriority priority, static void virLogOutputToFd(const char *category, virLogPriority priority,
const char *funcname, long long linenr, const char *funcname, int linenr,
const char *timestamp, const char *timestamp,
unsigned int flags, unsigned int flags,
const char *rawstr, const char *str, const char *rawstr, const char *str,
...@@ -605,7 +605,7 @@ cleanup: ...@@ -605,7 +605,7 @@ cleanup:
static int static int
virLogFormatString(char **msg, virLogFormatString(char **msg,
const char *funcname, const char *funcname,
long long linenr, int linenr,
virLogPriority priority, virLogPriority priority,
const char *str) const char *str)
{ {
...@@ -619,7 +619,7 @@ virLogFormatString(char **msg, ...@@ -619,7 +619,7 @@ virLogFormatString(char **msg,
* to just grep for it to find the right place. * to just grep for it to find the right place.
*/ */
if ((funcname != NULL)) { if ((funcname != NULL)) {
ret = virAsprintf(msg, "%d: %s : %s:%lld : %s\n", ret = virAsprintf(msg, "%d: %s : %s:%d : %s\n",
virThreadSelfID(), virLogPriorityString(priority), virThreadSelfID(), virLogPriorityString(priority),
funcname, linenr, str); funcname, linenr, str);
} else { } else {
...@@ -664,7 +664,7 @@ virLogVersionString(const char **rawmsg, char **msg) ...@@ -664,7 +664,7 @@ virLogVersionString(const char **rawmsg, char **msg)
* the message may be stored, sent to output or just discarded * the message may be stored, sent to output or just discarded
*/ */
void virLogMessage(const char *category, virLogPriority priority, const char *funcname, 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_list ap;
va_start(ap, fmt); va_start(ap, fmt);
...@@ -686,7 +686,7 @@ void virLogMessage(const char *category, virLogPriority priority, const char *fu ...@@ -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 * the message may be stored, sent to output or just discarded
*/ */
void virLogVMessage(const char *category, virLogPriority priority, const char *funcname, 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) va_list vargs)
{ {
static bool logVersionStderr = true; static bool logVersionStderr = true;
...@@ -813,7 +813,7 @@ static void virLogStackTraceToFd(int fd) ...@@ -813,7 +813,7 @@ static void virLogStackTraceToFd(int fd)
static void virLogOutputToFd(const char *category ATTRIBUTE_UNUSED, static void virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
virLogPriority priority ATTRIBUTE_UNUSED, virLogPriority priority ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED, int linenr ATTRIBUTE_UNUSED,
const char *timestamp, const char *timestamp,
unsigned int flags, unsigned int flags,
const char *rawstr ATTRIBUTE_UNUSED, const char *rawstr ATTRIBUTE_UNUSED,
...@@ -885,7 +885,7 @@ static int virLogPrioritySyslog(virLogPriority priority) ...@@ -885,7 +885,7 @@ static int virLogPrioritySyslog(virLogPriority priority)
static void virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED, static void virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED,
virLogPriority priority, virLogPriority priority,
const char *funcname ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED, int linenr ATTRIBUTE_UNUSED,
const char *timestamp ATTRIBUTE_UNUSED, const char *timestamp ATTRIBUTE_UNUSED,
unsigned int flags, unsigned int flags,
const char *rawstr ATTRIBUTE_UNUSED, const char *rawstr ATTRIBUTE_UNUSED,
......
...@@ -97,7 +97,7 @@ typedef enum { ...@@ -97,7 +97,7 @@ typedef enum {
* Callback function used to output messages * Callback function used to output messages
*/ */
typedef void (*virLogOutputFunc) (const char *category, virLogPriority priority, typedef void (*virLogOutputFunc) (const char *category, virLogPriority priority,
const char *funcname, long long linenr, const char *funcname, int linenr,
const char *timestamp, const char *timestamp,
unsigned int flags, unsigned int flags,
const char *rawstr, const char *str, const char *rawstr, const char *str,
...@@ -139,11 +139,11 @@ extern int virLogParseDefaultPriority(const char *priority); ...@@ -139,11 +139,11 @@ extern int virLogParseDefaultPriority(const char *priority);
extern int virLogParseFilters(const char *filters); extern int virLogParseFilters(const char *filters);
extern int virLogParseOutputs(const char *output); extern int virLogParseOutputs(const char *output);
extern void virLogMessage(const char *category, virLogPriority priority, extern void virLogMessage(const char *category, virLogPriority priority,
const char *funcname, long long linenr, const char *funcname, int linenr,
unsigned int flags, unsigned int flags,
const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7); const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(6, 7);
extern void virLogVMessage(const char *category, virLogPriority priority, extern void virLogVMessage(const char *category, virLogPriority priority,
const char *funcname, long long linenr, const char *funcname, int linenr,
unsigned int flags, unsigned int flags,
const char *fmt, const char *fmt,
va_list vargs) ATTRIBUTE_FMT_PRINTF(6, 0); va_list vargs) ATTRIBUTE_FMT_PRINTF(6, 0);
......
...@@ -483,7 +483,7 @@ static void ...@@ -483,7 +483,7 @@ static void
virtTestLogOutput(const char *category ATTRIBUTE_UNUSED, virtTestLogOutput(const char *category ATTRIBUTE_UNUSED,
virLogPriority priority ATTRIBUTE_UNUSED, virLogPriority priority ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED, const char *funcname ATTRIBUTE_UNUSED,
long long lineno ATTRIBUTE_UNUSED, int linenr ATTRIBUTE_UNUSED,
const char *timestamp, const char *timestamp,
unsigned int flags, unsigned int flags,
const char *rawstr ATTRIBUTE_UNUSED, const char *rawstr ATTRIBUTE_UNUSED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册