1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-20 05:03:10 +03:00

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
This commit is contained in:
Peter Eisentraut
2024-11-28 08:19:22 +01:00
parent 97525bc5c8
commit 7f798aca1d
158 changed files with 491 additions and 550 deletions

View File

@ -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)
{