Skip to content
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

SDL_SetPalette incorrect return value? #294

Closed
tylerlm opened this issue May 30, 2023 · 5 comments
Closed

SDL_SetPalette incorrect return value? #294

tylerlm opened this issue May 30, 2023 · 5 comments

Comments

@tylerlm
Copy link
Contributor

tylerlm commented May 30, 2023

In SDL 1.2, SDL_SetPalette returns 1 on success ("if all colors were set as requested") or 0 otherwise: SDL_video.c

In sdl12-compat, SDL_SetPalette returns 0 on success, or -1 or SDL20_OutOfMemory() on failure: SDL12_compat.c

(Other issues that mention the call are #216 and #283, though I'm not sure they're related)

@tylerlm
Copy link
Contributor Author

tylerlm commented May 30, 2023

Thanks!

I think the no-ops on lines 7306,7310,7315 should also be 1.

@icculus
Copy link
Collaborator

icculus commented May 30, 2023

@icculus icculus reopened this May 30, 2023
@tylerlm
Copy link
Contributor Author

tylerlm commented May 30, 2023

Oops, you're correct, my mistake!

@icculus, @slouken thank you for catching that, sorry for the breakage!

@tylerlm tylerlm closed this as completed May 30, 2023
@tylerlm
Copy link
Contributor Author

tylerlm commented May 30, 2023

Ahem, my merge needs to be reverted; is this appropriate?

I thought "surely these three integers will be trivial enough for a baby PR, what could go wrong". Ah well.

@tylerlm tylerlm reopened this May 30, 2023
tylerlm added a commit to tylerlm/sdl12-compat that referenced this issue May 30, 2023
slouken pushed a commit that referenced this issue May 30, 2023
@icculus
Copy link
Collaborator

icculus commented May 30, 2023

I thought "surely these three integers will be trivial enough for a baby PR, what could go wrong". Ah well.

No worries, thank you for taking interest in the tiny details!

@icculus icculus closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants