mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Fix various compiler warnings about signed/unsigned types
This commit is contained in:
parent
f991089ce4
commit
b85e53cc7a
@ -1,3 +1,9 @@
|
|||||||
|
Thu Nov 16 18:16:42 EST 2006 Daniel Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/xml.c: Mark 'msg' parameter in XML error handler as unused.
|
||||||
|
Fix device id lookup code to use unsigned integers avoid type
|
||||||
|
mis-matches.
|
||||||
|
|
||||||
Thu Nov 16 13:09:42 EST 2006 Daniel Berrange <berrange@redhat.com>
|
Thu Nov 16 13:09:42 EST 2006 Daniel Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* src/Makefile.am: Added new xm_internal.c source file
|
* src/Makefile.am: Added new xm_internal.c source file
|
||||||
|
11
src/xml.c
11
src/xml.c
@ -920,12 +920,12 @@ virDomainParseXMLOSDescPV(xmlNodePtr node, virBufferPtr buf, xmlXPathContextPtr
|
|||||||
* error reporting.
|
* error reporting.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
virCatchXMLParseError(void *ctx, const char *msg, ...) {
|
virCatchXMLParseError(void *ctx, const char *msg ATTRIBUTE_UNUSED, ...) {
|
||||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||||
|
|
||||||
if ((ctxt != NULL) &&
|
if ((ctxt != NULL) &&
|
||||||
(ctxt->lastError.level == XML_ERR_FATAL) &&
|
(ctxt->lastError.level == XML_ERR_FATAL) &&
|
||||||
(ctxt->lastError.message != NULL)) {
|
(ctxt->lastError.message != NULL)) {
|
||||||
virXMLError(VIR_ERR_XML_DETAIL, ctxt->lastError.message,
|
virXMLError(VIR_ERR_XML_DETAIL, ctxt->lastError.message,
|
||||||
ctxt->lastError.line);
|
ctxt->lastError.line);
|
||||||
}
|
}
|
||||||
@ -1562,7 +1562,8 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
|
|||||||
xmlNodePtr node, cur;
|
xmlNodePtr node, cur;
|
||||||
xmlChar *attr = NULL;
|
xmlChar *attr = NULL;
|
||||||
char dir[80], path[128], **list = NULL, *mac = NULL;
|
char dir[80], path[128], **list = NULL, *mac = NULL;
|
||||||
int ret = 0, num, i, len;
|
int ret = 0;
|
||||||
|
unsigned int num, i, len;
|
||||||
|
|
||||||
xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
|
xml = xmlReadDoc((const xmlChar *) xmldesc, "domain.xml", NULL,
|
||||||
XML_PARSE_NOENT | XML_PARSE_NONET |
|
XML_PARSE_NOENT | XML_PARSE_NONET |
|
||||||
@ -1580,7 +1581,7 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
|
|||||||
attr = xmlGetProp(cur, BAD_CAST "dev");
|
attr = xmlGetProp(cur, BAD_CAST "dev");
|
||||||
if (attr == NULL)
|
if (attr == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
strcpy(ref, attr);
|
strcpy(ref, (char *)attr);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1606,7 +1607,7 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref)
|
|||||||
mac = xs_read(domain->conn->xshandle, 0, path, &len);
|
mac = xs_read(domain->conn->xshandle, 0, path, &len);
|
||||||
if (mac == NULL)
|
if (mac == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
if ((strlen(attr) != len) || memcmp(attr, mac, len)) {
|
if ((strlen((char*)attr) != len) || memcmp(attr, mac, len)) {
|
||||||
free(mac);
|
free(mac);
|
||||||
mac = NULL;
|
mac = NULL;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user