![]() |
|
Text input using allegro 5 |
Neil Roy
Member #2,229
April 2002
![]() |
My apologies. But it does need to be stated that modern C is not that way anymore or you could send a false impression to someone. Both C and C++ have changed quite a bit since the '90s, and for the better. I always say, use what you are the most comfortable with. Give both a try and see which you prefer. --- |
Scooter
Member #16,799
January 2018
|
Good morning Edgar: void AssertHandler(const char* expr , const char* file , int line , const char* func) { printf("%s failed in file %s on line %d in function %s\n" , expr , file , line , func); i /= 0; |
Neil Roy
Member #2,229
April 2002
![]() |
i /= 0; I don't even see why int i = 0; is in there. It sets i to zero, then later tries to divide it by zero then return. i is not used. Just remove it entirely. ...that should work just fine. No need for the i variable, the divide by zero or even the return statement as it is a void function. --- |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Neil, it's intentional. The divide by zero is on purpose, because it allows the debugger to catch the exception. This allows you to get a backtrace when the program fails an ALLEGRO_ASSERT. Otherwise the program exits and you can only see where the assert failed, not the stack when it does. So keep the divide by zero, it's on purpose. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Neil Roy
Member #2,229
April 2002
![]() |
Edgar Reynaldo said: Neil, it's intentional. The divide by zero is on purpose, because it allows the debugger to catch the exception. Ah, okay, I had a feeling that might have been it. That's an interesting trick. --- |
|
|