merge fallout: Patched to compile, fixed some compiler warnings, etc.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 01 Nov 2018 12:31:45 -0400
changeset 1238203d0bddca61b
parent 12381 dc9108cd4340
child 12383 f6430feceeda
merge fallout: Patched to compile, fixed some compiler warnings, etc.
src/render/SDL_render.c
src/render/direct3d/SDL_render_d3d.c
src/render/metal/SDL_render_metal.m
src/render/opengles2/SDL_render_gles2.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsmouse.c
     1.1 --- a/src/render/SDL_render.c	Wed Oct 31 15:03:41 2018 -0400
     1.2 +++ b/src/render/SDL_render.c	Thu Nov 01 12:31:45 2018 -0400
     1.3 @@ -2858,6 +2858,7 @@
     1.4          }
     1.5      }
     1.6  
     1.7 +    SDL_zero(r);
     1.8      SDL_RenderGetViewport(renderer, &r);
     1.9      real_dstrect.x = 0.0f;
    1.10      real_dstrect.y = 0.0f;
    1.11 @@ -2956,6 +2957,7 @@
    1.12          real_dstrect = *dstrect;
    1.13      } else {
    1.14          SDL_Rect r;
    1.15 +        SDL_zero(r);
    1.16          SDL_RenderGetViewport(renderer, &r);
    1.17          real_dstrect.x = 0.0f;
    1.18          real_dstrect.y = 0.0f;
     2.1 --- a/src/render/direct3d/SDL_render_d3d.c	Wed Oct 31 15:03:41 2018 -0400
     2.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Thu Nov 01 12:31:45 2018 -0400
     2.3 @@ -1306,7 +1306,7 @@
     2.4                      IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_POINTLIST, first / sizeof (Vertex), count);
     2.5                  } else {
     2.6                      const Vertex *verts = (Vertex *) (((Uint8 *) vertices) + first);
     2.7 -                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, vertices, sizeof (Vertex));
     2.8 +                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_POINTLIST, count, verts, sizeof (Vertex));
     2.9                  }
    2.10                  break;
    2.11              }
     3.1 --- a/src/render/metal/SDL_render_metal.m	Wed Oct 31 15:03:41 2018 -0400
     3.2 +++ b/src/render/metal/SDL_render_metal.m	Thu Nov 01 12:31:45 2018 -0400
     3.3 @@ -553,7 +553,7 @@
     3.4          mtltexdesc.height = (texture->h + 1) / 2;
     3.5      }
     3.6  
     3.7 -    if (yuv || nc12) {
     3.8 +    if (yuv || nv12) {
     3.9          mtltexture_uv = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
    3.10          if (mtltexture_uv == nil) {
    3.11  #if !__has_feature(objc_arc)
     4.1 --- a/src/render/opengles2/SDL_render_gles2.c	Wed Oct 31 15:03:41 2018 -0400
     4.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Thu Nov 01 12:31:45 2018 -0400
     4.3 @@ -1297,11 +1297,11 @@
     4.4                  if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
     4.5                      if (count > 2 && (verts[0] == verts[(count-1)*2]) && (verts[1] == verts[(count*2)-1])) {
     4.6                          /* GL_LINE_LOOP takes care of the final segment */
     4.7 -                        data->glDrawArrays(GL_LINE_LOOP, 0, count - 1);
     4.8 +                        data->glDrawArrays(GL_LINE_LOOP, 0, (GLsizei) (count - 1));
     4.9                      } else {
    4.10 -                        data->glDrawArrays(GL_LINE_STRIP, 0, count);
    4.11 +                        data->glDrawArrays(GL_LINE_STRIP, 0, (GLsizei) count);
    4.12                          /* We need to close the endpoint of the line */
    4.13 -                        data->glDrawArrays(GL_POINTS, count - 1, 1);
    4.14 +                        data->glDrawArrays(GL_POINTS, (GLsizei) (count - 1), 1);
    4.15                      }
    4.16                  }
    4.17                  break;
    4.18 @@ -1312,7 +1312,7 @@
    4.19                  size_t offset = 0;
    4.20                  if (SetDrawState(data, cmd, GLES2_IMAGESOURCE_SOLID) == 0) {
    4.21                      for (i = 0; i < count; ++i, offset += 4) {
    4.22 -                        data->glDrawArrays(GL_TRIANGLE_STRIP, offset, 4);
    4.23 +                        data->glDrawArrays(GL_TRIANGLE_STRIP, (GLsizei) offset, 4);
    4.24                      }
    4.25                  }
    4.26                  break;
     5.1 --- a/src/video/windows/SDL_windowsevents.c	Wed Oct 31 15:03:41 2018 -0400
     5.2 +++ b/src/video/windows/SDL_windowsevents.c	Thu Nov 01 12:31:45 2018 -0400
     5.3 @@ -962,7 +962,6 @@
     5.4          {
     5.5              UINT i;
     5.6              HDROP drop = (HDROP) wParam;
     5.7 -            SDL_bool isstack;
     5.8              UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
     5.9              for (i = 0; i < count; ++i) {
    5.10                  SDL_bool isstack;
     6.1 --- a/src/video/windows/SDL_windowsmouse.c	Wed Oct 31 15:03:41 2018 -0400
     6.2 +++ b/src/video/windows/SDL_windowsmouse.c	Thu Nov 01 12:31:45 2018 -0400
     6.3 @@ -113,7 +113,7 @@
     6.4      bmh.bV4BlueMask  = 0x000000FF;
     6.5  
     6.6      maskbitslen = ((surface->w + (pad - (surface->w % pad))) / 8) * surface->h;
     6.7 -    maskbits = SDL_small_alloc(Uint8,maskbitslen);
     6.8 +    maskbits = SDL_small_alloc(Uint8, maskbitslen, &isstack);
     6.9      if (maskbits == NULL) {
    6.10          SDL_OutOfMemory();
    6.11          return NULL;