Yeah. I’d have written (or tried to write) “if(NULL == e_t)” in the first
place, to enable the compiler to catch it if I accidentally missed a "="
such a typo directly.
Of course, gcc with -Wall -Werror is even better, is it would refuse to
compile either version with a single “=” - you need extra parentheses to
get away with such an expression where you really want it. (As in
assignment of function returns to variables inside if() conditions.)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Tuesday 12 February 2002 02:47, John Popplewell wrote:
Hi,
HUD::HUD() {
e_t = SDL_LoadBMP(“images/energy.bmp”);
if(e_t = NULL) { <-----------------------------
LOG.WRITE(“Could not load e_temp”);
LOG.WRITE(SDL_GetError());
exit(1);
}If you really only have one ‘=’ sign in that test
then the problem is revealed,