No, it's not a matter of style. NULL is only guaranteed to represent a "zero" pointer for pointers to DATA types.
For "zero" FUNCTION pointers, you must use the literal 0. _Not_ NULL. Because a function pointer can be wider than a data pointer (eg. certain segmented memory models on the x86 and so forth).
So there probably is a good reason to use "if (!ptr)" after all, especially if you don't know C quite as well as you think you do. Cliches are cliches for some very good reasons...
``Second, please don't conflate "commercial" and "proprietary"; many people make a living selling development of Free Software and support for Free Software''
No, a tiny, tiny fraction of the world's software developers make a living in the way you describe - the rest of us depend on Evil Corporatism(TM) to put food in our bellies, and are getting pretty fed with the pseudo-commie claptrap the likes of Stallman spouts ad nauseum.
mtrek and gameplay is a bit like radio plays vs TV, by concentrating on the game play with a text interface it actually heightens the sense of combat in space (I'm thinking of the famous Orson Welles radio play of "War of the Worlds" that caused a panic in the 1930s:)... its a great game for the technically minded because you create keymaps (macros) of sequences of commands, which can help you get an advantage over an opponent, as well as letting you lay out the command keys of your ships as you like.
Warfare is politics by other means, as Clausewitz put it, I think. It seems to me that the US military has been put on the back foot in Iraq by nothing more sophisticated than a few dollars worth of camera equipment deployed in the wrong place at the wrong time. All the high tech weaponry in the world is useless without the political and moral will to employ it. Perhaps that is what is so frightening for the West countries in the phenomena of suicide bombing. "They" have people who are willing to die for their beliefs, "we" have leaders who pulled strings to dodge the draft. Anyone remember that jungle war where the B52s battled elephants and bicycles, and came off worse?
No, it's not a matter of style. NULL is only guaranteed to represent a "zero" pointer for pointers to DATA types. For "zero" FUNCTION pointers, you must use the literal 0. _Not_ NULL. Because a function pointer can be wider than a data pointer (eg. certain segmented memory models on the x86 and so forth).
void (*ptr)(void); /* .... */ /* ... */
...
if (ptr == NULL)
*** cc: error: incompatible types, aborting
So there probably is a good reason to use "if (!ptr)" after all, especially if you don't know C quite as well as you think you do. Cliches are cliches for some very good reasons
``Second, please don't conflate "commercial" and "proprietary"; many people make a living selling development of Free Software and support for Free Software''
No, a tiny, tiny fraction of the world's software developers make a living in the way you describe - the rest of us depend on Evil Corporatism(TM) to put food in our bellies, and are getting pretty fed with the pseudo-commie claptrap the likes of Stallman spouts ad nauseum.
mtrek and gameplay is a bit like radio plays vs TV, by concentrating on the game play with a text interface it actually heightens the sense of combat in space (I'm thinking of the famous Orson Welles radio play of "War of the Worlds" that caused a panic in the 1930s :) ... its a great game for the technically minded because you create keymaps (macros) of sequences of commands, which can help you get an advantage over an opponent, as well as letting you lay out the command keys of your ships as you like.
Warfare is politics by other means, as Clausewitz put it, I think. It seems to me that the US military has been put on the back foot in Iraq by nothing more sophisticated than a few dollars worth of camera equipment deployed in the wrong place at the wrong time. All the high tech weaponry in the world is useless without the political and moral will to employ it. Perhaps that is what is so frightening for the West countries in the phenomena of suicide bombing. "They" have people who are willing to die for their beliefs, "we" have leaders who pulled strings to dodge the draft. Anyone remember that jungle war where the B52s battled elephants and bicycles, and came off worse?