#include <allegro5/allegro.h> al_fixed al_fixmul(al_fixed x, al_fixed y);
If an overflow occurs, Allegro’s errno will be set and the maximum possible value will be returned, but errno is not cleared if the operation is successful. This means that if you are going to test for overflow you should call al_set_errno(0) before calling al_fixmul(3).
al_fixed result; /* This will put 30000 into `result'. */ result = al_fixmul(al_itofix(10), al_itofix(3000)); /* But this overflows, and sets errno. */ result = al_fixmul(al_itofix(100), al_itofix(3000)); assert(!al_get_errno());
|Allegro reference manual|