1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Remove useless casts to (void *) in arguments of some system functions

The affected functions are: bsearch, memcmp, memcpy, memset, memmove,
qsort, repalloc

Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com
This commit is contained in:
Peter Eisentraut
2023-02-07 06:53:05 +01:00
parent d9d7fe68d3
commit aa69541046
52 changed files with 116 additions and 119 deletions

View File

@ -319,7 +319,7 @@ _ltree_picksplit(PG_FUNCTION_ARGS)
size_beta = hemdist(datum_r, _j, siglen);
costvector[j - 1].cost = abs(size_alpha - size_beta);
}
qsort((void *) costvector, maxoff, sizeof(SPLITCOST), comparecost);
qsort(costvector, maxoff, sizeof(SPLITCOST), comparecost);
union_l = LTG_SIGN(datum_l);
union_r = LTG_SIGN(datum_r);
@ -348,7 +348,7 @@ _ltree_picksplit(PG_FUNCTION_ARGS)
if (LTG_ISALLTRUE(datum_l) || LTG_ISALLTRUE(_j))
{
if (!LTG_ISALLTRUE(datum_l))
memset((void *) union_l, 0xff, siglen);
memset(union_l, 0xff, siglen);
}
else
{
@ -364,7 +364,7 @@ _ltree_picksplit(PG_FUNCTION_ARGS)
if (LTG_ISALLTRUE(datum_r) || LTG_ISALLTRUE(_j))
{
if (!LTG_ISALLTRUE(datum_r))
memset((void *) union_r, 0xff, siglen);
memset(union_r, 0xff, siglen);
}
else
{

View File

@ -328,7 +328,7 @@ ltree_picksplit(PG_FUNCTION_ARGS)
array[j].r = LTG_GETLNODE(lu, siglen);
}
qsort((void *) &array[FirstOffsetNumber], maxoff - FirstOffsetNumber + 1,
qsort(&array[FirstOffsetNumber], maxoff - FirstOffsetNumber + 1,
sizeof(RIX), treekey_cmp);
lu_l = lu_r = ru_l = ru_r = NULL;

View File

@ -195,10 +195,10 @@ pushval_asis(QPRS_STATE *state, int type, char *strval, int lenval, uint16 flag)
int32 tmp = state->curop - state->op;
state->lenop *= 2;
state->op = (char *) repalloc((void *) state->op, state->lenop);
state->op = (char *) repalloc(state->op, state->lenop);
state->curop = state->op + tmp;
}
memcpy((void *) state->curop, (void *) strval, lenval);
memcpy(state->curop, strval, lenval);
state->curop += lenval;
*(state->curop) = '\0';
state->curop++;
@ -391,7 +391,7 @@ queryin(char *buf, struct Node *escontext)
}
/* set user-friendly operand view */
memcpy((void *) GETOPERAND(query), (void *) state.op, state.sumlen);
memcpy(GETOPERAND(query), state.op, state.sumlen);
pfree(state.op);
/* set left operand's position for every operator */