diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2024-11-28 08:19:22 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2024-11-28 08:27:20 +0100 |
commit | 7f798aca1d5df290aafad41180baea0ae311b4ee (patch) | |
tree | b4c8132ec85c21f6c72308b5857defd70958de69 /src/backend/utils/adt/xml.c | |
parent | 97525bc5c8ffb31475d23955d08e9ec9c1408f33 (diff) | |
download | postgresql-7f798aca1d5df290aafad41180baea0ae311b4ee.tar.gz postgresql-7f798aca1d5df290aafad41180baea0ae311b4ee.zip |
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
Diffstat (limited to 'src/backend/utils/adt/xml.c')
-rw-r--r-- | src/backend/utils/adt/xml.c | 14 |
1 files changed, 7 insertions, 7 deletions
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) { |