Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit cf3531f

Browse files
[[ ReturnTypeWarning ]] Fix for Mac compilation
1 parent a45127f commit cf3531f

11 files changed

Lines changed: 55 additions & 15 deletions

File tree

engine/src/desktop-menu.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ static MCPlatformMenuRef create_menu(MCPlatformMenuRef p_menu, MenuItemDescripto
775775

776776
t_index++;
777777
}
778+
779+
return t_menu;
778780
}
779781

780782
static void free_menu(MenuItemDescriptor *p_items)

engine/src/dskmac.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4568,6 +4568,8 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
45684568
setlinebuf(stderr);
45694569
}
45704570
#endif // _MAC_SERVER
4571+
4572+
return true;
45714573
}
45724574

45734575
virtual void Finalize(void)
@@ -7486,6 +7488,8 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
74867488
MCS_startprocess_launch(p_name, p_doc, (Open_mode)p_mode);
74877489
else
74887490
MCS_startprocess_unix(p_name, kMCEmptyString, (Open_mode)p_mode, p_elevated);
7491+
7492+
return true;
74897493
}
74907494

74917495
virtual bool ProcessTypeIsForeground(void)

engine/src/mac-core.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ - (void)finalizeModules
204204

205205
- (NSError *)application:(NSApplication *)application willPresentError:(NSError *)error
206206
{
207+
return error;
207208
}
208209

209210
//////////

engine/src/mac-surface.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static inline CGBlendMode MCGBlendModeToCGBlendMode(MCGBlendMode p_blend)
392392
return kCGBlendModeLuminosity;
393393
}
394394

395-
MCAssert(false); // unknown blend mode
395+
MCUnreachableReturn(kCGBlendModeNormal); // unknown blend mode
396396
}
397397

398398
static void MCMacRenderCGImage(CGContextRef p_target, CGRect p_dst_rect, CGImageRef p_src, MCGFloat p_alpha, MCGBlendMode p_blend)

engine/src/mode_installer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class MCInternalPayloadOpen: public MCStatement
357357
}
358358

359359
if (s_payload_mapped_data == nil && s_payload_loaded_data == nil)
360-
t_succes = false;
360+
t_success = false;
361361
else
362362
{
363363
r_payload_data = s_payload_mapped_data != nil ? s_payload_mapped_data : s_payload_loaded_data;

engine/src/osxprinter.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ MCPrinterDialogResult MCMacOSXPrinter::DoDialog(bool p_window_modal, Window p_ow
10131013

10141014
Boolean t_accepted;
10151015
t_accepted = false;
1016-
OSErr t_err;
1016+
MCPrinterDialogResult t_err;
10171017

10181018
if (!MCModeMakeLocalWindows())
10191019
{
@@ -1043,11 +1043,11 @@ MCPrinterDialogResult MCMacOSXPrinter::DoDialog(bool p_window_modal, Window p_ow
10431043
}
10441044
if (t_success)
10451045
{
1046-
t_err = noErr;
1046+
t_err = PRINTER_DIALOG_RESULT_OKAY;
10471047
t_accepted = (Boolean)t_result;
10481048
}
10491049
else
1050-
t_err = errAborted;
1050+
t_err = PRINTER_DIALOG_RESULT_ERROR;
10511051
}
10521052
else
10531053
{
@@ -1085,21 +1085,23 @@ MCPrinterDialogResult MCMacOSXPrinter::DoDialog(bool p_window_modal, Window p_ow
10851085
if (t_result == kMCPlatformPrintDialogResultError)
10861086
{
10871087
PDEBUG(stderr, "DoDialog: Error occured\n");
1088-
return PRINTER_DIALOG_RESULT_ERROR;
1088+
t_err = PRINTER_DIALOG_RESULT_ERROR;
10891089
}
10901090
else if (t_result == kMCPlatformPrintDialogResultSuccess)
10911091
{
10921092
PDEBUG(stderr, "DoDialog: SetProperties\n");
10931093
SetProperties(p_is_settings);
10941094
PDEBUG(stderr, "DoDialog: Returning OKAY\n");
1095-
return PRINTER_DIALOG_RESULT_OKAY;
1095+
t_err = PRINTER_DIALOG_RESULT_OKAY;
10961096
}
10971097
else
10981098
{
10991099
PDEBUG(stderr, "DoDialog: Returning Cancel\n");
1100-
return PRINTER_DIALOG_RESULT_CANCEL;
1100+
t_err = PRINTER_DIALOG_RESULT_CANCEL;
11011101
}
11021102
}
1103+
1104+
return t_err;
11031105
}
11041106

11051107
///////////////////////////////////////////////////////////////////////////////

engine/src/player-platform.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,8 @@ Boolean MCPlayer::kdown(MCStringRef p_string, KeySym key)
991991
handle_shift_kdown(p_string, key);
992992
else
993993
handle_kdown(p_string, key);
994+
995+
return True;
994996
}
995997

996998
Boolean MCPlayer::kup(MCStringRef p_string, KeySym key)
@@ -2406,10 +2408,10 @@ MCRectangle MCPlayer::getpreferredrect()
24062408
// PM-2015-06-09: [[ Bug 5209 ]] formattedHeight should take into account the controller
24072409
if (flags & F_SHOW_CONTROLLER)
24082410
t_bounds.height += CONTROLLER_HEIGHT;
2409-
2410-
// PM-2014-04-28: [[Bug 12299]] Make sure the correct MCRectangle is returned
2411-
return t_bounds;
24122411
}
2412+
2413+
// PM-2014-04-28: [[Bug 12299]] Make sure the correct MCRectangle is returned
2414+
return t_bounds;
24132415
}
24142416

24152417
uint2 MCPlayer::getloudness()

revbrowser/src/osxbrowser.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ @interface WebBrowserAdapter : NSObject
8585
DOMHTMLElement *m_previous_element;
8686
}
8787

88-
- init;
89-
- dealloc;
88+
- (id)init;
89+
- (void)dealloc;
9090

9191
- (void)setBrowser: (TAltBrowser *)inBrowser;
9292
- (HIObjectRef)hiobject;
@@ -95,7 +95,7 @@ - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *
9595

9696
@implementation WebBrowserAdapter
9797

98-
- init
98+
- (id)init
9999
{
100100
self = [super init];
101101
if ( self )
@@ -105,7 +105,7 @@ @implementation WebBrowserAdapter
105105
return self;
106106
}
107107

108-
- dealloc
108+
- (void)dealloc
109109
{
110110
if (m_previous_element != NULL)
111111
[m_previous_element release];

revdb/revdb.gyp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,19 @@
470470
],
471471
},
472472
],
473+
[
474+
'OS == "mac"',
475+
{
476+
'xcode_settings':
477+
{
478+
'WARNING_CFLAGS!':
479+
[
480+
# Error in ../../thirdparty/libsqlite/include/qry_dat.h
481+
'-Werror=return-type',
482+
],
483+
},
484+
},
485+
],
473486
],
474487

475488
'all_dependent_settings':
@@ -538,6 +551,19 @@
538551
],
539552
},
540553
],
554+
[
555+
'OS == "mac"',
556+
{
557+
'xcode_settings':
558+
{
559+
'WARNING_CFLAGS!':
560+
[
561+
# Error in ../../thirdparty/libsqlite/include/qry_dat.h
562+
'-Werror=return-type',
563+
],
564+
},
565+
},
566+
],
541567
],
542568

543569
'all_dependent_settings':

revvideograbber/src/qtvideograbber.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ CQTVideoGrabber::CQTVideoGrabber(HWND whichwindow)
294294
return nil;
295295

296296
m_video_grabber = p_grabber;
297+
298+
return self;
297299
}
298300

299301
- (void)windowDidResize:(NSNotification *)notification

0 commit comments

Comments
 (0)