Fixed bug 3741 - more compatible initializers for arrays
authorSam Lantinga
Sun, 13 Aug 2017 21:15:44 -0700
changeset 112756dd70238edb7
parent 11274 daea00fb0938
child 11276 ebbad52788e1
Fixed bug 3741 - more compatible initializers for arrays

Ozkan Sezer

An array defined like int xPositions[] = {-1, 0, 1, w-1, w, w+1 };
errors with Open Watcom: it strictly wants constants. Small patch
like below makes things more compatible.
test/testautomation_mouse.c
test/testmessage.c
     1.1 --- a/test/testautomation_mouse.c	Sun Aug 13 21:12:14 2017 -0700
     1.2 +++ b/test/testautomation_mouse.c	Sun Aug 13 21:15:44 2017 -0700
     1.3 @@ -447,11 +447,23 @@
     1.4  {
     1.5      const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT;
     1.6      int numPositions = 6;
     1.7 -    int xPositions[] = {-1, 0, 1, w-1, w, w+1 };
     1.8 -    int yPositions[] = {-1, 0, 1, h-1, h, h+1 };
     1.9 +    int xPositions[6];
    1.10 +    int yPositions[6];
    1.11      int x, y, i, j;
    1.12      SDL_Window *window;
    1.13  
    1.14 +    xPositions[0] = -1;
    1.15 +    xPositions[1] = 0;
    1.16 +    xPositions[2] = 1;
    1.17 +    xPositions[3] = w-1;
    1.18 +    xPositions[4] = w;
    1.19 +    xPositions[5] = w+1;
    1.20 +    yPositions[0] = -1;
    1.21 +    yPositions[1] = 0;
    1.22 +    yPositions[2] = 1;
    1.23 +    yPositions[3] = h-1;
    1.24 +    yPositions[4] = h;
    1.25 +    yPositions[5] = h+1;
    1.26      /* Create test window */
    1.27      window = _createMouseSuiteTestWindow();
    1.28      if (window == NULL) return TEST_ABORTED;
     2.1 --- a/test/testmessage.c	Sun Aug 13 21:12:14 2017 -0700
     2.2 +++ b/test/testmessage.c	Sun Aug 13 21:15:44 2017 -0700
     2.3 @@ -46,12 +46,13 @@
     2.4          "Custom MessageBox",
     2.5          "This is a custom messagebox",
     2.6          2,
     2.7 -        buttons,
     2.8 +        NULL,/* buttons */
     2.9          NULL /* Default color scheme */
    2.10      };
    2.11  
    2.12      int button = -1;
    2.13      int success = 0;
    2.14 +    data.buttons = buttons;
    2.15      if (eventNumber) {
    2.16          data.message = "This is a custom messagebox from a background thread.";
    2.17      }