Skip to content

Commit

Permalink
sync with latest SDL2
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jan 4, 2025
1 parent d7e5c6e commit fd15330
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/SDL2/SDL_hints.h
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@ extern "C" {

/**
* A variable controlling whether the libdecor Wayland backend is preferred
* over native decrations.
* over native decorations.
*
* When this hint is set, libdecor will be used to provide window decorations,
* even if xdg-decoration is available. (Note that, by default, libdecor will
Expand Down
15 changes: 9 additions & 6 deletions src/test/SDL_test_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,24 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
{
Sint64 min = pMin;
Sint64 max = pMax;
Sint64 temp;
Sint64 number;
Uint64 range;

if (pMin > pMax) {
Sint32 temp;
temp = min;
min = max;
max = temp;
} else if (pMin == pMax) {
return (Sint32)min;
}

number = SDLTest_RandomUint32();
/* invocation count increment in preceeding call */

return (Sint32)((number % ((max + 1) - min)) + min);
range = (Sint64)max - (Sint64)min;
if (range < SDL_MAX_SINT32) {
return min + (Sint32) (SDLTest_RandomUint32() % (range + 1));
} else {
Uint64 add = SDLTest_RandomUint32() | SDLTest_RandomUint32();
return (Sint32) (min + (Sint64) (add % (range + 1)));
}
}

/* !
Expand Down

0 comments on commit fd15330

Please sign in to comment.