merge fallout: Patched to compile, fixed some compiler warnings, etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 6af7d10..0c098a7 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -2858,6 +2858,7 @@ SDL_RenderCopyF(SDL_Renderer * renderer, SDL_Texture * texture,
}
}
+ SDL_zero(r);
SDL_RenderGetViewport(renderer, &r);
real_dstrect.x = 0.0f;
real_dstrect.y = 0.0f;
@@ -2956,6 +2957,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture,
real_dstrect = *dstrect;
} else {
SDL_Rect r;
+ SDL_zero(r);
SDL_RenderGetViewport(renderer, &r);
real_dstrect.x = 0.0f;
real_dstrect.y = 0.0f;
diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index 9d000cc..04cfcef 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -1306,7 +1306,7 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti
IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, first / sizeof (Vertex), count);
} else {
const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
- IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, vertices, sizeof (Vertex));
+ IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, verts, sizeof (Vertex));
}
break;
}
diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m
index d8f5b43..10640c6 100644
--- a/src/render/metal/SDL_render_metal.m
+++ b/src/render/metal/SDL_render_metal.m
@@ -553,7 +553,7 @@ METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
mtltexdesc.height = (texture->h + 1) / 2;
}
- if (yuv || nc12) {
+ if (yuv || nv12) {
mtltexture_uv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
if (mtltexture_uv == nil) {
#if !__has_feature(objc_arc)
diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c
index fe2ce1a..43bee7a 100644
--- a/src/render/opengles2/SDL_render_gles2.c
+++ b/src/render/opengles2/SDL_render_gles2.c
@@ -1297,11 +1297,11 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
if (count > 2 && (verts[0] == verts[(count-1)*2]) && (verts[1] == verts[(count*2)-1])) {
/* GL_LINE_LOOP takes care of the final segment */
- data->glDrawArrays(GL_LINE_LOOP, 0, count - 1);
+ data->glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) (count - 1));
} else {
- data->glDrawArrays(GL_LINE_STRIP, 0, count);
+ data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) count);
/* We need to close the endpoint of the line */
- data->glDrawArrays(GL_POINTS, count - 1, 1);
+ data->glDrawArrays(GL_POINTS, (GLsizei) (count - 1), 1);
}
}
break;
@@ -1312,7 +1312,7 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
size_t offset = 0;
if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
for (i = 0; i < count; ++i, offset += 4) {
- data->glDrawArrays(GL_TRIANGLE_STRIP, offset, 4);
+ data->glDrawArrays(GL_TRIANGLE_STRIP, (GLsizei) offset, 4);
}
}
break;
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 59c11bf..77d2f7f 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -962,7 +962,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
UINT i;
HDROP drop = (HDROP) wParam;
- SDL_bool isstack;
UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
for (i = 0; i < count; ++i) {
SDL_bool isstack;
diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c
index 3dc7e79..b7def42 100644
--- a/src/video/windows/SDL_windowsmouse.c
+++ b/src/video/windows/SDL_windowsmouse.c
@@ -113,7 +113,7 @@ WIN_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y)
bmh.bV4BlueMask = 0x000000FF;
maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h;
- maskbits = SDL_small_alloc(Uint8,maskbitslen);
+ maskbits = SDL_small_alloc(Uint8, maskbitslen, &isstack);
if (maskbits == NULL) {
SDL_OutOfMemory();
return NULL;