mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
Fixed compiler warnings
This commit is contained in:
parent
f029721d2b
commit
0bd91c25c0
@ -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>
|
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,
|
* src/qemu_conf.c, src/qemu_conf.h, src/xm_internal.c,
|
||||||
|
@ -53,42 +53,42 @@ static int testCompareFiles(const char *xml, const char *sexpr, const char *name
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testComparePVversion1(void *data ATTRIBUTE_UNUSED) {
|
static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
||||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVversion1(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv.sexpr",
|
"xml2sexprdata/xml2sexpr-fv.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testComparePVversion2(void *data ATTRIBUTE_UNUSED) {
|
static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml",
|
||||||
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
"xml2sexprdata/xml2sexpr-pv.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVversion2(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-v2.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-v2.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVversion2VNC(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVversion2VNC(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-vncunused.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-vncunused.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-vncunused.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-vncunused.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testComparePVOrigVFB(void *data ATTRIBUTE_UNUSED) {
|
static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-orig.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-orig.xml",
|
||||||
"xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr",
|
"xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr",
|
||||||
"pvtest",
|
"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",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-new.xml",
|
||||||
"xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr",
|
"xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
3);
|
3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testComparePVBootloader(void *data ATTRIBUTE_UNUSED) {
|
static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-bootloader.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-pv-bootloader.xml",
|
||||||
"xml2sexprdata/xml2sexpr-pv-bootloader.sexpr",
|
"xml2sexprdata/xml2sexpr-pv-bootloader.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareDiskFile(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-file.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-file.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-file.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-file.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareDiskBlock(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-block.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-block.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareDiskDrvLoop(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareDiskDrvLoop(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-loop.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-loop.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareDiskDrvBlkback(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareDiskDrvBlkback(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blkback.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blkback.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareDiskDrvBlktap(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareDiskDrvBlktap(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
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",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
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",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml",
|
||||||
"xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr",
|
"xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareMemoryResize(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareMemoryResize(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-curmem.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-curmem.xml",
|
||||||
"xml2sexprdata/xml2sexpr-curmem.sexpr",
|
"xml2sexprdata/xml2sexpr-curmem.sexpr",
|
||||||
"rhel5",
|
"rhel5",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareNetRouted(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-net-routed.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-net-routed.xml",
|
||||||
"xml2sexprdata/xml2sexpr-net-routed.sexpr",
|
"xml2sexprdata/xml2sexpr-net-routed.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareNetBridged(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-net-bridged.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-net-bridged.xml",
|
||||||
"xml2sexprdata/xml2sexpr-net-bridged.sexpr",
|
"xml2sexprdata/xml2sexpr-net-bridged.sexpr",
|
||||||
"pvtest",
|
"pvtest",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareNoSourceCDRom(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-no-source-cdrom.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-no-source-cdrom.xml",
|
||||||
"xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr",
|
"xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr",
|
||||||
"test",
|
"test",
|
||||||
2);
|
2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVclockUTC(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-utc.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-utc.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-utc.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-utc.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVclockLocaltime(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-localtime.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-localtime.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-localtime.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-localtime.sexpr",
|
||||||
"fvtest",
|
"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",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbmouse.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
1);
|
1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int testCompareFVInputUSBTablet(void *data ATTRIBUTE_UNUSED) {
|
static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) {
|
||||||
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbtablet.xml",
|
return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbtablet.xml",
|
||||||
"xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr",
|
"xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr",
|
||||||
"fvtest",
|
"fvtest",
|
||||||
|
@ -32,7 +32,7 @@ static char *progname;
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testMethodPlusINT(void *data)
|
testMethodPlusINT(const void *data)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
|
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
|
||||||
@ -45,7 +45,7 @@ testMethodPlusINT(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testMethodPlusDOUBLE(void *data)
|
testMethodPlusDOUBLE(const void *data)
|
||||||
{
|
{
|
||||||
double retval = 0;
|
double retval = 0;
|
||||||
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
|
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
|
||||||
@ -127,7 +127,7 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testMarshalRequestINT(void *data)
|
testMarshalRequestINT(const void *data)
|
||||||
{
|
{
|
||||||
int num = INT_MAX;
|
int num = INT_MAX;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -144,7 +144,7 @@ testMarshalRequestINT(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testMarshalRequestSTRING(void *data ATTRIBUTE_UNUSED)
|
testMarshalRequestSTRING(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
const char *str = "This library will be really sexy.";
|
const char *str = "This library will be really sexy.";
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -160,7 +160,7 @@ testMarshalRequestSTRING(void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testMarshalRequestDOUBLE(void *data)
|
testMarshalRequestDOUBLE(const void *data)
|
||||||
{
|
{
|
||||||
double num = 123456789.123;
|
double num = 123456789.123;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
@ -177,7 +177,7 @@ testMarshalRequestDOUBLE(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testBufferStrcat(void *data ATTRIBUTE_UNUSED)
|
testBufferStrcat(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
|
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
|
||||||
int i;
|
int i;
|
||||||
@ -190,7 +190,7 @@ testBufferStrcat(void *data ATTRIBUTE_UNUSED)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testBufferVSprintf(void *data ATTRIBUTE_UNUSED)
|
testBufferVSprintf(const void *data ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
|
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
|
||||||
int i;
|
int i;
|
||||||
@ -230,11 +230,11 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virtTestRun("XML-RPC methodCall INT+INT",
|
if (virtTestRun("XML-RPC methodCall INT+INT",
|
||||||
NLOOPS, testMethodPlusINT, (void *) cxt) != 0)
|
NLOOPS, testMethodPlusINT, (const void *) cxt) != 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
if (virtTestRun("XML-RPC methodCall DOUBLE+DOUBLE",
|
if (virtTestRun("XML-RPC methodCall DOUBLE+DOUBLE",
|
||||||
NLOOPS, testMethodPlusDOUBLE, (void *) cxt) != 0)
|
NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
xmlRpcContextFree(cxt);
|
xmlRpcContextFree(cxt);
|
||||||
@ -243,14 +243,14 @@ main(int argc, char **argv)
|
|||||||
* regression / performance tests
|
* regression / performance tests
|
||||||
*/
|
*/
|
||||||
if (virtTestRun("XML-RPC request marshalling: INT (check)",
|
if (virtTestRun("XML-RPC request marshalling: INT (check)",
|
||||||
1, testMarshalRequestINT, (void *) &check) != 0)
|
1, testMarshalRequestINT, (const void *) &check) != 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
if (virtTestRun("XML-RPC request marshalling: INT",
|
if (virtTestRun("XML-RPC request marshalling: INT",
|
||||||
NLOOPS, testMarshalRequestINT, NULL) != 0)
|
NLOOPS, testMarshalRequestINT, NULL) != 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
if (virtTestRun("XML-RPC request marshalling: DOUBLE (check)",
|
if (virtTestRun("XML-RPC request marshalling: DOUBLE (check)",
|
||||||
1, testMarshalRequestDOUBLE, (void *) &check) != 0)
|
1, testMarshalRequestDOUBLE, (const void *) &check) != 0)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
if (virtTestRun("XML-RPC request marshalling: DOUBLE",
|
if (virtTestRun("XML-RPC request marshalling: DOUBLE",
|
||||||
NLOOPS, testMarshalRequestDOUBLE, NULL) != 0)
|
NLOOPS, testMarshalRequestDOUBLE, NULL) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user