Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0ed07d4

Browse files
author
Neil Conway
committed
Code cleanup: don't bother casting the argument to pfree() to void *
from another pointer type. Per C89, this is unnecessary, and it is common practice throughout the rest of the tree anyway.
1 parent 93371ed commit 0ed07d4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/backend/access/nbtree/nbtsort.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
* Portions Copyright (c) 1994, Regents of the University of California
5757
*
5858
* IDENTIFICATION
59-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.88 2004/08/29 05:06:40 momjian Exp $
59+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.89 2004/09/27 04:01:22 neilc Exp $
6060
*
6161
*-------------------------------------------------------------------------
6262
*/
@@ -185,7 +185,7 @@ void
185185
_bt_spooldestroy(BTSpool *btspool)
186186
{
187187
tuplesort_end(btspool->sortstate);
188-
pfree((void *) btspool);
188+
pfree(btspool);
189189
}
190190

191191
/*
@@ -551,7 +551,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, BTItem bti)
551551
ItemPointerSet(&(state->btps_minkey->bti_itup.t_tid),
552552
oblkno, P_HIKEY);
553553
_bt_buildadd(wstate, state->btps_next, state->btps_minkey);
554-
pfree((void *) state->btps_minkey);
554+
pfree(state->btps_minkey);
555555

556556
/*
557557
* Save a copy of the minimum key for the new page. We have to
@@ -649,7 +649,7 @@ _bt_uppershutdown(BTWriteState *wstate, BTPageState *state)
649649
ItemPointerSet(&(s->btps_minkey->bti_itup.t_tid),
650650
blkno, P_HIKEY);
651651
_bt_buildadd(wstate, s->btps_next, s->btps_minkey);
652-
pfree((void *) s->btps_minkey);
652+
pfree(s->btps_minkey);
653653
s->btps_minkey = NULL;
654654
}
655655

@@ -767,15 +767,15 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
767767
{
768768
_bt_buildadd(wstate, state, bti);
769769
if (should_free)
770-
pfree((void *) bti);
770+
pfree(bti);
771771
bti = (BTItem) tuplesort_getindextuple(btspool->sortstate,
772772
true, &should_free);
773773
}
774774
else
775775
{
776776
_bt_buildadd(wstate, state, bti2);
777777
if (should_free2)
778-
pfree((void *) bti2);
778+
pfree(bti2);
779779
bti2 = (BTItem) tuplesort_getindextuple(btspool2->sortstate,
780780
true, &should_free2);
781781
}
@@ -794,7 +794,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
794794

795795
_bt_buildadd(wstate, state, bti);
796796
if (should_free)
797-
pfree((void *) bti);
797+
pfree(bti);
798798
}
799799
}
800800

src/backend/commands/user.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.145 2004/09/16 16:58:28 tgl Exp $
9+
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.146 2004/09/27 04:01:23 neilc Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -282,8 +282,8 @@ write_group_file(Relation grel)
282282
errmsg("could not rename file \"%s\" to \"%s\": %m",
283283
tempname, filename)));
284284

285-
pfree((void *) tempname);
286-
pfree((void *) filename);
285+
pfree(tempname);
286+
pfree(filename);
287287
}
288288

289289

@@ -412,8 +412,8 @@ write_user_file(Relation urel)
412412
errmsg("could not rename file \"%s\" to \"%s\": %m",
413413
tempname, filename)));
414414

415-
pfree((void *) tempname);
416-
pfree((void *) filename);
415+
pfree(tempname);
416+
pfree(filename);
417417
}
418418

419419

0 commit comments

Comments
 (0)