Skip site navigation (1) Skip section navigation (2)

remove obsolete NULL casts

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: remove obsolete NULL casts
Date: 2004-01-05 21:31:40
Message-ID: (view raw or whole thread)
Lists: pgsql-patches
In any modern dialect of C, casting the "NULL" pointer literal to a
specific pointer type is unnecessary. For example:

    char *foo;
    foo = malloc(...);
    if (foo == (char *) NULL) {...}

The cast on the 3rd line serves no useful purpose. Hence, this patch
removes all such instances of NULL-pointer casting from the
backend. I've attached it in gzip'ed format, as it is 145KB

Unless anyone objects, I intend to apply this within 48 hours.


Attachment: null-cast-cleanup-3.patch.gz
Description: application/octet-stream (23.7 KB)


pgsql-patches by date

Next:From: Neil ConwayDate: 2004-01-05 21:44:23
Subject: minor smgr code cleanup
Previous:From: Neil ConwayDate: 2004-01-05 21:24:39
Subject: add more exprs to CREATE SCHEMA

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group