Re: patch for GtkDialog



--- Joel Becker <jlbec evilplan org> wrote:
> 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

the standard states that if ax is a pointer then (ax
!= 0) will convert zero to NULL

a direct quote from the ansi c99 standard states :

"NULL
which expands to an implementaion-defined null pointer
constant"

you cannot gaurentee that the complier will _always_
use the zero memory address in all instances becuase
iirc NULL is dictated by the operating system not the
compiler. and gnome does run on multiple operating
systems already.

i know that you, me or any other developer doesn't
want to have to hunt down this bug when some compiler
or OS decides to use some other value for NULL.

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]