[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 30 Aug 2003 20:26:38 +0100
Ben Davis <bnd25@xxxxxxxxxx> wrote:
> Do you know what ASSERT is for? It's for use with conditions that will always
> be true unless the programmer makes a mistake. When the code is compiled with
> -DDEBUGMODE=1 (as is the case with the debugging build of the library), the
> check will be made and if the condition evaluates false then the program will
> abort. In the optimised build, the check is not made.
>
I wasnt 100% sure of the use of ASSERT, but you have enlightened me as to use true functionality. Anyway, it seemed a bit superfluous to use an ASSERT at some point in graphics.c becuase if the system_driver does not exist, a different set of values will be assigned to a variable needing some sort of driver info. Although, if the point of ASSERT is to discover when a pointer is not valid to use, then I suppose it would be best to halt the program even if the system_driver isn't needed.