1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +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

@@ -667,7 +667,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
this->autocommit = autocommit;
PQsetNoticeReceiver(this->connection, &ECPGnoticeReceiver, (void *) this);
PQsetNoticeReceiver(this->connection, &ECPGnoticeReceiver, this);
return true;
}

View File

@@ -435,7 +435,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
/* allocate storage if needed */
if (arrsize == 0 && *(void **) var == NULL)
{
void *mem = (void *) ecpg_auto_alloc(offset * ntuples, lineno);
void *mem = ecpg_auto_alloc(offset * ntuples, lineno);
if (!mem)
{
@@ -540,7 +540,7 @@ ECPGget_desc(int lineno, const char *desc_name, int index,...)
/* allocate storage if needed */
if (data_var.ind_arrsize == 0 && data_var.ind_value == NULL)
{
void *mem = (void *) ecpg_auto_alloc(data_var.ind_offset * ntuples, lineno);
void *mem = ecpg_auto_alloc(data_var.ind_offset * ntuples, lineno);
if (!mem)
{

View File

@@ -100,7 +100,7 @@ set_auto_allocs(struct auto_mem *am)
char *
ecpg_auto_alloc(long size, int lineno)
{
void *ptr = (void *) ecpg_alloc(size, lineno);
void *ptr = ecpg_alloc(size, lineno);
if (!ptr)
return NULL;