mingw: Don't use interface as an identifier

Because it's a define used in MSCOM and its usage as
identifier results in a compile error.
This commit is contained in:
Matthias Bolte 2011-09-06 15:43:15 +02:00
parent dc675f3789
commit a6e2ef732d

View File

@ -1256,9 +1256,8 @@ static const vshCmdOptDef opts_domif_setlink[] = {
static bool static bool
cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd) cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
{ {
virDomainPtr dom; virDomainPtr dom;
const char *interface; const char *iface;
const char *state; const char *state;
const char *mac; const char *mac;
const char *desc; const char *desc;
@ -1266,21 +1265,19 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
bool ret = false; bool ret = false;
unsigned int flags = 0; unsigned int flags = 0;
int i; int i;
xmlDocPtr xml = NULL; xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL; xmlXPathContextPtr ctxt = NULL;
xmlXPathObjectPtr obj = NULL; xmlXPathObjectPtr obj = NULL;
xmlNodePtr cur = NULL; xmlNodePtr cur = NULL;
xmlBufferPtr xml_buf = NULL; xmlBufferPtr xml_buf = NULL;
if (!vshConnectionUsability(ctl, ctl->conn)) if (!vshConnectionUsability(ctl, ctl->conn))
return false; return false;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false; return false;
if (vshCommandOptString(cmd, "interface", &interface) <= 0) if (vshCommandOptString(cmd, "interface", &iface) <= 0)
goto cleanup; goto cleanup;
if (vshCommandOptString(cmd, "state", &state) <= 0) if (vshCommandOptString(cmd, "state", &state) <= 0)
@ -1332,7 +1329,7 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
xmlStrEqual(cur->name, BAD_CAST "mac")) { xmlStrEqual(cur->name, BAD_CAST "mac")) {
mac = virXMLPropString(cur, "address"); mac = virXMLPropString(cur, "address");
if (STRCASEEQ(mac, interface)) { if (STRCASEEQ(mac, iface)) {
VIR_FREE(mac); VIR_FREE(mac);
goto hit; goto hit;
} }
@ -1342,7 +1339,7 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
} }
} }
vshError(ctl, _("interface with address '%s' not found"), interface); vshError(ctl, _("interface with address '%s' not found"), iface);
goto cleanup; goto cleanup;
hit: hit:
@ -1424,13 +1421,12 @@ static bool
cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd) cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
{ {
virDomainPtr dom; virDomainPtr dom;
const char *interface = NULL; const char *iface = NULL;
int flags = 0; int flags = 0;
char *state = NULL; char *state = NULL;
char *mac = NULL; char *mac = NULL;
bool ret = false; bool ret = false;
int i; int i;
char *desc; char *desc;
xmlDocPtr xml = NULL; xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL; xmlXPathContextPtr ctxt = NULL;
@ -1443,7 +1439,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain (ctl, cmd, NULL))) if (!(dom = vshCommandOptDomain (ctl, cmd, NULL)))
return false; return false;
if (vshCommandOptString (cmd, "interface", &interface) <= 0) { if (vshCommandOptString (cmd, "interface", &iface) <= 0) {
virDomainFree(dom); virDomainFree(dom);
return false; return false;
} }
@ -1481,7 +1477,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
mac = virXMLPropString(cur, "address"); mac = virXMLPropString(cur, "address");
if (STRCASEEQ(mac, interface)){ if (STRCASEEQ(mac, iface)){
VIR_FREE(mac); VIR_FREE(mac);
goto hit; goto hit;
} }
@ -1490,7 +1486,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
} }
} }
vshError(ctl, _("Interface with address '%s' not found."), interface); vshError(ctl, _("Interface with address '%s' not found."), iface);
goto cleanup; goto cleanup;
hit: hit:
@ -1500,7 +1496,7 @@ hit:
xmlStrEqual(cur->name, BAD_CAST "link")) { xmlStrEqual(cur->name, BAD_CAST "link")) {
state = virXMLPropString(cur, "state"); state = virXMLPropString(cur, "state");
vshPrint(ctl, "%s %s", interface, state); vshPrint(ctl, "%s %s", iface, state);
VIR_FREE(state); VIR_FREE(state);
goto cleanup; goto cleanup;
@ -1509,7 +1505,7 @@ hit:
} }
/* attribute not found */ /* attribute not found */
vshPrint(ctl, "%s default", interface); vshPrint(ctl, "%s default", iface);
cleanup: cleanup:
xmlXPathFreeObject(obj); xmlXPathFreeObject(obj);