static xpath_workspace *pgxml_xpath(text *document, xmlChar *xpath,
PgXmlErrorContext *xmlerrcxt);
-static void cleanup_workspace(volatile xpath_workspace *workspace);
+static void cleanup_workspace(xpath_workspace *workspace);
/*
xml_encode_special_chars(PG_FUNCTION_ARGS)
{
text *tin = PG_GETARG_TEXT_PP(0);
- text *tout;
- volatile xmlChar *tt = NULL;
+ text *volatile tout = NULL;
+ xmlChar *volatile tt = NULL;
PgXmlErrorContext *xmlerrcxt;
xmlerrcxt = pg_xml_init(PG_XML_STRICTNESS_ALL);
PG_CATCH();
{
if (tt != NULL)
- xmlFree((xmlChar *) tt);
+ xmlFree(tt);
pg_xml_done(xmlerrcxt, true);
PG_END_TRY();
if (tt != NULL)
- xmlFree((xmlChar *) tt);
+ xmlFree(tt);
pg_xml_done(xmlerrcxt, false);
xmlChar *plainsep)
{
volatile xmlBufferPtr buf = NULL;
- xmlChar *result;
- int i;
+ xmlChar *volatile result = NULL;
PgXmlErrorContext *xmlerrcxt;
- /* spin some error handling */
+ /* spin up some error handling */
xmlerrcxt = pg_xml_init(PG_XML_STRICTNESS_ALL);
PG_TRY();
}
if (nodeset != NULL)
{
- for (i = 0; i < nodeset->nodeNr; i++)
+ for (int i = 0; i < nodeset->nodeNr; i++)
{
if (plainsep != NULL)
{
xmlChar *toptag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2));
xmlChar *septag = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(3));
xmlChar *xpath;
- text *xpres;
- volatile xpath_workspace *workspace;
+ text *volatile xpres = NULL;
+ xpath_workspace *volatile workspace = NULL;
PgXmlErrorContext *xmlerrcxt;
xpath = pgxml_texttoxmlchar(xpathsupp);
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
xmlChar *plainsep = pgxml_texttoxmlchar(PG_GETARG_TEXT_PP(2));
xmlChar *xpath;
- text *xpres;
- volatile xpath_workspace *workspace;
+ text *volatile xpres = NULL;
+ xpath_workspace *volatile workspace = NULL;
PgXmlErrorContext *xmlerrcxt;
xpath = pgxml_texttoxmlchar(xpathsupp);
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
xmlChar *xpath;
int32 pathsize;
- text *xpres;
- volatile xpath_workspace *workspace;
+ text *volatile xpres = NULL;
+ xpath_workspace *volatile workspace = NULL;
PgXmlErrorContext *xmlerrcxt;
pathsize = VARSIZE_ANY_EXHDR(xpathsupp);
text *document = PG_GETARG_TEXT_PP(0);
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
xmlChar *xpath;
- float4 fRes = 0.0;
- bool isNull = false;
- volatile xpath_workspace *workspace = NULL;
+ volatile float4 fRes = 0.0;
+ volatile bool isNull = false;
+ xpath_workspace *volatile workspace = NULL;
PgXmlErrorContext *xmlerrcxt;
xpath = pgxml_texttoxmlchar(xpathsupp);
text *document = PG_GETARG_TEXT_PP(0);
text *xpathsupp = PG_GETARG_TEXT_PP(1); /* XPath expression */
xmlChar *xpath;
- int bRes;
- volatile xpath_workspace *workspace = NULL;
+ volatile int bRes = 0;
+ xpath_workspace *volatile workspace = NULL;
PgXmlErrorContext *xmlerrcxt;
xpath = pgxml_texttoxmlchar(xpathsupp);
/* Clean up after processing the result of pgxml_xpath() */
static void
-cleanup_workspace(volatile xpath_workspace *workspace)
+cleanup_workspace(xpath_workspace *workspace)
{
if (workspace->res)
xmlXPathFreeObject(workspace->res);
xmlChar *septag,
xmlChar *plainsep)
{
- volatile xmlChar *xpresstr = NULL;
+ xmlChar *volatile xpresstr = NULL;
+ text *volatile xpres = NULL;
PgXmlErrorContext *xmlerrcxt;
- text *xpres;
if (res == NULL)
return NULL;
PG_CATCH();
{
if (xpresstr != NULL)
- xmlFree((xmlChar *) xpresstr);
+ xmlFree(xpresstr);
pg_xml_done(xmlerrcxt, true);
PG_END_TRY();
/* Free various storage */
- xmlFree((xmlChar *) xpresstr);
+ xmlFree(xpresstr);
pg_xml_done(xmlerrcxt, false);
text *doct = PG_GETARG_TEXT_PP(0);
text *ssheet = PG_GETARG_TEXT_PP(1);
- text *result;
+ text *volatile result = NULL;
text *paramstr;
const char **params;
PgXmlErrorContext *xmlerrcxt;
volatile xsltSecurityPrefsPtr xslt_sec_prefs = NULL;
volatile xsltTransformContextPtr xslt_ctxt = NULL;
volatile int resstat = -1;
- volatile xmlChar *resstr = NULL;
- int reslen = 0;
+ xmlChar *volatile resstr = NULL;
if (fcinfo->nargs == 3)
{
{
xmlDocPtr ssdoc;
bool xslt_sec_prefs_error;
+ int reslen = 0;
/* Parse document */
doctree = xmlReadMemory((char *) VARDATA_ANY(doct),
if (doctree != NULL)
xmlFreeDoc(doctree);
if (resstr != NULL)
- xmlFree((xmlChar *) resstr);
+ xmlFree(resstr);
xsltCleanupGlobals();
pg_xml_done(xmlerrcxt, true);
xsltCleanupGlobals();
if (resstr)
- xmlFree((xmlChar *) resstr);
+ xmlFree(resstr);
pg_xml_done(xmlerrcxt, false);