use SDL_zeroa at more places where the argument is an array.
authorOzkan Sezer <sezeroz@gmail.com>
Wed, 31 Jul 2019 05:11:40 +0300
changeset 129680e3948762c96
parent 12966 0262d439e9c6
child 12969 a1917148d38a
use SDL_zeroa at more places where the argument is an array.
src/audio/SDL_wave.c
src/audio/qsa/SDL_qsa_audio.c
src/audio/winmm/SDL_winmm.c
src/joystick/windows/SDL_windowsjoystick.c
src/main/haiku/SDL_BApp.h
src/test/SDL_test_memory.c
src/video/directfb/SDL_DirectFB_events.c
src/video/windows/SDL_windowsmodes.c
src/video/x11/SDL_x11events.c
src/video/x11/SDL_x11mouse.c
test/testatomic.c
test/testautomation_rwops.c
     1.1 --- a/src/audio/SDL_wave.c	Wed Jul 31 01:22:02 2019 +0300
     1.2 +++ b/src/audio/SDL_wave.c	Wed Jul 31 05:11:40 2019 +0300
     1.3 @@ -112,7 +112,7 @@
     1.4      Uint32 wavebps = format->byterate;
     1.5      char channelstr[64];
     1.6  
     1.7 -    SDL_zero(channelstr);
     1.8 +    SDL_zeroa(channelstr);
     1.9  
    1.10      switch (format->encoding) {
    1.11      case PCM_CODE:
     2.1 --- a/src/audio/qsa/SDL_qsa_audio.c	Wed Jul 31 01:22:02 2019 +0300
     2.2 +++ b/src/audio/qsa/SDL_qsa_audio.c	Wed Jul 31 05:11:40 2019 +0300
     2.3 @@ -619,8 +619,8 @@
     2.4  {
     2.5      /* Clear devices array on shutdown */
     2.6      /* !!! FIXME: we zero these on init...any reason to do it here? */
     2.7 -    SDL_zero(qsa_playback_device);
     2.8 -    SDL_zero(qsa_capture_device);
     2.9 +    SDL_zeroa(qsa_playback_device);
    2.10 +    SDL_zeroa(qsa_capture_device);
    2.11      qsa_playback_devices = 0;
    2.12      qsa_capture_devices = 0;
    2.13  }
    2.14 @@ -629,8 +629,8 @@
    2.15  QSA_Init(SDL_AudioDriverImpl * impl)
    2.16  {
    2.17      /* Clear devices array */
    2.18 -    SDL_zero(qsa_playback_device);
    2.19 -    SDL_zero(qsa_capture_device);
    2.20 +    SDL_zeroa(qsa_playback_device);
    2.21 +    SDL_zeroa(qsa_capture_device);
    2.22      qsa_playback_devices = 0;
    2.23      qsa_capture_devices = 0;
    2.24  
     3.1 --- a/src/audio/winmm/SDL_winmm.c	Wed Jul 31 01:22:02 2019 +0300
     3.2 +++ b/src/audio/winmm/SDL_winmm.c	Wed Jul 31 05:11:40 2019 +0300
     3.3 @@ -387,7 +387,7 @@
     3.4          return SDL_OutOfMemory();
     3.5      }
     3.6  
     3.7 -    SDL_zero(this->hidden->wavebuf);
     3.8 +    SDL_zeroa(this->hidden->wavebuf);
     3.9      for (i = 0; i < NUM_BUFFERS; ++i) {
    3.10          this->hidden->wavebuf[i].dwBufferLength = this->spec.size;
    3.11          this->hidden->wavebuf[i].dwFlags = WHDR_DONE;
     4.1 --- a/src/joystick/windows/SDL_windowsjoystick.c	Wed Jul 31 01:22:02 2019 +0300
     4.2 +++ b/src/joystick/windows/SDL_windowsjoystick.c	Wed Jul 31 05:11:40 2019 +0300
     4.3 @@ -223,7 +223,7 @@
     4.4  
     4.5  #if SDL_JOYSTICK_XINPUT
     4.6      SDL_bool bOpenedXInputDevices[XUSER_MAX_COUNT];
     4.7 -    SDL_zero(bOpenedXInputDevices);
     4.8 +    SDL_zeroa(bOpenedXInputDevices);
     4.9  #endif
    4.10  
    4.11      if (SDL_CreateDeviceNotification(&notification_data) < 0) {
     5.1 --- a/src/main/haiku/SDL_BApp.h	Wed Jul 31 01:22:02 2019 +0300
     5.2 +++ b/src/main/haiku/SDL_BApp.h	Wed Jul 31 05:11:40 2019 +0300
     5.3 @@ -285,7 +285,7 @@
     5.4              ssize_t count;
     5.5              if (msg->FindData("key-utf8", B_INT8_TYPE, (const void**)&keyUtf8, &count) == B_OK) {
     5.6                  char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
     5.7 -                SDL_zero(text);
     5.8 +                SDL_zeroa(text);
     5.9                  SDL_memcpy(text, keyUtf8, count);
    5.10                  SDL_SendKeyboardText(text);
    5.11              }
     6.1 --- a/src/test/SDL_test_memory.c	Wed Jul 31 01:22:02 2019 +0300
     6.2 +++ b/src/test/SDL_test_memory.c	Wed Jul 31 05:11:40 2019 +0300
     6.3 @@ -90,7 +90,7 @@
     6.4      entry->size = size;
     6.5  
     6.6      /* Generate the stack trace for the allocation */
     6.7 -    SDL_zero(entry->stack);
     6.8 +    SDL_zeroa(entry->stack);
     6.9  #ifdef HAVE_LIBUNWIND_H
    6.10      {
    6.11          int stack_index;
     7.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Wed Jul 31 01:22:02 2019 +0300
     7.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Wed Jul 31 05:11:40 2019 +0300
     7.3 @@ -236,7 +236,7 @@
     7.4                  /* printf("Scancode %d  %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
     7.5                  SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
     7.6                  if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
     7.7 -                    SDL_zero(text);
     7.8 +                    SDL_zeroa(text);
     7.9                      UnicodeToUtf8(unicode, text);
    7.10                      if (*text) {
    7.11                          SDL_SendKeyboardText_ex(0, text);
    7.12 @@ -372,7 +372,7 @@
    7.13              /* printf("Scancode %d  %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
    7.14              SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
    7.15              if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
    7.16 -                SDL_zero(text);
    7.17 +                SDL_zeroa(text);
    7.18                  UnicodeToUtf8(unicode, text);
    7.19                  if (*text) {
    7.20                      SDL_SendKeyboardText_ex(kbd_idx, text);
     8.1 --- a/src/video/windows/SDL_windowsmodes.c	Wed Jul 31 01:22:02 2019 +0300
     8.2 +++ b/src/video/windows/SDL_windowsmodes.c	Wed Jul 31 05:11:40 2019 +0300
     8.3 @@ -54,7 +54,7 @@
     8.4          mode->w = logical_width;
     8.5          mode->h = logical_height;
     8.6          
     8.7 -        SDL_zero(bmi_data);
     8.8 +        SDL_zeroa(bmi_data);
     8.9          bmi = (LPBITMAPINFO) bmi_data;
    8.10          bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    8.11  
     9.1 --- a/src/video/x11/SDL_x11events.c	Wed Jul 31 01:22:02 2019 +0300
     9.2 +++ b/src/video/x11/SDL_x11events.c	Wed Jul 31 05:11:40 2019 +0300
     9.3 @@ -898,7 +898,7 @@
     9.4              }
     9.5  #endif
     9.6              /* */
     9.7 -            SDL_zero(text);
     9.8 +            SDL_zeroa(text);
     9.9  #ifdef X_HAVE_UTF8_STRING
    9.10              if (data->ic) {
    9.11                  X11_Xutf8LookupString(data->ic, &xevent.xkey, text, sizeof(text),
    10.1 --- a/src/video/x11/SDL_x11mouse.c	Wed Jul 31 01:22:02 2019 +0300
    10.2 +++ b/src/video/x11/SDL_x11mouse.c	Wed Jul 31 05:11:40 2019 +0300
    10.3 @@ -48,7 +48,7 @@
    10.4          XColor color;
    10.5          Pixmap pixmap;
    10.6  
    10.7 -        SDL_zero(data);
    10.8 +        SDL_zeroa(data);
    10.9          color.red = color.green = color.blue = 0;
   10.10          pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display),
   10.11                                         data, 1, 1);
    11.1 --- a/test/testatomic.c	Wed Jul 31 01:22:02 2019 +0300
    11.2 +++ b/test/testatomic.c	Wed Jul 31 05:11:40 2019 +0300
    11.3 @@ -626,7 +626,7 @@
    11.4  
    11.5      /* Start the readers first */
    11.6      SDL_Log("Starting %d readers\n", NUM_READERS);
    11.7 -    SDL_zero(readerData);
    11.8 +    SDL_zeroa(readerData);
    11.9      SDL_AtomicSet(&readersRunning, NUM_READERS);
   11.10      for (i = 0; i < NUM_READERS; ++i) {
   11.11          char name[64];
   11.12 @@ -638,7 +638,7 @@
   11.13  
   11.14      /* Start up the writers */
   11.15      SDL_Log("Starting %d writers\n", NUM_WRITERS);
   11.16 -    SDL_zero(writerData);
   11.17 +    SDL_zeroa(writerData);
   11.18      SDL_AtomicSet(&writersRunning, NUM_WRITERS);
   11.19      for (i = 0; i < NUM_WRITERS; ++i) {
   11.20          char name[64];
    12.1 --- a/test/testautomation_rwops.c	Wed Jul 31 01:22:02 2019 +0300
    12.2 +++ b/test/testautomation_rwops.c	Wed Jul 31 05:11:40 2019 +0300
    12.3 @@ -100,7 +100,7 @@
    12.4     int seekPos = SDLTest_RandomIntegerInRange(4, 8);
    12.5  
    12.6     /* Clear buffer */
    12.7 -   SDL_zero(buf);
    12.8 +   SDL_zeroa(buf);
    12.9  
   12.10     /* Set to start. */
   12.11     i = SDL_RWseek(rw, 0, RW_SEEK_SET );
   12.12 @@ -226,7 +226,7 @@
   12.13     int result;
   12.14  
   12.15     /* Clear buffer */
   12.16 -   SDL_zero(mem);
   12.17 +   SDL_zeroa(mem);
   12.18  
   12.19     /* Open */
   12.20     rw = SDL_RWFromMem(mem, sizeof(RWopsHelloWorldTestString)-1);