Re: patch for GtkDialog



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]