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

[PATCH] Cleanup: Compare pointers to NULL instead of 0

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Cleanup: Compare pointers to NULL instead of 0
Date: 2010-10-29 16:25:03
Message-ID: AANLkTikaTU8tkwPCAUU8DwVQh3hWVuRbbEQDfrXDBqNW@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Coccinelle found a few places in the code where pointer expressions
were compared to 0. I have changed them to NULL instead.

There was one line that I didn't dare to touch, which looks like a
false positive.

src/backend/regex/regc_lex.c:849:
if (v->now - save == 0 || ((int) c > 0 && (int) c <= v->nsubexp))

I couldn't find the definition of v (struct vars) anywhere. Is it
comparing two pointers here? Should it be "v->now == save" instead?

But this code doesn't originate from PostgreSQL, so maybe it's not
worth making cleanups here.

Regards,
Marti

Attachment: 0001-Cleanup-Compare-pointers-to-NULL-instead-of-0.patch
Description: text/x-patch (3.6 KB)

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-10-29 16:53:30
Subject: Re: plan time of MASSIVE partitioning ...
Previous:From: Tom LaneDate: 2010-10-29 15:54:52
Subject: Re: crash in plancache with subtransactions

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