Cleanup some unnecessary void * casts when using pfree() in contrib/xml
and contrib/xml2
This commit is contained in:
parent
7069dbcc31
commit
04a1a24e9c
@ -47,7 +47,7 @@ pgxml_repalloc(void *ptr, size_t size)
|
|||||||
static void
|
static void
|
||||||
pgxml_pfree(void *ptr)
|
pgxml_pfree(void *ptr)
|
||||||
{
|
{
|
||||||
return pfree(ptr);
|
pfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -216,7 +216,7 @@ pgxml_xpath(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
elog(WARNING, "XPath syntax error");
|
elog(WARNING, "XPath syntax error");
|
||||||
xmlFreeDoc(doctree);
|
xmlFreeDoc(doctree);
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
PG_RETURN_NULL();
|
PG_RETURN_NULL();
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ pgxml_xpath(PG_FUNCTION_ARGS)
|
|||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
{
|
{
|
||||||
xmlFreeDoc(doctree);
|
xmlFreeDoc(doctree);
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
PG_RETURN_NULL(); /* seems appropriate */
|
PG_RETURN_NULL(); /* seems appropriate */
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ pgxml_xpath(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
/* Free various storage */
|
/* Free various storage */
|
||||||
xmlFreeDoc(doctree);
|
xmlFreeDoc(doctree);
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
xmlFree(xpresstr);
|
xmlFree(xpresstr);
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
PG_RETURN_TEXT_P(xpres);
|
PG_RETURN_TEXT_P(xpres);
|
||||||
|
@ -79,7 +79,7 @@ static void
|
|||||||
pgxml_pfree(void *ptr)
|
pgxml_pfree(void *ptr)
|
||||||
{
|
{
|
||||||
/* elog(DEBUG1,"Free in CMC %x",CurrentMemoryContext); */
|
/* elog(DEBUG1,"Free in CMC %x",CurrentMemoryContext); */
|
||||||
return pfree(ptr);
|
pfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -322,7 +322,7 @@ xpath_nodeset(PG_FUNCTION_ARGS)
|
|||||||
toptag, septag, NULL);
|
toptag, septag, NULL);
|
||||||
|
|
||||||
/* xmlCleanupParser(); done by result_to_text routine */
|
/* xmlCleanupParser(); done by result_to_text routine */
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
|
|
||||||
if (xpres == NULL)
|
if (xpres == NULL)
|
||||||
PG_RETURN_NULL();
|
PG_RETURN_NULL();
|
||||||
@ -358,7 +358,7 @@ xpath_list(PG_FUNCTION_ARGS)
|
|||||||
NULL, NULL, plainsep);
|
NULL, NULL, plainsep);
|
||||||
|
|
||||||
/* xmlCleanupParser(); done by result_to_text routine */
|
/* xmlCleanupParser(); done by result_to_text routine */
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
|
|
||||||
if (xpres == NULL)
|
if (xpres == NULL)
|
||||||
PG_RETURN_NULL();
|
PG_RETURN_NULL();
|
||||||
@ -399,7 +399,7 @@ xpath_string(PG_FUNCTION_ARGS)
|
|||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
xmlCleanupParser();
|
xmlCleanupParser();
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
|
|
||||||
if (xpres == NULL)
|
if (xpres == NULL)
|
||||||
PG_RETURN_NULL();
|
PG_RETURN_NULL();
|
||||||
@ -429,7 +429,7 @@ xpath_number(PG_FUNCTION_ARGS)
|
|||||||
xpath = pgxml_texttoxmlchar(xpathsupp);
|
xpath = pgxml_texttoxmlchar(xpathsupp);
|
||||||
|
|
||||||
res = pgxml_xpath(PG_GETARG_TEXT_P(0), xpath);
|
res = pgxml_xpath(PG_GETARG_TEXT_P(0), xpath);
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
|
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
{
|
{
|
||||||
@ -469,7 +469,7 @@ xpath_bool(PG_FUNCTION_ARGS)
|
|||||||
xpath = pgxml_texttoxmlchar(xpathsupp);
|
xpath = pgxml_texttoxmlchar(xpathsupp);
|
||||||
|
|
||||||
res = pgxml_xpath(PG_GETARG_TEXT_P(0), xpath);
|
res = pgxml_xpath(PG_GETARG_TEXT_P(0), xpath);
|
||||||
pfree((void *) xpath);
|
pfree(xpath);
|
||||||
|
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user