rtrussell / BBCSDL

BBC BASIC for SDL 2.0: for Windows, Linux (86), MacOS, Raspberry Pi, Android and iOS.
zlib License
215 stars 28 forks source link

'const void *a' unknown size ln 4791, and 'const void *b' unknown size same line, in SDL2_gfxPrimitives.c #26

Closed ghost closed 2 years ago

ghost commented 2 years ago

well uhh I tried using your gfx primitives and it seems to not work giving me the error above.

ghost commented 2 years ago

dont know if this is a good or permanent fix but I just changed it to a float and it works.

rtrussell commented 2 years ago

I tried using your gfx primitives and it seems to not work giving me the error above.

What compiler are you using? The code compiles correctly with GCC and Clang but it probably relies (accidentally) on an extension that they support but (for example) Microsoft compilers do not. Thanks for letting me know.

rtrussell commented 2 years ago

dont know if this is a good or permanent fix but I just changed it to a float and it works.

Not sure exactly what change you've made (you've got to be careful, because it's easy to break the pointer arithmetic), but try this:

float diff = *((float *)a + 1) - *((float *)b + 1) ;