Forum unknown
· Programming
#Manx help
5 messages in this thread
This problem may be particular to the Manx C compiler. I'm trying to
allocate bitplanes using AllocRaster and FreeRaster but keep crashing the
system. I have made a test program to isolate the problem:
GfxBase=OpenLibrary("graphics.library",0l);
FreeRaster(AllocRaster(320l,200l),320l,200l);
(I've left out the rest of the bookkeeping) Can anybody verify this
problem and offer suggestions?
Be sure that you declare AllocRaster as returning void (a generalized
pointer) and cast it to what you need (i.e. PLANEPTR), otherwise the
compiler believes that it is returning an integer, and BOOM when you try to
use it.
Be sure that you declare AllocRaster as returning void (a generalized
pointer) and cast it to what you need (i.e. PLANEPTR), otherwise the
compiler believes that it is returning an integer, and BOOM when you try to
use it.
Try including functions.h. It properly types the external functions so
that the compiler knows that AllocRaster returns a pointer not an int.
(Lattice lets you get away with a bad call since ints are 32 bits.
Technically calling AllocRaster without declaring it as returning a pointer
is an error. (Lint will yell at you about it.))
Try including functions.h. It properly types the external functions so
that the compiler knows that AllocRaster returns a pointer not an int.
(Lattice lets you get away with a bad call since ints are 32 bits.
Technically calling AllocRaster without declaring it as returning a pointer
is an error. (Lint will yell at you about it.))