From: Daniel P. Berrange Date: Thu, 27 Sep 2012 13:04:21 +0000 (+0100) Subject: s/int/virLogDestination/ in logging code X-Git-Tag: v1.0.0-rc1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4764a6c5a351bfea0b3546499128af929efbe2aa;p=thirdparty%2Flibvirt.git s/int/virLogDestination/ in logging code The log destinations are an enum, but most of the code was just using a plain 'int' for function params / variables. Signed-off-by: Daniel P. Berrange --- diff --git a/src/util/logging.c b/src/util/logging.c index aaebdc3f5f..328d1f5185 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -564,7 +564,7 @@ static int virLogResetOutputs(void) { * Returns -1 in case of failure or the output number if successful */ int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c, void *data, - virLogPriority priority, int dest, const char *name, + virLogPriority priority, virLogDestination dest, const char *name, unsigned int flags) { int ret = -1; @@ -1139,7 +1139,7 @@ char *virLogGetOutputs(void) { virLogLock(); for (i = 0; i < virLogNbOutputs; i++) { - int dest = virLogOutputs[i].dest; + virLogDestination dest = virLogOutputs[i].dest; if (i) virBufferAsprintf(&outputbuf, " "); switch (dest) { diff --git a/src/util/logging.h b/src/util/logging.h index 818388ad82..ccf775cc68 100644 --- a/src/util/logging.h +++ b/src/util/logging.h @@ -125,7 +125,7 @@ extern void virLogSetFromEnv(void); extern int virLogDefineFilter(const char *match, virLogPriority priority, unsigned int flags); extern int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c, void *data, - virLogPriority priority, int dest, const char *name, + virLogPriority priority, virLogDestination dest, const char *name, unsigned int flags); /* diff --git a/tests/testutils.c b/tests/testutils.c index 82ebabf04d..eebe002c8e 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -610,7 +610,7 @@ int virtTestMain(int argc, virLogSetFromEnv(); if (!getenv("LIBVIRT_DEBUG") && !virLogGetNbOutputs()) { if (virLogDefineOutput(virtTestLogOutput, virtTestLogClose, &testLog, - VIR_LOG_DEBUG, 0, NULL, 0) < 0) + VIR_LOG_DEBUG, VIR_LOG_TO_STDERR, NULL, 0) < 0) return 1; }