From 4a814588b5e67a27ca2347caafa2531049c6b4f5 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 4 Mar 2014 09:22:20 +0100 Subject: [PATCH] Fix compilation with Visual Studio. --- coreapi/xml2lpc.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/coreapi/xml2lpc.c b/coreapi/xml2lpc.c index d02133674..bacc7d4ba 100644 --- a/coreapi/xml2lpc.c +++ b/coreapi/xml2lpc.c @@ -221,21 +221,27 @@ static int processDoc(xmlNode *node, xml2lpc_context *ctx) { } static int internal_convert_xml2lpc(xml2lpc_context *ctx) { + xmlNode *rootNode; + int ret; + xml2lpc_log(ctx, XML2LPC_DEBUG, "Parse started"); - xmlNode *rootNode = xmlDocGetRootElement(ctx->doc); + rootNode = xmlDocGetRootElement(ctx->doc); //dumpNodes(0, rootNode, cbf, ctx); - int ret = processDoc(rootNode, ctx); + ret = processDoc(rootNode, ctx); xml2lpc_log(ctx, XML2LPC_DEBUG, "Parse ended ret:%d", ret); return ret; } int xml2lpc_validate(xml2lpc_context *xmlCtx) { - xml2lpc_context_clear_logs(xmlCtx); xmlSchemaValidCtxtPtr validCtx; - xmlSchemaParserCtxtPtr parserCtx = xmlSchemaNewDocParserCtxt(xmlCtx->xsd); + xmlSchemaParserCtxtPtr parserCtx; + int ret; + + xml2lpc_context_clear_logs(xmlCtx); + parserCtx = xmlSchemaNewDocParserCtxt(xmlCtx->xsd); validCtx = xmlSchemaNewValidCtxt(xmlSchemaParse(parserCtx)); xmlSchemaSetValidErrors(validCtx, xml2lpc_genericxml_error, xml2lpc_genericxml_warning, xmlCtx); - int ret = xmlSchemaValidateDoc(validCtx, xmlCtx->doc); + ret = xmlSchemaValidateDoc(validCtx, xmlCtx->doc); if(ret > 0) { if(strlen(xmlCtx->warningBuffer) > 0) xml2lpc_log(xmlCtx, XML2LPC_WARNING, "%s", xmlCtx->warningBuffer);