Michael Stefaniuc : winmm/tests: Avoid and ARRAY_SIZE-like macro.

Alexandre Julliard julliard at winehq.org
Thu Jun 14 16:53:23 CDT 2018


Module: wine
Branch: master
Commit: b400d4326d33d43c78b5d3563ff8196b5e45c875
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b400d4326d33d43c78b5d3563ff8196b5e45c875

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Jun 13 20:30:26 2018 +0200

winmm/tests: Avoid and ARRAY_SIZE-like macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winmm/tests/capture.c    | 2 +-
 dlls/winmm/tests/wave.c       | 2 +-
 dlls/winmm/tests/winmm_test.h | 1 -
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/winmm/tests/capture.c b/dlls/winmm/tests/capture.c
index fd4005c..ba71f9c 100644
--- a/dlls/winmm/tests/capture.c
+++ b/dlls/winmm/tests/capture.c
@@ -398,7 +398,7 @@ static void wave_in_test_device(UINT_PTR device)
 
     HeapFree(GetProcessHeap(), 0, nameA);
 
-    for (f=0;f<NB_WIN_FORMATS;f++) {
+    for (f = 0; f < ARRAY_SIZE(win_formats); f++) {
         format.wFormatTag=WAVE_FORMAT_PCM;
         format.nChannels=win_formats[f][3];
         format.wBitsPerSample=win_formats[f][2];
diff --git a/dlls/winmm/tests/wave.c b/dlls/winmm/tests/wave.c
index 8d7dfd6..b402e21 100644
--- a/dlls/winmm/tests/wave.c
+++ b/dlls/winmm/tests/wave.c
@@ -1041,7 +1041,7 @@ static void wave_out_test_device(UINT_PTR device)
                                 CALLBACK_EVENT,&capsA,TRUE,FALSE,FALSE);
     }
 
-    for (f=0;f<NB_WIN_FORMATS;f++) {
+    for (f = 0; f < ARRAY_SIZE(win_formats); f++) {
         format.wFormatTag=WAVE_FORMAT_PCM;
         format.nChannels=win_formats[f][3];
         format.wBitsPerSample=win_formats[f][2];
diff --git a/dlls/winmm/tests/winmm_test.h b/dlls/winmm/tests/winmm_test.h
index 177dc2e..d5fb70a 100644
--- a/dlls/winmm/tests/winmm_test.h
+++ b/dlls/winmm/tests/winmm_test.h
@@ -68,7 +68,6 @@ static const unsigned int win_formats[][4] = {
     {WAVE_FORMAT_96M16, 96000, 16, 1},
     {WAVE_FORMAT_96S16, 96000, 16, 2}
 };
-#define NB_WIN_FORMATS (sizeof(win_formats)/sizeof(*win_formats))
 
 extern const char* dev_name(int);
 extern const char* wave_open_flags(DWORD);




More information about the wine-cvs mailing list