Fixed compiler warnings

This commit is contained in:
Daniel P. Berrange 2007-07-18 21:13:26 +00:00
parent f029721d2b
commit 0bd91c25c0
3 changed files with 39 additions and 34 deletions

View File

@ -1,3 +1,8 @@
Wed Jul 18 17:11:08 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xmlrpctest.c, src/xml2sexprtest.c: More void * to
const void * conversions
Wed Jul 18 16:42:08 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/qemu_conf.c, src/qemu_conf.h, src/xm_internal.c,

View File

@ -53,42 +53,42 @@ static int testCompareFiles(const char *xml, const char *sexpr, const char *name
return ret;
}
static int testComparePVversion1(void *data ATTRIBUTE_UNUSED) {
static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
"xml2sexprdata/xml2sexpr-pv.sexpr",
"pvtest",
1);
}
static int testCompareFVversion1(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
"xml2sexprdata/xml2sexpr-fv.sexpr",
"fvtest",
1);
}
static int testComparePVversion2(void *data ATTRIBUTE_UNUSED) {
static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
"xml2sexprdata/xml2sexpr-pv.sexpr",
"pvtest",
2);
}
static int testCompareFVversion2(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
"xml2sexprdata/xml2sexpr-fv-v2.sexpr",
"fvtest",
2);
}
static int testCompareFVversion2VNC(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVversion2VNC(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-vncunused.xml",
"xml2sexprdata/xml2sexpr-fv-vncunused.sexpr",
"fvtest",
2);
}
static int testComparePVOrigVFB(void *data ATTRIBUTE_UNUSED) {
static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-orig.xml",
"xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr",
"pvtest",
@ -96,105 +96,105 @@ static int testComparePVOrigVFB(void *data ATTRIBUTE_UNUSED) {
}
static int testComparePVNewVFB(void *data ATTRIBUTE_UNUSED) {
static int testComparePVNewVFB(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-new.xml",
"xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr",
"pvtest",
3);
}
static int testComparePVBootloader(void *data ATTRIBUTE_UNUSED) {
static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-bootloader.xml",
"xml2sexprdata/xml2sexpr-pv-bootloader.sexpr",
"pvtest",
1);
}
static int testCompareDiskFile(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-file.xml",
"xml2sexprdata/xml2sexpr-disk-file.sexpr",
"pvtest",
2);
}
static int testCompareDiskBlock(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block.xml",
"xml2sexprdata/xml2sexpr-disk-block.sexpr",
"pvtest",
2);
}
static int testCompareDiskDrvLoop(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskDrvLoop(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-loop.xml",
"xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr",
"pvtest",
2);
}
static int testCompareDiskDrvBlkback(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskDrvBlkback(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blkback.xml",
"xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr",
"pvtest",
2);
}
static int testCompareDiskDrvBlktap(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskDrvBlktap(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap.xml",
"xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr",
"pvtest",
2);
}
static int testCompareDiskDrvBlktapQcow(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskDrvBlktapQcow(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml",
"xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr",
"pvtest",
2);
}
static int testCompareDiskDrvBlktapRaw(void *data ATTRIBUTE_UNUSED) {
static int testCompareDiskDrvBlktapRaw(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml",
"xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr",
"pvtest",
2);
}
static int testCompareMemoryResize(void *data ATTRIBUTE_UNUSED) {
static int testCompareMemoryResize(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-curmem.xml",
"xml2sexprdata/xml2sexpr-curmem.sexpr",
"rhel5",
2);
}
static int testCompareNetRouted(void *data ATTRIBUTE_UNUSED) {
static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-net-routed.xml",
"xml2sexprdata/xml2sexpr-net-routed.sexpr",
"pvtest",
2);
}
static int testCompareNetBridged(void *data ATTRIBUTE_UNUSED) {
static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-net-bridged.xml",
"xml2sexprdata/xml2sexpr-net-bridged.sexpr",
"pvtest",
2);
}
static int testCompareNoSourceCDRom(void *data ATTRIBUTE_UNUSED) {
static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-no-source-cdrom.xml",
"xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr",
"test",
2);
}
static int testCompareFVclockUTC(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-utc.xml",
"xml2sexprdata/xml2sexpr-fv-utc.sexpr",
"fvtest",
1);
}
static int testCompareFVclockLocaltime(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-localtime.xml",
"xml2sexprdata/xml2sexpr-fv-localtime.sexpr",
"fvtest",
@ -202,14 +202,14 @@ static int testCompareFVclockLocaltime(void *data ATTRIBUTE_UNUSED) {
}
static int testCompareFVInputUSBMouse(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVInputUSBMouse(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbmouse.xml",
"xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr",
"fvtest",
1);
}
static int testCompareFVInputUSBTablet(void *data ATTRIBUTE_UNUSED) {
static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) {
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbtablet.xml",
"xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr",
"fvtest",

View File

@ -32,7 +32,7 @@ static char *progname;
static int
testMethodPlusINT(void *data)
testMethodPlusINT(const void *data)
{
int retval = 0;
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
@ -45,7 +45,7 @@ testMethodPlusINT(void *data)
}
static int
testMethodPlusDOUBLE(void *data)
testMethodPlusDOUBLE(const void *data)
{
double retval = 0;
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
@ -127,7 +127,7 @@ error:
}
static int
testMarshalRequestINT(void *data)
testMarshalRequestINT(const void *data)
{
int num = INT_MAX;
int ret = 0;
@ -144,7 +144,7 @@ testMarshalRequestINT(void *data)
}
static int
testMarshalRequestSTRING(void *data ATTRIBUTE_UNUSED)
testMarshalRequestSTRING(const void *data ATTRIBUTE_UNUSED)
{
const char *str = "This library will be really sexy.";
int ret = 0;
@ -160,7 +160,7 @@ testMarshalRequestSTRING(void *data ATTRIBUTE_UNUSED)
}
static int
testMarshalRequestDOUBLE(void *data)
testMarshalRequestDOUBLE(const void *data)
{
double num = 123456789.123;
int ret = 0;
@ -177,7 +177,7 @@ testMarshalRequestDOUBLE(void *data)
}
static int
testBufferStrcat(void *data ATTRIBUTE_UNUSED)
testBufferStrcat(const void *data ATTRIBUTE_UNUSED)
{
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
int i;
@ -190,7 +190,7 @@ testBufferStrcat(void *data ATTRIBUTE_UNUSED)
}
static int
testBufferVSprintf(void *data ATTRIBUTE_UNUSED)
testBufferVSprintf(const void *data ATTRIBUTE_UNUSED)
{
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
int i;
@ -230,11 +230,11 @@ main(int argc, char **argv)
}
if (virtTestRun("XML-RPC methodCall INT+INT",
NLOOPS, testMethodPlusINT, (void *) cxt) != 0)
NLOOPS, testMethodPlusINT, (const void *) cxt) != 0)
ret = -1;
if (virtTestRun("XML-RPC methodCall DOUBLE+DOUBLE",
NLOOPS, testMethodPlusDOUBLE, (void *) cxt) != 0)
NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0)
ret = -1;
xmlRpcContextFree(cxt);
@ -243,14 +243,14 @@ main(int argc, char **argv)
* regression / performance tests
*/
if (virtTestRun("XML-RPC request marshalling: INT (check)",
1, testMarshalRequestINT, (void *) &check) != 0)
1, testMarshalRequestINT, (const void *) &check) != 0)
ret = -1;
if (virtTestRun("XML-RPC request marshalling: INT",
NLOOPS, testMarshalRequestINT, NULL) != 0)
ret = -1;
if (virtTestRun("XML-RPC request marshalling: DOUBLE (check)",
1, testMarshalRequestDOUBLE, (void *) &check) != 0)
1, testMarshalRequestDOUBLE, (const void *) &check) != 0)
ret = -1;
if (virtTestRun("XML-RPC request marshalling: DOUBLE",
NLOOPS, testMarshalRequestDOUBLE, NULL) != 0)