Skip to content

Commit e2d397a

Browse files
committed
fix warning
1 parent 4920fcf commit e2d397a

File tree

2 files changed

+51
-51
lines changed

2 files changed

+51
-51
lines changed

src_c/_sdl2/video.c

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src_c/cython/pygame/_sdl2/video.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def messagebox(title, message,
121121
data.numbuttons = 1
122122
else:
123123
buttons_utf8 = [s.encode('utf8') for s in buttons]
124-
data.numbuttons = len(buttons)
124+
data.numbuttons = <int>len(buttons)
125125
c_buttons =\
126126
<SDL_MessageBoxButtonData*>malloc(data.numbuttons * sizeof(SDL_MessageBoxButtonData))
127127
if not c_buttons:
@@ -459,10 +459,10 @@ cdef class Texture:
459459
SDL_GetTextureColorMod(self._tex, &_r_mod, &_g_mod, &_b_mod)
460460
SDL_GetTextureAlphaMod(self._tex, &_a_mod)
461461

462-
cdef float r_mod = float(_r_mod) / 255.0
463-
cdef float g_mod = float(_g_mod) / 255.0
464-
cdef float b_mod = float(_b_mod) / 255.0
465-
cdef float a_mod = float(_a_mod) / 255.0
462+
cdef float r_mod = <float>_r_mod / <float>255.0
463+
cdef float g_mod = <float>_g_mod / <float>255.0
464+
cdef float b_mod = <float>_b_mod / <float>255.0
465+
cdef float a_mod = <float>_a_mod / <float>255.0
466466

467467
cdef SDL_Vertex vertices[3]
468468
for i, vert in enumerate(((p1_xy, p1_mod, p1_uv),
@@ -508,10 +508,10 @@ cdef class Texture:
508508
SDL_GetTextureColorMod(self._tex, &_r_mod, &_g_mod, &_b_mod)
509509
SDL_GetTextureAlphaMod(self._tex, &_a_mod)
510510

511-
cdef float r_mod = float(_r_mod) / 255.0
512-
cdef float g_mod = float(_g_mod) / 255.0
513-
cdef float b_mod = float(_b_mod) / 255.0
514-
cdef float a_mod = float(_a_mod) / 255.0
511+
cdef float r_mod = <float>_r_mod / <float>255.0
512+
cdef float g_mod = <float>_g_mod / <float>255.0
513+
cdef float b_mod = <float>_b_mod / <float>255.0
514+
cdef float a_mod = <float>_a_mod / <float>255.0
515515

516516
cdef SDL_Vertex vertices[6]
517517
for i, vert in enumerate(((p1_xy, p1_mod, p1_uv),

0 commit comments

Comments
 (0)