From d3cb3ca95f1db7db52c330ff02148d9fbb33f294 Mon Sep 17 00:00:00 2001 From: Alexei Svitkine Date: Mon, 29 Jun 2015 11:50:50 -0400 Subject: [PATCH] Fix some warnings when building Xcode project. --- BasiliskII/src/SDL/video_sdl.cpp | 1 - BasiliskII/src/Unix/rpc_unix.cpp | 2 ++ .../src/MacOSX/Launcher/VMSettingsController.mm | 15 ++++++++++++--- SheepShaver/src/timer.cpp | 6 +++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index 720b8dc2..5b040261 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -645,7 +645,6 @@ driver_base::driver_base(SDL_monitor_desc &m) void driver_base::set_video_mode(int flags) { - int aligned_height = (VIDEO_MODE_Y + 15) & ~15; int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH); if ((s = SDL_SetVideoMode(VIDEO_MODE_X, VIDEO_MODE_Y, depth, SDL_HWSURFACE | flags)) == NULL) diff --git a/BasiliskII/src/Unix/rpc_unix.cpp b/BasiliskII/src/Unix/rpc_unix.cpp index 6789b78e..378c5dd6 100644 --- a/BasiliskII/src/Unix/rpc_unix.cpp +++ b/BasiliskII/src/Unix/rpc_unix.cpp @@ -330,6 +330,7 @@ int rpc_wait_dispatch(rpc_connection_t *connection, int timeout) return _rpc_wait_dispatch(connection, timeout); } +#ifdef USE_THREADS // Process incoming messages in the background static void *rpc_server_func(void *arg) { @@ -356,6 +357,7 @@ static void *rpc_server_func(void *arg) connection->server_thread_active = 0; return NULL; } +#endif // Return listen socket of RPC connection int rpc_listen_socket(rpc_connection_t *connection) diff --git a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm index ca4272e9..9a5ddf9c 100755 --- a/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm +++ b/SheepShaver/src/MacOSX/Launcher/VMSettingsController.mm @@ -30,6 +30,15 @@ #include +// NSInteger was added in 10.5 SDK. +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 + #if __LP64__ || NS_BUILD_32_LIKE_64 + typedef long NSInteger; + #else + typedef int NSInteger; + #endif +#endif + const int CDROMRefNum = -62; // RefNum of driver #ifdef STANDALONE_PREFS @@ -62,12 +71,12 @@ void prefs_exit() return self; } -- (int) numberOfRowsInTableView: (NSTableView *) table +- (NSInteger) numberOfRowsInTableView: (NSTableView *) table { return [diskArray count]; } -- (id) tableView: (NSTableView *) table objectValueForTableColumn: (NSTableColumn *) col row: (int) row +- (id) tableView: (NSTableView *) table objectValueForTableColumn: (NSTableColumn *) col row: (NSInteger) row { DiskType *d = (DiskType*)[diskArray objectAtIndex:row]; @@ -78,7 +87,7 @@ void prefs_exit() return [d path]; } --(void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +- (void) tableView: (NSTableView *) table setObjectValue: (id) object forTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row { if ([[tableColumn identifier] isEqual:@"isCDROMcol"]) { DiskType *d = (DiskType*)[diskArray objectAtIndex:row]; diff --git a/SheepShaver/src/timer.cpp b/SheepShaver/src/timer.cpp index 5e2e1f74..3edd6ca0 100644 --- a/SheepShaver/src/timer.cpp +++ b/SheepShaver/src/timer.cpp @@ -339,7 +339,7 @@ int16 InsTime(uint32 tm, uint16 trap) D(bug("InsTime %08lx, trap %04x\n", tm, trap)); WriteMacInt16((uint32)tm + qType, ReadMacInt16((uint32)tm + qType) & 0x1fff | (trap << 4) & 0x6000); if (find_desc(tm)) - printf("WARNING: InsTime(%08lx): Task re-inserted\n", tm); + printf("WARNING: InsTime(%08x): Task re-inserted\n", tm); else { TMDesc *desc = new TMDesc; desc->task = tm; @@ -361,7 +361,7 @@ int16 RmvTime(uint32 tm) // Find descriptor TMDesc *desc = find_desc(tm); if (!desc) { - printf("WARNING: RmvTime(%08lx): Descriptor not found\n", tm); + printf("WARNING: RmvTime(%08x): Descriptor not found\n", tm); return 0; } @@ -436,7 +436,7 @@ int16 PrimeTime(uint32 tm, int32 time) // Find descriptor TMDesc *desc = find_desc(tm); if (!desc) { - printf("FATAL: PrimeTime(%08lx): Descriptor not found\n", tm); + printf("FATAL: PrimeTime(%08x): Descriptor not found\n", tm); return 0; }