On Sun, Jun 26, 2011 at 9:02 PM, Johan Engelen <jbc.engelen@...2592...> wrote:
On 26-6-2011 0:22, Jon Cruz wrote:
One is with the use of "NULL". That is more of a C macro that in C++ has be replaced with the simple use of "0". I've looked into this point with coworkers and others at various points, and can try to dig up more details if you need them.
I think I like the use of "NULL" much more than "0", as it more clearly indicates the type.
Consider this code example of initializing variables: box->persp_href = 0; compared with box->persp_href = NULL;
I think the second version is clearer about what is being done. (the first looks like the number of refs is set to zero, instead of initializing a ref pointer
Ciao, Johan
Ah, thought you were saying _not_ to use NULL in C++, agree with you its easier to understand. the source code checker 'sparse' can find these cases though its C only.