Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src_c/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,10 +894,10 @@ pg_ResizeEventWatch(void *userdata, SDL_Event *event)
SDL_Window *window;

#if SDL_VERSION_ATLEAST(3, 0, 0)
if (event->type >= SDL_EVENT_WINDOW_FIRST &&
event->type <= SDL_EVENT_WINDOW_LAST)
if (!(event->type >= SDL_EVENT_WINDOW_FIRST &&
event->type <= SDL_EVENT_WINDOW_LAST))
#else
if (event->type == SDL_WINDOWEVENT)
if (event->type != SDL_WINDOWEVENT)
#endif
{
return 0;
Expand Down Expand Up @@ -1832,12 +1832,7 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds)
if (!state->using_gl && ((flags & (PGS_SCALED | PGS_FULLSCREEN)) == 0) &&
!vsync && (((flags & PGS_RESIZABLE) == 0) || !zero_size)) {
if (((surface->surf->w != w_actual) ||
(surface->surf->h != h_actual)) &&
#if SDL_VERSION_ATLEAST(3, 0, 0)
((surface->surf->flags & SDL_WINDOW_FULLSCREEN) != 0)) {
#else
((surface->surf->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0)) {
#endif
(surface->surf->h != h_actual))) {
char buffer[150];
char *format_string =
"Requested window was forcibly resized by the OS.\n\t"
Expand Down
4 changes: 2 additions & 2 deletions src_c/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,8 @@ image_tobytes(PyObject *self, PyObject *arg, PyObject *kwarg)
for (w = 0; w < surf->w; ++w) {
color = *ptr++;
data[0] = (char)(((color & Rmask) >> Rshift) << Rloss);
data[1] = (char)(((color & Gmask) >> Gshift) << Rloss);
data[2] = (char)(((color & Bmask) >> Bshift) << Rloss);
data[1] = (char)(((color & Gmask) >> Gshift) << Gloss);
data[2] = (char)(((color & Bmask) >> Bshift) << Bloss);
data += 3;
}
pad(&data, padding);
Expand Down
4 changes: 2 additions & 2 deletions src_c/pixelarray_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ _make_surface(pgPixelArrayObject *array, PyObject *args)
}

/* Acquire a temporary lock. */
if (SDL_MUSTLOCK(new_surf) == 0) {
if (SDL_MUSTLOCK(new_surf)) {
SDL_LockSurface(new_surf);
}

Expand Down Expand Up @@ -237,7 +237,7 @@ _make_surface(pgPixelArrayObject *array, PyObject *args)
}
Py_END_ALLOW_THREADS;

if (SDL_MUSTLOCK(new_surf) == 0) {
if (SDL_MUSTLOCK(new_surf)) {
SDL_UnlockSurface(new_surf);
}
return (PyObject *)new_surface;
Expand Down
2 changes: 1 addition & 1 deletion src_c/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ window_set_modal_for(pgWindowObject *self, PyObject *arg)
return RAISE(PyExc_TypeError,
"Argument to set_modal_for must be a Window.");
}
if (!PG_SetWindowModalFor(self->_win, ((pgWindowObject *)arg)->_win)) {
if (PG_SetWindowModalFor(self->_win, ((pgWindowObject *)arg)->_win) < 0) {
return RAISE(pgExc_SDLError, SDL_GetError());
}
Py_RETURN_NONE;
Expand Down
Loading