diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 7d6bade42..34f505f6d 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -955,8 +955,8 @@ SDL_BuildAudioResampleCVT(SDL_AudioCVT * cvt, const int dst_channels, if (cvt->filter_index >= (SDL_AUDIOCVT_MAX_FILTERS-2)) { return SDL_SetError("Too many filters needed for conversion, exceeded maximum of %d", SDL_AUDIOCVT_MAX_FILTERS-2); } - cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1] = (SDL_AudioFilter) (size_t) src_rate; - cvt->filters[SDL_AUDIOCVT_MAX_FILTERS] = (SDL_AudioFilter) (size_t) dst_rate; + cvt->filters[SDL_AUDIOCVT_MAX_FILTERS-1] = (SDL_AudioFilter) (uintptr_t) src_rate; + cvt->filters[SDL_AUDIOCVT_MAX_FILTERS] = (SDL_AudioFilter) (uintptr_t) dst_rate; if (src_rate < dst_rate) { const double mult = ((double) dst_rate) / ((double) src_rate); diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index 42364027c..dc1daee1a 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -65,7 +65,7 @@ test_device(const int iscapture, const char *fname, int flags, int (*test) (int * information, making this information inaccessible at * enumeration time */ - SDL_AddAudioDevice(iscapture, fname, NULL, (void *) dummyhandle); + SDL_AddAudioDevice(iscapture, fname, NULL, (void *) (uintptr_t) dummyhandle); } } } diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index f36b34f90..4343afb6b 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -961,7 +961,7 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I } if (texture) { - data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (cmd->data.draw.first + (sizeof (GLfloat) * 8))); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (uintptr_t) (cmd->data.draw.first + (sizeof (GLfloat) * 8))); } if (GLES2_SelectProgram(data, imgsrc, texture ? texture->w : 0, texture ? texture->h : 0) < 0) { @@ -1004,7 +1004,7 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I } /* all drawing commands use this */ - data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) cmd->data.draw.first); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (uintptr_t) cmd->data.draw.first); if (is_copy_ex != was_copy_ex) { if (is_copy_ex) { @@ -1018,8 +1018,8 @@ SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, const GLES2_I } if (is_copy_ex) { - data->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (cmd->data.draw.first + (sizeof (GLfloat) * 16))); - data->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (cmd->data.draw.first + (sizeof (GLfloat) * 24))); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_ANGLE, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (uintptr_t) (cmd->data.draw.first + (sizeof (GLfloat) * 16))); + data->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid *) (uintptr_t) (cmd->data.draw.first + (sizeof (GLfloat) * 24))); } return 0; diff --git a/src/stdlib/SDL_iconv.c b/src/stdlib/SDL_iconv.c index 004e7741c..2defa6eb5 100644 --- a/src/stdlib/SDL_iconv.c +++ b/src/stdlib/SDL_iconv.c @@ -55,13 +55,13 @@ SDL_COMPILE_TIME_ASSERT(iconv_t, sizeof (iconv_t) <= sizeof (SDL_iconv_t)); SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode) { - return (SDL_iconv_t) ((size_t) iconv_open(tocode, fromcode)); + return (SDL_iconv_t) ((uintptr_t) iconv_open(tocode, fromcode)); } int SDL_iconv_close(SDL_iconv_t cd) { - return iconv_close((iconv_t) ((size_t) cd)); + return iconv_close((iconv_t) ((uintptr_t) cd)); } size_t @@ -71,9 +71,9 @@ SDL_iconv(SDL_iconv_t cd, { size_t retCode; #ifdef ICONV_INBUF_NONCONST - retCode = iconv((iconv_t) ((size_t) cd), (char **) inbuf, inbytesleft, outbuf, outbytesleft); + retCode = iconv((iconv_t) ((uintptr_t) cd), (char **) inbuf, inbytesleft, outbuf, outbytesleft); #else - retCode = iconv((iconv_t) ((size_t) cd), inbuf, inbytesleft, outbuf, outbytesleft); + retCode = iconv((iconv_t) ((uintptr_t) cd), inbuf, inbytesleft, outbuf, outbytesleft); #endif if (retCode == (size_t) - 1) { switch (errno) { diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 459273509..87d693e8d 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -507,12 +507,12 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa } if (_this->egl_data->eglGetPlatformDisplay) { - _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplay(platform, (void *)(size_t)native_display, NULL); + _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplay(platform, (void *)(uintptr_t)native_display, NULL); } else { if (SDL_EGL_HasExtension(_this, SDL_EGL_CLIENT_EXTENSION, "EGL_EXT_platform_base")) { _this->egl_data->eglGetPlatformDisplayEXT = SDL_EGL_GetProcAddress(_this, "eglGetPlatformDisplayEXT"); if (_this->egl_data->eglGetPlatformDisplayEXT) { - _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplayEXT(platform, (void *)(size_t)native_display, NULL); + _this->egl_data->egl_display = _this->egl_data->eglGetPlatformDisplayEXT(platform, (void *)(uintptr_t)native_display, NULL); } } } diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index e20b430c3..a87712a5c 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -77,7 +77,7 @@ X11_CreateDefaultCursor() cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* None is used to indicate the default cursor */ - cursor->driverdata = (void*)None; + cursor->driverdata = (void*)(uintptr_t)None; } else { SDL_OutOfMemory(); } @@ -216,7 +216,7 @@ X11_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y) if (x11_cursor == None) { x11_cursor = X11_CreatePixmapCursor(surface, hot_x, hot_y); } - cursor->driverdata = (void*)x11_cursor; + cursor->driverdata = (void*)(uintptr_t)x11_cursor; } else { SDL_OutOfMemory(); } @@ -257,7 +257,7 @@ X11_CreateSystemCursor(SDL_SystemCursor id) x11_cursor = X11_XCreateFontCursor(GetDisplay(), shape); - cursor->driverdata = (void*)x11_cursor; + cursor->driverdata = (void*)(uintptr_t)x11_cursor; } else { SDL_OutOfMemory(); }