Michael Stefaniuc : winebuild: Use the now available ARRAY_SIZE() macro.

Alexandre Julliard julliard at winehq.org
Wed Jun 19 15:08:16 CDT 2019


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Jun 19 17:50:29 2019 +0200

winebuild: Use the now available ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winebuild/main.c  | 2 +-
 tools/winebuild/utils.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c
index d308716..2539577 100644
--- a/tools/winebuild/main.c
+++ b/tools/winebuild/main.c
@@ -225,7 +225,7 @@ static void set_target( const char *target )
     /* get the OS part */
 
     target_platform = PLATFORM_UNSPECIFIED;  /* default value */
-    for (i = 0; i < sizeof(platform_names)/sizeof(platform_names[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(platform_names); i++)
     {
         if (!strncmp( platform_names[i].name, platform, strlen(platform_names[i].name) ))
         {
diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c
index dbfe7a4..31a6b28 100644
--- a/tools/winebuild/utils.c
+++ b/tools/winebuild/utils.c
@@ -943,7 +943,7 @@ int get_cpu_from_name( const char *name )
 {
     unsigned int i;
 
-    for (i = 0; i < sizeof(cpu_names)/sizeof(cpu_names[0]); i++)
+    for (i = 0; i < ARRAY_SIZE(cpu_names); i++)
         if (!strcmp( cpu_names[i].name, name )) return cpu_names[i].cpu;
     return -1;
 }




More information about the wine-cvs mailing list