Code cleanup: don't bother casting the argument to pfree() to void *
authorNeil Conway <neilc@samurai.com>
Mon, 27 Sep 2004 04:01:23 +0000 (04:01 +0000)
committerNeil Conway <neilc@samurai.com>
Mon, 27 Sep 2004 04:01:23 +0000 (04:01 +0000)
from another pointer type. Per C89, this is unnecessary, and it is common
practice throughout the rest of the tree anyway.

src/backend/access/nbtree/nbtsort.c
src/backend/commands/user.c

index 98cdccb3bac438864e683fdf81d0e5492040e67c..1bc73d13ff344013aba0267f4e5d63008e4067ec 100644 (file)
@@ -56,7 +56,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.88 2004/08/29 05:06:40 momjian Exp $
+ *       $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.89 2004/09/27 04:01:22 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -185,7 +185,7 @@ void
 _bt_spooldestroy(BTSpool *btspool)
 {
        tuplesort_end(btspool->sortstate);
-       pfree((void *) btspool);
+       pfree(btspool);
 }
 
 /*
@@ -551,7 +551,7 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, BTItem bti)
                ItemPointerSet(&(state->btps_minkey->bti_itup.t_tid),
                                           oblkno, P_HIKEY);
                _bt_buildadd(wstate, state->btps_next, state->btps_minkey);
-               pfree((void *) state->btps_minkey);
+               pfree(state->btps_minkey);
 
                /*
                 * Save a copy of the minimum key for the new page.  We have to
@@ -649,7 +649,7 @@ _bt_uppershutdown(BTWriteState *wstate, BTPageState *state)
                        ItemPointerSet(&(s->btps_minkey->bti_itup.t_tid),
                                                   blkno, P_HIKEY);
                        _bt_buildadd(wstate, s->btps_next, s->btps_minkey);
-                       pfree((void *) s->btps_minkey);
+                       pfree(s->btps_minkey);
                        s->btps_minkey = NULL;
                }
 
@@ -767,7 +767,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
                        {
                                _bt_buildadd(wstate, state, bti);
                                if (should_free)
-                                       pfree((void *) bti);
+                                       pfree(bti);
                                bti = (BTItem) tuplesort_getindextuple(btspool->sortstate,
                                                                                                         true, &should_free);
                        }
@@ -775,7 +775,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
                        {
                                _bt_buildadd(wstate, state, bti2);
                                if (should_free2)
-                                       pfree((void *) bti2);
+                                       pfree(bti2);
                                bti2 = (BTItem) tuplesort_getindextuple(btspool2->sortstate,
                                                                                                        true, &should_free2);
                        }
@@ -794,7 +794,7 @@ _bt_load(BTWriteState *wstate, BTSpool *btspool, BTSpool *btspool2)
 
                        _bt_buildadd(wstate, state, bti);
                        if (should_free)
-                               pfree((void *) bti);
+                               pfree(bti);
                }
        }
 
index 0221fe17e185283b7b2f24e938a1cd2034339144..c03800700e5abb0d277b1f7f22a1b817e184ba57 100644 (file)
@@ -6,7 +6,7 @@
  * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.145 2004/09/16 16:58:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.146 2004/09/27 04:01:23 neilc Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -282,8 +282,8 @@ write_group_file(Relation grel)
                                 errmsg("could not rename file \"%s\" to \"%s\": %m",
                                                tempname, filename)));
 
-       pfree((void *) tempname);
-       pfree((void *) filename);
+       pfree(tempname);
+       pfree(filename);
 }
 
 
@@ -412,8 +412,8 @@ write_user_file(Relation urel)
                                 errmsg("could not rename file \"%s\" to \"%s\": %m",
                                                tempname, filename)));
 
-       pfree((void *) tempname);
-       pfree((void *) filename);
+       pfree(tempname);
+       pfree(filename);
 }