-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSDL_Bool not cbool #110
Comments
Hi @sechshelme, we had a longer discussion about handling of SDL_bool in this issue: #30 Since the boolean data type is not the same as the integer data type (although they can be implemented via integer types) they should be distinguished. In contrast to C this is strongly done in Pascal, hence the problem is not with You should go with a cint type-cast instead of changing the TSDL_Bool data type. Use for example Best regards |
And who would change it like that? type
TSDL_Bool = cbool;
const
SDL_FALSE = 0;
SDL_TRUE = 1;
// SDL_FALSE = TSDL_Bool(0);
// SDL_TRUE = TSDL_Bool(1); or const
SDL_FALSE = cint(0);
SDL_TRUE = cint(1); |
I see your point, but please consider these two functions which will just return the arguments bool value: (1) function BoolArgument(ABool: TSDL_Bool); TSDL_Bool; Case 1: SDL_TRUE/SDL_FALSE is declared as is in our headers:
Case 2: SDL_TRUE/SDL_FALSE is declared as you propose as integers:
As Pascal strongly distinguishes the bool type from the integer type there cannot be ONE declaration for We decided to go for a bool type representation by Best regards |
SetColorKey requires an integer as the second parameter.
(SDL_surface.h; line: 446)
And SDL_FALSE & SDL_TRUE are also declared as integers.
(SDL_stdinc.h; line: 184)
So, in my opinion, TSDL_Bool should also be declared as an integer.
I modified the following in "sdlstdinc.inc":
Do you also think that this is more the case?
I am using Lazarus 2.2.4
The text was updated successfully, but these errors were encountered: