mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +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:
@@ -1038,7 +1038,7 @@ hash_search_with_hash_value(HTAB *hashp,
|
||||
{
|
||||
case HASH_FIND:
|
||||
if (currBucket != NULL)
|
||||
return (void *) ELEMENTKEY(currBucket);
|
||||
return ELEMENTKEY(currBucket);
|
||||
return NULL;
|
||||
|
||||
case HASH_REMOVE:
|
||||
@@ -1067,7 +1067,7 @@ hash_search_with_hash_value(HTAB *hashp,
|
||||
* element, because someone else is going to reuse it the next
|
||||
* time something is added to the table
|
||||
*/
|
||||
return (void *) ELEMENTKEY(currBucket);
|
||||
return ELEMENTKEY(currBucket);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -1075,7 +1075,7 @@ hash_search_with_hash_value(HTAB *hashp,
|
||||
case HASH_ENTER_NULL:
|
||||
/* Return existing element if found, else create one */
|
||||
if (currBucket != NULL)
|
||||
return (void *) ELEMENTKEY(currBucket);
|
||||
return ELEMENTKEY(currBucket);
|
||||
|
||||
/* disallow inserts if frozen */
|
||||
if (hashp->frozen)
|
||||
@@ -1114,7 +1114,7 @@ hash_search_with_hash_value(HTAB *hashp,
|
||||
* caller's data structure.
|
||||
*/
|
||||
|
||||
return (void *) ELEMENTKEY(currBucket);
|
||||
return ELEMENTKEY(currBucket);
|
||||
}
|
||||
|
||||
elog(ERROR, "unrecognized hash action code: %d", (int) action);
|
||||
@@ -1453,7 +1453,7 @@ hash_seq_search(HASH_SEQ_STATUS *status)
|
||||
status->curEntry = curElem->link;
|
||||
if (status->curEntry == NULL) /* end of this bucket */
|
||||
++status->curBucket;
|
||||
return (void *) ELEMENTKEY(curElem);
|
||||
return ELEMENTKEY(curElem);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1507,7 +1507,7 @@ hash_seq_search(HASH_SEQ_STATUS *status)
|
||||
if (status->curEntry == NULL) /* end of this bucket */
|
||||
++curBucket;
|
||||
status->curBucket = curBucket;
|
||||
return (void *) ELEMENTKEY(curElem);
|
||||
return ELEMENTKEY(curElem);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user