RE: Difference between NULL and 0?

2004-12-24 Thread Andrew J. Huang
Okay, the curmudgeon's gotta speak. Generally used to make a null pointer clear, NULL has been simply eye candy for the value 0. For twenty years, I've taken this interpretation as well. But recently, I've been finding places where a comparison against NULL gives different result than against

RE: Difference between NULL and 0?

2004-12-24 Thread Jeffry Loucks
I apologize ahead of time for my verbosity. Those who know me rarely involve me in a conversation without having a pre-arranged escape plan. Okay, the curmudgeon's gotta speak. Generally used to make a null pointer clear, NULL has been simply eye candy for the value 0. But recently, I've been

Re: Difference between NULL and 0?

2004-12-23 Thread Logan Shaw
Andrew J. Huang wrote: This is a really pretty dumb question, but NULL and 0 act differently using the gnu toolchain. What exactly is the difference? Not necessarily a dumb question; it is one of the finer points of C, since initially you just see lots of references to NULL and only later

Re: Difference between NULL and 0?

2004-12-23 Thread Henk Jonas
NULL is a pointer and therefor 32 bit long, 0 is an integer and in the prc-tools, integers are only 16 bit long. So you should see a difference between (NULL + 0x10) * 0x1000 and (0 + 0x10) * 0x1000. The first should (as far as I know) be calculated in 32 bit, the other in 16 bit. The first

RE: Difference between NULL and 0?

2004-12-23 Thread Caspar Heiden, vd
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Logan Shaw Sent: 23 December 2004 10:19 To: Palm Developer Forum Subject: Re: Difference between NULL and 0? Andrew J. Huang wrote: This is a really pretty dumb question, but NULL and 0 act differently using the gnu

RE: Difference between NULL and 0?

2004-12-23 Thread Jeffry Loucks
Okay, the curmudgeon's gotta speak. Generally used to make a null pointer clear, NULL has been simply eye candy for the value 0. NULL is often confused with NUL, which is simply eye candy for the character value of 0. In addition, NULL has been used as a scalar in logical or symbolic math

Re: Difference between NULL and 0?

2004-12-23 Thread Logan Shaw
Jeffry Loucks wrote: Okay, the curmudgeon's gotta speak. Anybody want to talk about true and false? Well, not exactly. But I have a question: I recently wrote a set of fixed-point math functions (24 to the left and 8 to the right) and defined ceil(a) as (a 8) + !!(a 0xff). So my question

RE: Difference between NULL and 0?

2004-12-23 Thread Jeffry Loucks
:) Jeff Loucks Work 425-284-1128 [EMAIL PROTECTED] Home 253-851-8908 [EMAIL PROTECTED] Mobile 253-691-8812 -Original Message- From: Logan Shaw [mailto:[EMAIL PROTECTED] Sent: Thursday, December 23, 2004 12:15 PM To: Palm Developer Forum Subject: Re: Difference between NULL and 0