From 7f798aca1d5df290aafad41180baea0ae311b4ee Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 28 Nov 2024 08:19:22 +0100 Subject: Remove useless casts to (void *) Many of them just seem to have been copied around for no real reason. Their presence causes (small) risks of hiding actual type mismatches or silently discarding qualifiers Discussion: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862820@eisentraut.org --- src/backend/utils/adt/xml.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/backend/utils/adt/xml.c') diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 040a8962639..4ad5e04f48a 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -1226,7 +1226,7 @@ pg_xml_init(PgXmlStrictness strictness) errcxt->saved_errcxt = xmlGenericErrorContext; #endif - xmlSetStructuredErrorFunc((void *) errcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(errcxt, xml_errorHandler); /* * Verify that xmlSetStructuredErrorFunc set the context variable we @@ -1248,7 +1248,7 @@ pg_xml_init(PgXmlStrictness strictness) new_errcxt = xmlGenericErrorContext; #endif - if (new_errcxt != (void *) errcxt) + if (new_errcxt != errcxt) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("could not set up XML error handler"), @@ -1302,7 +1302,7 @@ pg_xml_done(PgXmlErrorContext *errcxt, bool isError) cur_errcxt = xmlGenericErrorContext; #endif - if (cur_errcxt != (void *) errcxt) + if (cur_errcxt != errcxt) elog(WARNING, "libxml error handling state is out of sync with xml.c"); /* Restore the saved handlers */ @@ -2197,7 +2197,7 @@ xml_errorHandler(void *data, PgXmlErrorPtr error) xmlGenericErrorFunc errFuncSaved = xmlGenericError; void *errCtxSaved = xmlGenericErrorContext; - xmlSetGenericErrorFunc((void *) errorBuf, + xmlSetGenericErrorFunc(errorBuf, (xmlGenericErrorFunc) appendStringInfo); /* Add context information to errorBuf */ @@ -4885,7 +4885,7 @@ XmlTableFetchRow(TableFuncScanState *state) xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableFetchRow"); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); if (xtCxt->xpathobj == NULL) { @@ -4939,7 +4939,7 @@ XmlTableGetValue(TableFuncScanState *state, int colnum, xtCxt->xpathobj->nodesetval != NULL); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); *isnull = false; @@ -5082,7 +5082,7 @@ XmlTableDestroyOpaque(TableFuncScanState *state) xtCxt = GetXmlTableBuilderPrivateData(state, "XmlTableDestroyOpaque"); /* Propagate our own error context to libxml2 */ - xmlSetStructuredErrorFunc((void *) xtCxt->xmlerrcxt, xml_errorHandler); + xmlSetStructuredErrorFunc(xtCxt->xmlerrcxt, xml_errorHandler); if (xtCxt->xpathscomp != NULL) { -- cgit v1.2.3