Re: patch for GtkDialog
- From: Joel Becker <jlbec evilplan org>
- To: Charles Lambert <cwlambert76 yahoo com>
- Cc: James Willcox <jwillcox cs indiana edu>, Havoc Pennington <hp redhat com>, gtk-devel-list gnome org, Seth Nickell <snickell stanford edu>, calum benson ireland sun com
- Subject: Re: patch for GtkDialog
- Date: Sat, 30 Mar 2002 00:40:54 +0000
On Fri, Mar 29, 2002 at 04:22:23PM -0800, Charles Lambert wrote:
> your test should be:
> if ( (NULL == rd) && (rd->response_id ==
> GTK_RESPONSE_CANCEL) )
>
> NULL isn't guarenteed to be equal to zero
> (and yes i know i'm a perenthesis freak)
"if (rd)" is often considered to be idiomatic. In addition,
0 is defined as the represention of the NULL pointer. ANSI C
specifically defines NULL as 0 or ((void *)0) or your expected
variation thereof. The runtime representation of NULL does not need to
be 0, but by that point the "if (rd)" statement has already been
understood by the compiler.
cf: http://www.eskimo.com/~scs/C-faq/q5.3.html
Joel
--
"Hell is oneself, hell is alone, the other figures in it, merely projections."
- T. S. Eliot
http://www.jlbec.org/
jlbec evilplan org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]