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

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема [PATCH] Cleanup: Compare pointers to NULL instead of 0
Дата
Msg-id AANLkTikaTU8tkwPCAUU8DwVQh3hWVuRbbEQDfrXDBqNW@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Cleanup: Compare pointers to NULL instead of 0  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Cleanup: Compare pointers to NULL instead of 0  (Alvaro Herrera <alvherre@commandprompt.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: crash in plancache with subtransactions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plan time of MASSIVE partitioning ...