mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Code cleanup: in C89, there is no point casting the first argument to
memset() or MemSet() to a char *. For one, memset()'s first argument is a void *, and further void * can be implicitly coerced to/from any other pointer type.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashovfl.c,v 1.45 2004/12/31 21:59:13 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashovfl.c,v 1.46 2005/05/11 01:26:01 neilc Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Overflow pages look like ordinary relation pages.
|
||||
@@ -509,7 +509,7 @@ _hash_initbitmap(Relation rel, HashMetaPage metap, BlockNumber blkno)
|
||||
|
||||
/* set all of the bits to 1 */
|
||||
freep = HashPageGetBitmap(pg);
|
||||
MemSet((char *) freep, 0xFF, BMPGSZ_BYTE(metap));
|
||||
MemSet(freep, 0xFF, BMPGSZ_BYTE(metap));
|
||||
|
||||
/* write out the new bitmap page (releasing write lock and pin) */
|
||||
_hash_wrtbuf(rel, buf);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.48 2005/05/10 05:15:07 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashpage.c,v 1.49 2005/05/11 01:26:01 neilc Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Postgres hash pages look like ordinary relation pages. The opaque
|
||||
@@ -295,8 +295,8 @@ _hash_metapinit(Relation rel)
|
||||
metap->hashm_maxbucket = metap->hashm_lowmask = 1; /* nbuckets - 1 */
|
||||
metap->hashm_highmask = 3; /* (nbuckets << 1) - 1 */
|
||||
|
||||
MemSet((char *) metap->hashm_spares, 0, sizeof(metap->hashm_spares));
|
||||
MemSet((char *) metap->hashm_mapp, 0, sizeof(metap->hashm_mapp));
|
||||
MemSet(metap->hashm_spares, 0, sizeof(metap->hashm_spares));
|
||||
MemSet(metap->hashm_mapp, 0, sizeof(metap->hashm_mapp));
|
||||
|
||||
metap->hashm_spares[1] = 1; /* the first bitmap page is only spare */
|
||||
metap->hashm_ovflpoint = 1;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashutil.c,v 1.41 2004/12/31 21:59:13 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashutil.c,v 1.42 2005/05/11 01:26:01 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -56,7 +56,7 @@ _hash_formitem(IndexTuple itup)
|
||||
(sizeof(HashItemData) - sizeof(IndexTupleData));
|
||||
|
||||
hitem = (HashItem) palloc(nbytes_hitem);
|
||||
memcpy((char *) &(hitem->hash_itup), (char *) itup, tuplen);
|
||||
memcpy(&(hitem->hash_itup), itup, tuplen);
|
||||
|
||||
return hitem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user