From 16334b0b949f18c46ec65cb7bfd59fb7394b0f4b Mon Sep 17 00:00:00 2001 From: dmitry Date: Thu, 16 Aug 2018 23:58:49 +0000 Subject: [PATCH] cocoa: fixing compiler warnings git-svn-id: trunk@58732 - --- lcl/interfaces/cocoa/cocoaobject.inc | 5 ++++- lcl/interfaces/cocoa/cocoaprivate.pp | 1 + lcl/interfaces/cocoa/cocoathemes.pas | 2 ++ lcl/interfaces/cocoa/cocoawinapi.inc | 7 +++++-- lcl/interfaces/cocoa/cocoawsclipboard.pas | 4 ++-- lcl/interfaces/cocoa/cocoawscomctrls.pas | 9 +++------ 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoaobject.inc b/lcl/interfaces/cocoa/cocoaobject.inc index 3424213344..41720fc0fc 100644 --- a/lcl/interfaces/cocoa/cocoaobject.inc +++ b/lcl/interfaces/cocoa/cocoaobject.inc @@ -705,7 +705,10 @@ begin ADesc.BluePrec := Prec; // gray or mono - if ADesc.Format = ricfGray then Exit; + if ADesc.Format = ricfGray then begin + Result := true; + Exit; + end; // alpha if ABitmap.BitmapType in [cbtARGB, cbtRGBA] then diff --git a/lcl/interfaces/cocoa/cocoaprivate.pp b/lcl/interfaces/cocoa/cocoaprivate.pp index 5f6f7d9699..e9c4092fbf 100644 --- a/lcl/interfaces/cocoa/cocoaprivate.pp +++ b/lcl/interfaces/cocoa/cocoaprivate.pp @@ -384,6 +384,7 @@ begin end; ticks[count]:=atick; inc(count); + Result := true; end; { TCocoaGroupBox } diff --git a/lcl/interfaces/cocoa/cocoathemes.pas b/lcl/interfaces/cocoa/cocoathemes.pas index a8f110767f..e920be578e 100644 --- a/lcl/interfaces/cocoa/cocoathemes.pas +++ b/lcl/interfaces/cocoa/cocoathemes.pas @@ -393,6 +393,8 @@ begin TREIS_DISABLED: lColor := ColorToNSColor(ColorToRGB(clWindow)); TREIS_SELECTEDNOTFOCUS: lColor := ColorToNSColor(ColorToRGB(clBtnFace)); TREIS_HOTSELECTED: lColor := ColorToNSColor(ColorToRGB(clHighlight)); + else + lColor := NSColor.blackColor; end; lBrush := TCocoaBrush.Create(lColor, False); DC.Rectangle(R.Left, R.Top, R.Right, R.Bottom, True, lBrush); diff --git a/lcl/interfaces/cocoa/cocoawinapi.inc b/lcl/interfaces/cocoa/cocoawinapi.inc index aacc3e11dc..23365c7d9d 100644 --- a/lcl/interfaces/cocoa/cocoawinapi.inc +++ b/lcl/interfaces/cocoa/cocoawinapi.inc @@ -1261,7 +1261,8 @@ begin end else Result := nil; - end; + end else + Result := nil; end; function TCocoaWidgetSet.IsWindow(handle: HWND): boolean; @@ -1919,6 +1920,7 @@ begin Result := 0; else DebugLn('TCocoaWidgetSet.GetDeviceCaps TODO Index: ' + DbgS(Index)); + Result := 0; end; end; @@ -2077,7 +2079,8 @@ begin NSApp.sendEvent(Event); Result := NSNumber(Info.objectForKey(NSMessageResult)).integerValue; Info.Release; - end; + end else + Result := 0; end; function TCocoaWidgetSet.SetActiveWindow(Handle: HWND): HWND; diff --git a/lcl/interfaces/cocoa/cocoawsclipboard.pas b/lcl/interfaces/cocoa/cocoawsclipboard.pas index 8b013b4a3b..9749bf4a4a 100644 --- a/lcl/interfaces/cocoa/cocoawsclipboard.pas +++ b/lcl/interfaces/cocoa/cocoawsclipboard.pas @@ -150,8 +150,8 @@ var lFormat: TCocoaClipboardData; begin lFormat := GetClipboardDataForFormat(FormatID); - if lFormat = nil then Exit; - Result := lFormat.MimeType; + if lFormat = nil then Result := '' + else Result := lFormat.MimeType; end; function TCocoaWSClipboard.GetClipboardDataForFormat(AFormat: TClipboardFormat diff --git a/lcl/interfaces/cocoa/cocoawscomctrls.pas b/lcl/interfaces/cocoa/cocoawscomctrls.pas index 65b10e00f2..50ddd274b2 100644 --- a/lcl/interfaces/cocoa/cocoawscomctrls.pas +++ b/lcl/interfaces/cocoa/cocoawscomctrls.pas @@ -1457,11 +1457,7 @@ begin lSlider.intval := ATrackBar.Position; // Ticks - if ATrackBar.TickStyle = tsNone then - begin - lTickCount := 0; - end - else if ATrackBar.TickStyle = tsAuto then + if ATrackBar.TickStyle = tsAuto then begin // this should only apply to Auto // and for Manual it should drawn manually @@ -1487,7 +1483,8 @@ begin end else if ATrackBar.TickStyle = tsManual then begin lTickCount := 2; - end; + end else + lTickCount := 0; lSlider.lclSetManTickDraw(ATrackBar.TickStyle = tsManual);