winemac: Avoid some compiler warnings.

Signed-off-by: Gijs Vermeulen <gijsvrm@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2019-12-06 11:42:34 +01:00 committed by Alexandre Julliard
parent fa38f34b0f
commit 8cd44ecf4c
2 changed files with 7 additions and 9 deletions

View File

@ -769,9 +769,9 @@ - (BOOL) mode:(CGDisplayModeRef)mode1 matchesMode:(CGDisplayModeRef)mode2
if (CGDisplayModeGetHeight(mode1) != CGDisplayModeGetHeight(mode2)) return FALSE; if (CGDisplayModeGetHeight(mode1) != CGDisplayModeGetHeight(mode2)) return FALSE;
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (CGDisplayModeGetPixelWidth != NULL && if (&CGDisplayModeGetPixelWidth != NULL &&
CGDisplayModeGetPixelWidth(mode1) != CGDisplayModeGetPixelWidth(mode2)) return FALSE; CGDisplayModeGetPixelWidth(mode1) != CGDisplayModeGetPixelWidth(mode2)) return FALSE;
if (CGDisplayModeGetPixelHeight != NULL && if (&CGDisplayModeGetPixelHeight != NULL &&
CGDisplayModeGetPixelHeight(mode1) != CGDisplayModeGetPixelHeight(mode2)) return FALSE; CGDisplayModeGetPixelHeight(mode1) != CGDisplayModeGetPixelHeight(mode2)) return FALSE;
#endif #endif
@ -801,9 +801,8 @@ - (NSArray*)modesMatchingMode:(CGDisplayModeRef)mode forDisplay:(CGDirectDisplay
NSDictionary* options = nil; NSDictionary* options = nil;
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (&kCGDisplayShowDuplicateLowResolutionModes != NULL) options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:TRUE]
options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:TRUE] forKey:(NSString*)kCGDisplayShowDuplicateLowResolutionModes];
forKey:(NSString*)kCGDisplayShowDuplicateLowResolutionModes];
#endif #endif
NSArray *modes = [(NSArray*)CGDisplayCopyAllDisplayModes(displayID, (CFDictionaryRef)options) autorelease]; NSArray *modes = [(NSArray*)CGDisplayCopyAllDisplayModes(displayID, (CFDictionaryRef)options) autorelease];

View File

@ -268,7 +268,7 @@ static BOOL write_display_settings(HKEY parent_hkey, CGDirectDisplayID displayID
goto fail; goto fail;
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL) if (&CGDisplayModeGetPixelWidth != NULL && &CGDisplayModeGetPixelHeight != NULL)
{ {
val = CGDisplayModeGetPixelWidth(display_mode); val = CGDisplayModeGetPixelWidth(display_mode);
if (RegSetValueExA(display_hkey, "PixelWidth", 0, REG_DWORD, (const BYTE*)&val, sizeof(val))) if (RegSetValueExA(display_hkey, "PixelWidth", 0, REG_DWORD, (const BYTE*)&val, sizeof(val)))
@ -456,7 +456,7 @@ static BOOL display_mode_matches_descriptor(CGDisplayModeRef mode, const struct
return FALSE; return FALSE;
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL) if (&CGDisplayModeGetPixelWidth != NULL && &CGDisplayModeGetPixelHeight != NULL)
{ {
if (CGDisplayModeGetPixelWidth(mode) != desc->pixel_width || if (CGDisplayModeGetPixelWidth(mode) != desc->pixel_width ||
CGDisplayModeGetPixelHeight(mode) != desc->pixel_height) CGDisplayModeGetPixelHeight(mode) != desc->pixel_height)
@ -616,8 +616,7 @@ static CFArrayRef copy_display_modes(CGDirectDisplayID display)
CFArrayRef modes = NULL; CFArrayRef modes = NULL;
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
if (&kCGDisplayShowDuplicateLowResolutionModes != NULL && if (&CGDisplayModeGetPixelWidth != NULL && &CGDisplayModeGetPixelHeight != NULL)
CGDisplayModeGetPixelWidth != NULL && CGDisplayModeGetPixelHeight != NULL)
{ {
CFDictionaryRef options; CFDictionaryRef options;
struct display_mode_descriptor* desc; struct display_mode_descriptor* desc;