Re: Comparison with "true" in source code
| От | Michael Meskes |
|---|---|
| Тема | Re: Comparison with "true" in source code |
| Дата | |
| Msg-id | 20101102171942.GA21179@hyperion.credativ.de обсуждение исходный текст |
| Ответ на | Comparison with "true" in source code (Itagaki Takahiro <itagaki.takahiro@gmail.com>) |
| Ответы |
Re: Comparison with "true" in source code
|
| Список | pgsql-hackers |
On Mon, Nov 01, 2010 at 12:17:02PM +0900, Itagaki Takahiro wrote:
> There are some "== true" in the codes, but they might not be safe
> because all non-zero values are true in C. Is it worth cleaning up them?
> ...
> src/interfaces/ecpg/ecpglib/connect.c(168): if (con->autocommit ==
> true && strncmp(mode, "off", strlen("off")) == 0)
> src/interfaces/ecpg/preproc/ecpg.addons(356): if (compat ==
> ECPG_COMPAT_INFORMIX_SE && autocommit == true)
> src/interfaces/ecpg/preproc/ecpg.c(310): ptr2ext[3] = (header_mode
> == true) ? 'h' : 'c';
> src/interfaces/ecpg/preproc/ecpg.c(327): ptr2ext[1] = (header_mode
> == true) ? 'h' : 'c';
I actually see no reason why these variables are not defined as bool instead of
int, so I changed this. Hopefully I found all of them.
Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org
Jabber: michael.meskes at googlemail dot com
VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
В списке pgsql-hackers по дате отправления: