use SDL_zeroa at more places where the argument is an array.
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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c
index ed6e410..71cda89 100644
--- a/src/audio/SDL_wave.c
+++ b/src/audio/SDL_wave.c
@@ -112,7 +112,7 @@ WaveDebugLogFormat(WaveFile *file)
Uint32 wavebps = format->byterate;
char channelstr[64];
- SDL_zero(channelstr);
+ SDL_zeroa(channelstr);
switch (format->encoding) {
case PCM_CODE:
diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c
index b601f85..7d0e27e 100644
--- a/src/audio/qsa/SDL_qsa_audio.c
+++ b/src/audio/qsa/SDL_qsa_audio.c
@@ -619,8 +619,8 @@ QSA_Deinitialize(void)
{
/* Clear devices array on shutdown */
/* !!! FIXME: we zero these on init...any reason to do it here? */
- SDL_zero(qsa_playback_device);
- SDL_zero(qsa_capture_device);
+ SDL_zeroa(qsa_playback_device);
+ SDL_zeroa(qsa_capture_device);
qsa_playback_devices = 0;
qsa_capture_devices = 0;
}
@@ -629,8 +629,8 @@ static int
QSA_Init(SDL_AudioDriverImpl * impl)
{
/* Clear devices array */
- SDL_zero(qsa_playback_device);
- SDL_zero(qsa_capture_device);
+ SDL_zeroa(qsa_playback_device);
+ SDL_zeroa(qsa_capture_device);
qsa_playback_devices = 0;
qsa_capture_devices = 0;
diff --git a/src/audio/winmm/SDL_winmm.c b/src/audio/winmm/SDL_winmm.c
index dca2f97..c529139 100644
--- a/src/audio/winmm/SDL_winmm.c
+++ b/src/audio/winmm/SDL_winmm.c
@@ -387,7 +387,7 @@ WINMM_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return SDL_OutOfMemory();
}
- SDL_zero(this->hidden->wavebuf);
+ SDL_zeroa(this->hidden->wavebuf);
for (i = 0; i < NUM_BUFFERS; ++i) {
this->hidden->wavebuf[i].dwBufferLength = this->spec.size;
this->hidden->wavebuf[i].dwFlags = WHDR_DONE;
diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c
index cc2c202..2d2db15 100644
--- a/src/joystick/windows/SDL_windowsjoystick.c
+++ b/src/joystick/windows/SDL_windowsjoystick.c
@@ -223,7 +223,7 @@ SDL_JoystickThread(void *_data)
#if SDL_JOYSTICK_XINPUT
SDL_bool bOpenedXInputDevices[XUSER_MAX_COUNT];
- SDL_zero(bOpenedXInputDevices);
+ SDL_zeroa(bOpenedXInputDevices);
#endif
if (SDL_CreateDeviceNotification(¬ification_data) < 0) {
diff --git a/src/main/haiku/SDL_BApp.h b/src/main/haiku/SDL_BApp.h
index ae51ebc..48a2979 100644
--- a/src/main/haiku/SDL_BApp.h
+++ b/src/main/haiku/SDL_BApp.h
@@ -285,7 +285,7 @@ private:
ssize_t count;
if (msg->FindData("key-utf8", B_INT8_TYPE, (const void**)&keyUtf8, &count) == B_OK) {
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
- SDL_zero(text);
+ SDL_zeroa(text);
SDL_memcpy(text, keyUtf8, count);
SDL_SendKeyboardText(text);
}
diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c
index 6fb9682..611f76f 100644
--- a/src/test/SDL_test_memory.c
+++ b/src/test/SDL_test_memory.c
@@ -90,7 +90,7 @@ static void SDL_TrackAllocation(void *mem, size_t size)
entry->size = size;
/* Generate the stack trace for the allocation */
- SDL_zero(entry->stack);
+ SDL_zeroa(entry->stack);
#ifdef HAVE_LIBUNWIND_H
{
int stack_index;
diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c
index 010f133..f242686 100644
--- a/src/video/directfb/SDL_DirectFB_events.c
+++ b/src/video/directfb/SDL_DirectFB_events.c
@@ -236,7 +236,7 @@ ProcessWindowEvent(_THIS, SDL_Window *sdlwin, DFBWindowEvent * evt)
/* printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode);
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
- SDL_zero(text);
+ SDL_zeroa(text);
UnicodeToUtf8(unicode, text);
if (*text) {
SDL_SendKeyboardText_ex(0, text);
@@ -372,7 +372,7 @@ ProcessInputEvent(_THIS, DFBInputEvent * ievt)
/* printf("Scancode %d %d %d\n", keysym.scancode, evt->key_code, evt->key_id); */
SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode);
if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) {
- SDL_zero(text);
+ SDL_zeroa(text);
UnicodeToUtf8(unicode, text);
if (*text) {
SDL_SendKeyboardText_ex(kbd_idx, text);
diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c
index 9600302..15fa442 100644
--- a/src/video/windows/SDL_windowsmodes.c
+++ b/src/video/windows/SDL_windowsmodes.c
@@ -54,7 +54,7 @@ WIN_UpdateDisplayMode(_THIS, LPCTSTR deviceName, DWORD index, SDL_DisplayMode *
mode->w = logical_width;
mode->h = logical_height;
- SDL_zero(bmi_data);
+ SDL_zeroa(bmi_data);
bmi = (LPBITMAPINFO) bmi_data;
bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c
index cd46eff..dd37b2c 100644
--- a/src/video/x11/SDL_x11events.c
+++ b/src/video/x11/SDL_x11events.c
@@ -898,7 +898,7 @@ X11_DispatchEvent(_THIS)
}
#endif
/* */
- SDL_zero(text);
+ SDL_zeroa(text);
#ifdef X_HAVE_UTF8_STRING
if (data->ic) {
X11_Xutf8LookupString(data->ic, &xevent.xkey, text, sizeof(text),
diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c
index 044035d..380b2e7 100644
--- a/src/video/x11/SDL_x11mouse.c
+++ b/src/video/x11/SDL_x11mouse.c
@@ -48,7 +48,7 @@ X11_CreateEmptyCursor()
XColor color;
Pixmap pixmap;
- SDL_zero(data);
+ SDL_zeroa(data);
color.red = color.green = color.blue = 0;
pixmap = X11_XCreateBitmapFromData(display, DefaultRootWindow(display),
data, 1, 1);
diff --git a/test/testatomic.c b/test/testatomic.c
index 0a7d084..1095dd0 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -626,7 +626,7 @@ static void RunFIFOTest(SDL_bool lock_free)
/* Start the readers first */
SDL_Log("Starting %d readers\n", NUM_READERS);
- SDL_zero(readerData);
+ SDL_zeroa(readerData);
SDL_AtomicSet(&readersRunning, NUM_READERS);
for (i = 0; i < NUM_READERS; ++i) {
char name[64];
@@ -638,7 +638,7 @@ static void RunFIFOTest(SDL_bool lock_free)
/* Start up the writers */
SDL_Log("Starting %d writers\n", NUM_WRITERS);
- SDL_zero(writerData);
+ SDL_zeroa(writerData);
SDL_AtomicSet(&writersRunning, NUM_WRITERS);
for (i = 0; i < NUM_WRITERS; ++i) {
char name[64];
diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c
index 9a1a29a..b5d5b1d 100644
--- a/test/testautomation_rwops.c
+++ b/test/testautomation_rwops.c
@@ -100,7 +100,7 @@ _testGenericRWopsValidations(SDL_RWops *rw, int write)
int seekPos = SDLTest_RandomIntegerInRange(4, 8);
/* Clear buffer */
- SDL_zero(buf);
+ SDL_zeroa(buf);
/* Set to start. */
i = SDL_RWseek(rw, 0, RW_SEEK_SET );
@@ -226,7 +226,7 @@ rwops_testMem (void)
int result;
/* Clear buffer */
- SDL_zero(mem);
+ SDL_zeroa(mem);
/* Open */
rw = SDL_RWFromMem(mem, sizeof(RWopsHelloWorldTestString)-1);