Clean up warnings and build issues when building under OS X 10.9. DONT_BUILD.

git-svn-id: https://svn.eduke32.com/eduke32@4644 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2014-10-16 21:03:24 +00:00
parent ff7d664d1e
commit 295cf82323
15 changed files with 136 additions and 66 deletions

View file

@ -519,7 +519,7 @@ $(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.c | $(ENGINE_OBJ)
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.m | $(ENGINE_OBJ) $(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.m | $(ENGINE_OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE) $(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ) $(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
@ -579,7 +579,7 @@ $(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/util/%.c | $(DUKE3D_OBJ)
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.m | $(DUKE3D_OBJ) $(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.m | $(DUKE3D_OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)
$(RECIPE_IF) $(COMPILER) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE) $(RECIPE_IF) $(COMPILER_OBJC) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.cpp | $(DUKE3D_OBJ) $(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.cpp | $(DUKE3D_OBJ)
$(COMPILE_STATUS) $(COMPILE_STATUS)

View file

@ -33,22 +33,10 @@ ifeq ($(AS),as)
override AS=nasm override AS=nasm
endif endif
COMPILER_OBJC=$(CC)
L_CC=$(CC) L_CC=$(CC)
L_CXX=$(CXX) L_CXX=$(CXX)
CLANG?=0
ifeq ($(findstring clang,$(CC)),clang)
override CLANG=1
endif
ifneq (0,$(CLANG))
override CC=clang -x c
override CXX=clang -x c++
override L_CC=clang
override L_CXX=clang
endif
CCFULLPATH=$(CC) CCFULLPATH=$(CC)
ifeq ($(PLATFORM),WII) ifeq ($(PLATFORM),WII)
@ -64,6 +52,26 @@ ifeq ($(PLATFORM),WII)
STRIP=powerpc-eabi-strip STRIP=powerpc-eabi-strip
endif endif
CLANG?=0
CLANG_POTENTIAL_VERSION := $(shell $(CCFULLPATH) --version)
ifeq ($(findstring clang,$(CC)),clang)
override CLANG=1
endif
# detect clang symlinked as gcc, as in OS X
ifeq ($(findstring clang,$(CLANG_POTENTIAL_VERSION)),clang)
override CLANG=1
endif
ifneq (0,$(CLANG))
override CC=clang -x c
override CXX=clang -x c++
override COMPILER_OBJC=clang -x objective-c
override L_CC=clang
override L_CXX=clang
endif
# GCC version, for conditional selection of flags. # GCC version, for conditional selection of flags.
ifndef GCC_MAJOR ifndef GCC_MAJOR
GCC_MAJOR := $(shell $(CCFULLPATH) -dumpversion 2>&1 | cut -d'.' -f1) GCC_MAJOR := $(shell $(CCFULLPATH) -dumpversion 2>&1 | cut -d'.' -f1)
@ -303,8 +311,14 @@ ifeq ($(PLATFORM),DARWIN)
ifndef DARWINVERSION ifndef DARWINVERSION
DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1)) DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1))
endif endif
DARWIN9 ?= 0
DARWIN10 ?= 0
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10))) ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10)))
DARWIN9 ?= 1 override DARWIN9 := 1
endif
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 11)))
override DARWIN10 := 1
endif endif
# COMMONFLAGS += -fno-leading-underscore # COMMONFLAGS += -fno-leading-underscore
@ -405,11 +419,9 @@ endif
# See http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation # See http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
# for a list of possible UBSan options. # for a list of possible UBSan options.
# Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer # Clang 3.2 does only supports -fsanitize=address for the AddressSanitizer
ifneq ($(PLATFORM),WINDOWS) # CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size -fsanitize-undefined-trap-on-error
CLANG_DEBUG_FLAGS := -fsanitize=address -fsanitize=bounds,enum,float-cast-overflow,object-size
# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow # CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),signed-integer-overflow
# CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow # CLANG_DEBUG_FLAGS := $(CLANG_DEBUG_FLAGS),unsigned-integer-overflow
endif
ifneq (0,$(RELEASE)) ifneq (0,$(RELEASE))
# Debugging disabled # Debugging disabled
@ -429,9 +441,9 @@ ifneq (0,$(RELEASE))
COMPILERFLAGS += -DNDEBUG COMPILERFLAGS += -DNDEBUG
else else
COMPILERFLAGS += -DDEBUGGINGAIDS COMPILERFLAGS += -DDEBUGGINGAIDS
ifneq (0,$(CLANG)) # ifneq (0,$(CLANG))
COMMONFLAGS += $(CLANG_DEBUG_FLAGS) # COMMONFLAGS += $(CLANG_DEBUG_FLAGS)
endif # endif
endif endif
ifneq (0,$(LTO)) ifneq (0,$(LTO))
COMPILERFLAGS += -DUSING_LTO COMPILERFLAGS += -DUSING_LTO
@ -451,9 +463,9 @@ else
COMPILERFLAGS += -DDEBUGGINGAIDS=2 COMPILERFLAGS += -DDEBUGGINGAIDS=2
endif endif
ifneq (0,$(CLANG)) # ifneq (0,$(CLANG))
COMMONFLAGS += $(CLANG_DEBUG_FLAGS) # COMMONFLAGS += $(CLANG_DEBUG_FLAGS)
endif # endif
ifeq ($(SUBPLATFORM),LINUX) ifeq ($(SUBPLATFORM),LINUX)
LIBS+=-rdynamic LIBS+=-rdynamic
endif endif
@ -595,7 +607,7 @@ DLLSUFFIX=.so
SDL_TARGET ?= 2 SDL_TARGET ?= 2
SDL_FRAMEWORK ?= 1 SDL_FRAMEWORK ?= 0
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4))) ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
L_SSP := -lssp L_SSP := -lssp
@ -651,15 +663,27 @@ ifeq ($(PLATFORM),DARWIN)
ASFORMAT=macho$(SYSBITS) ASFORMAT=macho$(SYSBITS)
ASFLAGS+= -DUNDERSCORES ASFLAGS+= -DUNDERSCORES
# include port and brew LIBDIRS+= -Lplatform/Apple/lib
LIBDIRS+= -Lplatform/Apple/lib -L/opt/local/lib -L/usr/local/lib COMPILERFLAGS+= -Iplatform/Apple/include
COMPILERFLAGS+= -Iplatform/Apple/include -I/opt/local/include -I/sw/include -I/usr/local/include
ifneq ($(shell port --version &>/dev/null; echo $$?),127)
LIBDIRS+= -L/opt/local/lib
COMPILERFLAGS+= -I/opt/local/include
endif
ifneq ($(shell brew --version &>/dev/null; echo $$?),127)
LIBDIRS+= -L/usr/local/lib
COMPILERFLAGS+= -I/usr/local/include
endif
ifneq ($(shell fink --version &>/dev/null; echo $$?),127)
LIBDIRS+= -L/sw/lib
COMPILERFLAGS+= -I/sw/include
endif
RENDERTYPE = SDL RENDERTYPE = SDL
MIXERTYPE = SDL MIXERTYPE = SDL
STDCPPLIB:=-lstdc++ STDCPPLIB:=-lstdc++
COMPILERFLAGS += -DHAVE_INTTYPES COMPILERFLAGS += -DHAVE_INTTYPES
DLLSUFFIX=.dylib # ??? DLLSUFFIX=.dylib
GTKCOMPAT32 = 0 GTKCOMPAT32 = 0
WITHOUT_GTK ?= 1 WITHOUT_GTK ?= 1
@ -944,7 +968,9 @@ ifneq ($(PLATFORM),WINDOWS)
ifneq ($(PLATFORM),WII) ifneq ($(PLATFORM),WII)
LIBS+= -ldl LIBS+= -ldl
endif endif
LIBS+= -pthread ifneq ($(PLATFORM),DARWIN)
LIBS+= -pthread
endif
endif endif
ifeq ($(PLATFORM),WINDOWS) ifeq ($(PLATFORM),WINDOWS)

View file

@ -519,6 +519,12 @@ extern bglDebugMessageCallbackARBProcPtr bglDebugMessageCallbackARB;
#endif #endif
// GLU // GLU
#if defined __clang__ && defined __APPLE__
// XXX: OS X 10.9 deprecated GLUtesselator.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
typedef void (APIENTRY * bgluTessBeginContourProcPtr)(GLUtesselator* tess); typedef void (APIENTRY * bgluTessBeginContourProcPtr)(GLUtesselator* tess);
extern bgluTessBeginContourProcPtr bgluTessBeginContour; extern bgluTessBeginContourProcPtr bgluTessBeginContour;
typedef void (APIENTRY * bgluTessBeginPolygonProcPtr)(GLUtesselator* tess, GLvoid* data); typedef void (APIENTRY * bgluTessBeginPolygonProcPtr)(GLUtesselator* tess, GLvoid* data);
@ -540,6 +546,10 @@ extern bgluNewTessProcPtr bgluNewTess;
typedef void (APIENTRY * bgluDeleteTessProcPtr)(GLUtesselator* tess); typedef void (APIENTRY * bgluDeleteTessProcPtr)(GLUtesselator* tess);
extern bgluDeleteTessProcPtr bgluDeleteTess; extern bgluDeleteTessProcPtr bgluDeleteTess;
#if defined __clang__ && defined __APPLE__
#pragma clang diagnostic pop
#endif
typedef void (APIENTRY * bgluPerspectiveProcPtr)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); typedef void (APIENTRY * bgluPerspectiveProcPtr)(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
extern bgluPerspectiveProcPtr bgluPerspective; extern bgluPerspectiveProcPtr bgluPerspective;

View file

@ -2,7 +2,7 @@
#define __osxbits_h__ #define __osxbits_h__
#include <sys/types.h> #include <sys/types.h>
int32_t osx_msgbox(char *name, char *msg); int32_t osx_msgbox(const char *name, const char *msg);
int32_t osx_ynbox(char *name, char *msg); int32_t osx_ynbox(const char *name, const char *msg);
#endif #endif

View file

@ -53,7 +53,7 @@ Minimum required SDL versions:
# endif # endif
# else # else
# if (SDL_TARGET == 2) # if (SDL_TARGET == 2)
# include <SDL2_mixer/SDL_mixer.h> # include <SDL2/SDL_mixer.h>
# else # else
# include <SDL_mixer/SDL_mixer.h> # include <SDL_mixer/SDL_mixer.h>
# endif # endif

View file

@ -5,13 +5,7 @@
Feel free to customize this file to suit your needs Feel free to customize this file to suit your needs
*/ */
#if defined(SDL_FRAMEWORK) #include "sdl_inc.h"
# include <SDL/SDL.h>
#else
# include "SDL.h"
#endif
#include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */ #include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h> #include <unistd.h>

View file

@ -1,3 +1,4 @@
#include "compat.h"
#include "osxbits.h" #include "osxbits.h"
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@ -5,18 +6,18 @@
# define MAC_OS_VERSION_10_3 1030 # define MAC_OS_VERSION_10_3 1030
#endif #endif
int osx_msgbox(char *name, char *msg) int osx_msgbox(const char *name, const char *msg)
{ {
NSString *mmsg = [[NSString alloc] initWithCString: msg]; NSString *mmsg = [[NSString alloc] initWithUTF8String:msg];
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
NSAlert *alert = [[NSAlert alloc] init]; NSAlert *alert = [[NSAlert alloc] init];
[alert addButtonWithTitle: @"OK"]; [alert addButtonWithTitle: @"OK"];
[alert setInformativeText: mmsg]; [alert setInformativeText: mmsg];
[alert setAlertStyle: NSInformationalAlertStyle]; [alert setAlertStyle: NSInformationalAlertStyle];
[alert runModal]; [alert runModal];
[alert release]; [alert release];
#else #else
@ -24,12 +25,15 @@ int osx_msgbox(char *name, char *msg)
#endif #endif
[mmsg release]; [mmsg release];
UNREFERENCED_PARAMETER(name);
return 0; return 0;
} }
int osx_ynbox(char *name, char *msg) int osx_ynbox(const char *name, const char *msg)
{ {
NSString *mmsg = [[NSString alloc] initWithCString: msg]; NSString *mmsg = [[NSString alloc] initWithUTF8String:msg];
int r; int r;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
@ -39,7 +43,7 @@ int osx_ynbox(char *name, char *msg)
[alert addButtonWithTitle:@"No"]; [alert addButtonWithTitle:@"No"];
[alert setInformativeText: mmsg]; [alert setInformativeText: mmsg];
[alert setAlertStyle: NSInformationalAlertStyle]; [alert setAlertStyle: NSInformationalAlertStyle];
r = ([alert runModal] == NSAlertFirstButtonReturn); r = ([alert runModal] == NSAlertFirstButtonReturn);
[alert release]; [alert release];
@ -48,5 +52,8 @@ int osx_ynbox(char *name, char *msg)
#endif #endif
[mmsg release]; [mmsg release];
UNREFERENCED_PARAMETER(name);
return r; return r;
} }

View file

@ -688,7 +688,15 @@ int16_t viewangle;
int32_t depth; int32_t depth;
_prmirror mirrors[10]; _prmirror mirrors[10];
#if defined __clang__ && defined __APPLE__
// XXX: OS X 10.9 deprecated GLUtesselator.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#endif
GLUtesselator* prtess; GLUtesselator* prtess;
#if defined __clang__ && defined __APPLE__
#pragma clang diagnostic pop
#endif
static int16_t cursky; static int16_t cursky;
static char curskypal; static char curskypal;

View file

@ -106,7 +106,9 @@ static float lastvidgcb[3];
//static SDL_Surface * loadtarga(const char *fn); // for loading the icon //static SDL_Surface * loadtarga(const char *fn); // for loading the icon
static SDL_Surface *appicon = NULL; static SDL_Surface *appicon = NULL;
#if !defined(__APPLE__) && !defined(__ANDROID__)
static SDL_Surface *loadappicon(void); static SDL_Surface *loadappicon(void);
#endif
static mutex_t m_initprintf; static mutex_t m_initprintf;

View file

@ -32,20 +32,27 @@ static id nsapp;
- (IBAction)alwaysShowClicked:(id)sender - (IBAction)alwaysShowClicked:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
} }
- (IBAction)fullscreenClicked:(id)sender - (IBAction)fullscreenClicked:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
// XXX: recalculate the video modes list to take into account the fullscreen status // XXX: recalculate the video modes list to take into account the fullscreen status
} }
- (IBAction)cancel:(id)sender - (IBAction)cancel:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
[nsapp abortModal]; [nsapp abortModal];
} }
- (IBAction)start:(id)sender - (IBAction)start:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
// XXX: write the states of the form controls to their respective homes // XXX: write the states of the form controls to their respective homes
[nsapp stopModal]; [nsapp stopModal];
} }
@ -146,7 +153,7 @@ int startwin_puts(const char *s)
if (!s) return -1; if (!s) return -1;
if (startwin == nil) return 1; if (startwin == nil) return 1;
ns = [[NSString alloc] initWithCString:s]; ns = [[NSString alloc] initWithUTF8String:s];
[startwin putsMessage:ns]; [startwin putsMessage:ns];
[ns release]; [ns release];
@ -160,7 +167,7 @@ int startwin_settitle(const char *s)
if (!s) return -1; if (!s) return -1;
if (startwin == nil) return 1; if (startwin == nil) return 1;
ns = [[NSString alloc] initWithCString:s]; ns = [[NSString alloc] initWithUTF8String:s];
[startwin setTitle:ns]; [startwin setTitle:ns];
[ns release]; [ns release];
@ -169,6 +176,8 @@ int startwin_settitle(const char *s)
int startwin_idle(void *v) int startwin_idle(void *v)
{ {
UNREFERENCED_PARAMETER(v);
if (startwin) [[startwin window] displayIfNeeded]; if (startwin) [[startwin window] displayIfNeeded];
return 0; return 0;
} }

View file

@ -7,7 +7,7 @@
* *
*/ */
@interface GameListSource : NSObject @interface GameListSource : NSObject <NSComboBoxDataSource>
{ {
NSMutableArray *list; NSMutableArray *list;
} }
@ -17,7 +17,7 @@
- (int)findIndexForGrpname:(NSString*)grpname; - (int)findIndexForGrpname:(NSString*)grpname;
- (id)tableView:(NSTableView *)aTableView - (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex; row:(NSInteger)rowIndex;
- (int)numberOfRowsInTableView:(NSTableView *)aTableView; - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
@end @end

View file

@ -9,6 +9,8 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#include "compat.h"
#import "GrpFile.game.h" #import "GrpFile.game.h"
#import "GameListSource.game.h" #import "GameListSource.game.h"
@ -25,7 +27,7 @@
for (p = foundgrps; p; p=p->next) { for (p = foundgrps; p; p=p->next) {
for (i=0; i<NUMGRPFILES; i++) if (p->crcval == internalgrpfiles[i].crcval) break; for (i=0; i<NUMGRPFILES; i++) if (p->crcval == internalgrpfiles[i].crcval) break;
if (i == NUMGRPFILES) continue; if (i == NUMGRPFILES) continue;
[list addObject:[[GrpFile alloc] initWithGrpfile:p andName:[NSString stringWithCString:internalgrpfiles[i].name]]]; [list addObject:[[GrpFile alloc] initWithGrpfile:p andName:[NSString stringWithCString:internalgrpfiles[i].name encoding:NSUTF8StringEncoding]]];
} }
} }
@ -45,8 +47,8 @@
- (int)findIndexForGrpname:(NSString*)grpname - (int)findIndexForGrpname:(NSString*)grpname
{ {
int i; NSUInteger i, listcount = [list count];
for (i=0; i<[list count]; i++) { for (i=0; i<listcount; i++) {
if ([[[list objectAtIndex:i] grpname] isEqual:grpname]) return i; if ([[[list objectAtIndex:i] grpname] isEqual:grpname]) return i;
} }
return -1; return -1;
@ -54,9 +56,11 @@
- (id)tableView:(NSTableView *)aTableView - (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex row:(NSInteger)rowIndex
{ {
NSParameterAssert(rowIndex >= 0 && rowIndex < [list count]); UNREFERENCED_PARAMETER(aTableView);
NSParameterAssert((NSUInteger)rowIndex < [list count]);
switch ([[aTableColumn identifier] intValue]) { switch ([[aTableColumn identifier] intValue]) {
case 0: // name column case 0: // name column
return [[list objectAtIndex:rowIndex] name]; return [[list objectAtIndex:rowIndex] name];
@ -68,6 +72,8 @@
- (int)numberOfRowsInTableView:(NSTableView *)aTableView - (int)numberOfRowsInTableView:(NSTableView *)aTableView
{ {
UNREFERENCED_PARAMETER(aTableView);
return [list count]; return [list count];
} }
@end @end

View file

@ -31,7 +31,7 @@
} }
- (NSString *)grpname - (NSString *)grpname
{ {
return [NSString stringWithCString:(fg->name)]; return [NSString stringWithCString:(fg->name) encoding:NSUTF8StringEncoding];
} }
- (struct grpfile *)entryptr - (struct grpfile *)entryptr
{ {

View file

@ -11240,6 +11240,7 @@ int32_t app_main(int32_t argc, const char **argv)
#ifdef __APPLE__ #ifdef __APPLE__
if (!usecwd) if (!usecwd)
{ {
char cwd[BMAX_PATH];
char *homedir = Bgethomedir(); char *homedir = Bgethomedir();
if (homedir) if (homedir)
Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/eduke32.log", homedir); Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/eduke32.log", homedir);

View file

@ -79,7 +79,7 @@ static struct soundQuality_t {
{ {
int i, mode3d, fullscreen = ([fullscreenButton state] == NSOnState); int i, mode3d, fullscreen = ([fullscreenButton state] == NSOnState);
int idx3d = -1; int idx3d = -1;
int xdim, ydim, bpp; int xdim = 0, ydim = 0, bpp = 0;
if (firstTime) { if (firstTime) {
xdim = settings.xdim3d; xdim = settings.xdim3d;
@ -180,20 +180,27 @@ static struct soundQuality_t {
- (IBAction)alwaysShowClicked:(id)sender - (IBAction)alwaysShowClicked:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
} }
- (IBAction)fullscreenClicked:(id)sender - (IBAction)fullscreenClicked:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
[self populateVideoModes:NO]; [self populateVideoModes:NO];
} }
- (IBAction)cancel:(id)sender - (IBAction)cancel:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
[nsapp abortModal]; [nsapp abortModal];
} }
- (IBAction)start:(id)sender - (IBAction)start:(id)sender
{ {
UNREFERENCED_PARAMETER(sender);
int mode = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue]; int mode = [[modeslist3d objectAtIndex:[videoMode3DPUButton indexOfSelectedItem]] intValue];
if (mode >= 0) { if (mode >= 0) {
settings.xdim3d = validmode[mode].xdim; settings.xdim3d = validmode[mode].xdim;
@ -241,7 +248,7 @@ static struct soundQuality_t {
[[gameList documentView] setDataSource:gamelistsrc]; [[gameList documentView] setDataSource:gamelistsrc];
[[gameList documentView] deselectAll:nil]; [[gameList documentView] deselectAll:nil];
int row = [gamelistsrc findIndexForGrpname:[NSString stringWithCString:settings.selectedgrp]]; int row = [gamelistsrc findIndexForGrpname:[NSString stringWithCString:settings.selectedgrp encoding:NSUTF8StringEncoding]];
if (row >= 0) { if (row >= 0) {
[[gameList documentView] scrollRowToVisible:row]; [[gameList documentView] scrollRowToVisible:row];
#if defined(MAC_OS_X_VERSION_10_3) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3) #if defined(MAC_OS_X_VERSION_10_3) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3)
@ -308,8 +315,6 @@ static StartupWinController *startwin = nil;
int startwin_open(void) int startwin_open(void)
{ {
// PK: is this the entry point?
// fix for "ld: absolute address to symbol _NSApp in a different linkage unit not supported" // fix for "ld: absolute address to symbol _NSApp in a different linkage unit not supported"
// (OS X 10.6) when building for PPC // (OS X 10.6) when building for PPC
nsapp = [NSApplication sharedApplication]; nsapp = [NSApplication sharedApplication];
@ -323,7 +328,7 @@ int startwin_open(void)
static int soundQualityFrequencies[] = { 48000, 44100, 32000, 24000, 22050 }; static int soundQualityFrequencies[] = { 48000, 44100, 32000, 24000, 22050 };
static int soundQualitySampleSizes[] = { 16, 8 }; static int soundQualitySampleSizes[] = { 16, 8 };
static int soundQualityChannels[] = { 2, 1 }; static int soundQualityChannels[] = { 2, 1 };
int f, b, c, i; size_t f, b, c, i;
i = sizeof(soundQualityFrequencies) * i = sizeof(soundQualityFrequencies) *
sizeof(soundQualitySampleSizes) * sizeof(soundQualitySampleSizes) *
@ -373,7 +378,7 @@ int startwin_puts(const char *s)
if (!s) return -1; if (!s) return -1;
if (startwin == nil) return 1; if (startwin == nil) return 1;
ns = [[NSString alloc] initWithCString:s]; ns = [[NSString alloc] initWithUTF8String:s];
[startwin putsMessage:ns]; [startwin putsMessage:ns];
[ns release]; [ns release];
@ -387,7 +392,7 @@ int startwin_settitle(const char *s)
if (!s) return -1; if (!s) return -1;
if (startwin == nil) return 1; if (startwin == nil) return 1;
ns = [[NSString alloc] initWithCString:s]; ns = [[NSString alloc] initWithUTF8String:s];
[startwin setTitle:ns]; [startwin setTitle:ns];
[ns release]; [ns release];
@ -396,6 +401,8 @@ int startwin_settitle(const char *s)
int startwin_idle(void *v) int startwin_idle(void *v)
{ {
UNREFERENCED_PARAMETER(v);
if (startwin) [[startwin window] displayIfNeeded]; if (startwin) [[startwin window] displayIfNeeded];
return 0; return 0;
} }