Ken Thomases : winemac: Change some run-time asserts to compile-time.

Alexandre Julliard julliard at winehq.org
Mon May 6 14:08:44 CDT 2013


Module: wine
Branch: master
Commit: 3964f805cc19260f0d3054cf296a9db2a593fbc2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3964f805cc19260f0d3054cf296a9db2a593fbc2

Author: Ken Thomases <ken at codeweavers.com>
Date:   Fri May  3 23:05:08 2013 -0500

winemac: Change some run-time asserts to compile-time.

---

 dlls/winemac.drv/macdrv_main.c |    4 ++--
 dlls/winemac.drv/opengl.c      |    3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c
index f4cb7be..501b7d5 100644
--- a/dlls/winemac.drv/macdrv_main.c
+++ b/dlls/winemac.drv/macdrv_main.c
@@ -37,6 +37,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(macdrv);
 #define kCFCoreFoundationVersionNumber10_7      635.00
 #endif
 
+C_ASSERT(NUM_EVENT_TYPES <= sizeof(macdrv_event_mask) * 8);
+
 DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES;
 
 
@@ -96,8 +98,6 @@ static BOOL process_attach(void)
     SessionAttributeBits attributes;
     OSStatus status;
 
-    assert(NUM_EVENT_TYPES <= sizeof(macdrv_event_mask) * 8);
-
     status = SessionGetInfo(callerSecuritySession, NULL, &attributes);
     if (status != noErr || !(attributes & sessionHasGraphicAccess))
         return FALSE;
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c
index 5f269fc..b1d2c1e 100644
--- a/dlls/winemac.drv/opengl.c
+++ b/dlls/winemac.drv/opengl.c
@@ -231,6 +231,7 @@ typedef union
     pixel_format    format;
     UInt64          code;
 } pixel_format_or_code;
+C_ASSERT(sizeof(((pixel_format_or_code*)0)->format) <= sizeof(((pixel_format_or_code*)0)->code));
 
 
 static pixel_format *pixel_formats;
@@ -1080,8 +1081,6 @@ static BOOL init_pixel_formats(void)
 
     TRACE("()\n");
 
-    assert(sizeof(((pixel_format_or_code*)0)->format) <= sizeof(((pixel_format_or_code*)0)->code));
-
     err = CGLQueryRendererInfo(CGDisplayIDToOpenGLDisplayMask(CGMainDisplayID()), &renderer_info, &rendererCount);
     if (err)
     {




More information about the wine-cvs mailing list