mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42: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:
@ -506,7 +506,7 @@ Datum
|
||||
_ltree_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
|
||||
void *query = (void *) PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
|
||||
void *query = PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
|
||||
StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
|
||||
|
||||
/* Oid subtype = PG_GETARG_OID(3); */
|
||||
|
@ -73,7 +73,7 @@ _ltree_isparent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
ArrayType *la = PG_GETARG_ARRAYTYPE_P(0);
|
||||
ltree *query = PG_GETARG_LTREE_P(1);
|
||||
bool res = array_iterator(la, ltree_isparent, (void *) query, NULL);
|
||||
bool res = array_iterator(la, ltree_isparent, query, NULL);
|
||||
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -94,7 +94,7 @@ _ltree_risparent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
ArrayType *la = PG_GETARG_ARRAYTYPE_P(0);
|
||||
ltree *query = PG_GETARG_LTREE_P(1);
|
||||
bool res = array_iterator(la, ltree_risparent, (void *) query, NULL);
|
||||
bool res = array_iterator(la, ltree_risparent, query, NULL);
|
||||
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -115,7 +115,7 @@ _ltq_regex(PG_FUNCTION_ARGS)
|
||||
{
|
||||
ArrayType *la = PG_GETARG_ARRAYTYPE_P(0);
|
||||
lquery *query = PG_GETARG_LQUERY_P(1);
|
||||
bool res = array_iterator(la, ltq_regex, (void *) query, NULL);
|
||||
bool res = array_iterator(la, ltq_regex, query, NULL);
|
||||
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -151,7 +151,7 @@ _lt_q_regex(PG_FUNCTION_ARGS)
|
||||
|
||||
while (num > 0)
|
||||
{
|
||||
if (array_iterator(_tree, ltq_regex, (void *) query, NULL))
|
||||
if (array_iterator(_tree, ltq_regex, query, NULL))
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
@ -180,7 +180,7 @@ _ltxtq_exec(PG_FUNCTION_ARGS)
|
||||
{
|
||||
ArrayType *la = PG_GETARG_ARRAYTYPE_P(0);
|
||||
ltxtquery *query = PG_GETARG_LTXTQUERY_P(1);
|
||||
bool res = array_iterator(la, ltxtq_exec, (void *) query, NULL);
|
||||
bool res = array_iterator(la, ltxtq_exec, query, NULL);
|
||||
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -205,7 +205,7 @@ _ltree_extract_isparent(PG_FUNCTION_ARGS)
|
||||
ltree *found,
|
||||
*item;
|
||||
|
||||
if (!array_iterator(la, ltree_isparent, (void *) query, &found))
|
||||
if (!array_iterator(la, ltree_isparent, query, &found))
|
||||
{
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -228,7 +228,7 @@ _ltree_extract_risparent(PG_FUNCTION_ARGS)
|
||||
ltree *found,
|
||||
*item;
|
||||
|
||||
if (!array_iterator(la, ltree_risparent, (void *) query, &found))
|
||||
if (!array_iterator(la, ltree_risparent, query, &found))
|
||||
{
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -251,7 +251,7 @@ _ltq_extract_regex(PG_FUNCTION_ARGS)
|
||||
ltree *found,
|
||||
*item;
|
||||
|
||||
if (!array_iterator(la, ltq_regex, (void *) query, &found))
|
||||
if (!array_iterator(la, ltq_regex, query, &found))
|
||||
{
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
@ -274,7 +274,7 @@ _ltxtq_extract_exec(PG_FUNCTION_ARGS)
|
||||
ltree *found,
|
||||
*item;
|
||||
|
||||
if (!array_iterator(la, ltxtq_exec, (void *) query, &found))
|
||||
if (!array_iterator(la, ltxtq_exec, query, &found))
|
||||
{
|
||||
PG_FREE_IF_COPY(la, 0);
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
|
Reference in New Issue
Block a user