diff --git a/stepmania/src/archutils/Darwin/Crash.m b/stepmania/src/archutils/Darwin/Crash.m index f4f1f76048..9d5f3da11a 100644 --- a/stepmania/src/archutils/Darwin/Crash.m +++ b/stepmania/src/archutils/Darwin/Crash.m @@ -1,13 +1,9 @@ -#import - void InformUserOfCrash( const char *sPath ) { - int ret = NSRunAlertPanel(@"StepMania has crashed", - @"StepMania has crashed. Debugging information " - @"has been output to\n\n%s\n\nPlease file a bug " - @"report at\n\nhttp://sf.net/tracker/?func=add&" - @"group_id=37892&atid=421366", - @"Open crashinfo.txt", @"Quit", nil, sPath); + NSString *s = @"StepMania has crashed. Debugging information has been output to\n\n%s\n\n" + @"Please file a bug report at\n\nhttp://sf.net/tracker/?func=add&group_id=37892&atid=421366"; + + int ret = NSRunAlertPanel( @"StepMania has crashed", s, @"Open crashinfo.txt", @"Quit", nil, sPath ); if( ret == NSAlertDefaultReturn ) { diff --git a/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp b/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp index 6c7529b2e8..91b02e5f46 100644 --- a/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp +++ b/stepmania/src/archutils/Darwin/DarwinThreadHelpers.cpp @@ -23,7 +23,7 @@ uint64_t GetCurrentThreadId() bool GetThreadBacktraceContext( uint64_t iID, BacktraceContext *ctx ) { /* Can't GetThreadBacktraceContext the current thread. */ - ASSERT(iID != GetCurrentThreadId()); + ASSERT( iID != GetCurrentThreadId() ); SuspendThread( iID ); diff --git a/stepmania/src/archutils/Darwin/PreferredLanguage.m b/stepmania/src/archutils/Darwin/PreferredLanguage.m index ba887869fd..80f522b6e0 100644 --- a/stepmania/src/archutils/Darwin/PreferredLanguage.m +++ b/stepmania/src/archutils/Darwin/PreferredLanguage.m @@ -1,5 +1,3 @@ -#import "Cocoa/Cocoa.h" - char *GetPreferredLanguage() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @@ -8,7 +6,7 @@ char *GetPreferredLanguage() const char *lang = [[languages objectAtIndex:0] UTF8String]; char *ret = (char *)malloc( strlen(lang) + 1 ); - strcpy(ret, lang); + strcpy( ret, lang ); [pool release]; return ret; } diff --git a/stepmania/src/archutils/Darwin/Vsync.cpp b/stepmania/src/archutils/Darwin/Vsync.cpp index ce2bb40e43..9cb3c7ccfe 100644 --- a/stepmania/src/archutils/Darwin/Vsync.cpp +++ b/stepmania/src/archutils/Darwin/Vsync.cpp @@ -2,11 +2,9 @@ #include -bool wglSwapIntervalEXT(int swapInterval) +bool wglSwapIntervalEXT( int swapInterval ) { - /* I really have no idea what the expected return value for success. If it was an int - * I would return 0, since it is a bool, I'm going to guess that true is success. */ - return !CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, (long*)(&swapInterval)); + return !CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, (long*)(&swapInterval) ); } /* diff --git a/stepmania/src/archutils/Darwin/Vsync.h b/stepmania/src/archutils/Darwin/Vsync.h index 61a65e6495..d42c7ca533 100644 --- a/stepmania/src/archutils/Darwin/Vsync.h +++ b/stepmania/src/archutils/Darwin/Vsync.h @@ -1,7 +1,7 @@ #ifndef VSYNC_H #define VSYNC_H -bool wglSwapIntervalEXT(int swapInterval); +bool wglSwapIntervalEXT( int swapInterval ); #endif diff --git a/stepmania/src/archutils/Darwin/WindowHelper.m b/stepmania/src/archutils/Darwin/WindowHelper.m index aceecb6fcb..24a531273a 100644 --- a/stepmania/src/archutils/Darwin/WindowHelper.m +++ b/stepmania/src/archutils/Darwin/WindowHelper.m @@ -1,6 +1,3 @@ -#import -#import - void SM_ShowCursor( bool b ) { if( b ) diff --git a/stepmania/src/archutils/Darwin/arch_setup.h b/stepmania/src/archutils/Darwin/arch_setup.h index 81bdd5ca83..85a38c54ee 100644 --- a/stepmania/src/archutils/Darwin/arch_setup.h +++ b/stepmania/src/archutils/Darwin/arch_setup.h @@ -75,7 +75,7 @@ typedef unsigned long long UInt64; #if _GLIBCPP_USE_C99 # define NEED_CSTDLIB_WORKAROUND #else -inline int64_t llabs(int64_t x) { return x < 0LL ? -x : x; } +inline int64_t llabs( int64_t x ) { return x < 0LL ? -x : x; } /* This is not correct. It's possible that _GLIBCPP_USE_C99 could be false * and yet have socklen_t defined. In the BSD world, this seems to come from @@ -107,12 +107,12 @@ typedef int socklen_t; extern "C" { - extern size_t wcslen(const wchar_t *ws); - extern wchar_t *wmemchr(const wchar_t *ws, wchar_t wc, size_t n); - extern int wmemcmp(const wchar_t *ws1, const wchar_t *ws2, size_t n); - extern wchar_t *wmemcpy(wchar_t *ws1, const wchar_t *ws2, size_t n); - extern wchar_t *wmemmove(wchar_t *ws1, const wchar_t *ws2, size_t n); - extern wchar_t *wmemset(wchar_t *ws , wchar_t wc, size_t n); + extern size_t wcslen( const wchar_t *ws ); + extern wchar_t *wmemchr( const wchar_t *ws, wchar_t wc, size_t n ); + extern int wmemcmp( const wchar_t *ws1, const wchar_t *ws2, size_t n ); + extern wchar_t *wmemcpy( wchar_t *ws1, const wchar_t *ws2, size_t n ); + extern wchar_t *wmemmove( wchar_t *ws1, const wchar_t *ws2, size_t n ); + extern wchar_t *wmemset( wchar_t *ws , wchar_t wc, size_t n ); } // C++ defines the wchar_t type even if glibc++ doesn't have the functions namespace std @@ -125,48 +125,47 @@ namespace std { typedef wchar_t char_type; typedef wchar_t int_type; // it's big enough - /* streampos and wstreampos are both required to be typedefs for - * fpos as per clause 27.2--whatever that is. - */ + /* + * streampos and wstreampos are both required to be typedefs for + * fpos as per clause 27.2--whatever that is. + */ typedef streampos pos_type; typedef streamoff off_type; typedef mbstate_t state_type; - static void assign(char_type& c1, const char_type c2) + static void assign( char_type& c1, const char_type c2 ) { c1 = c2; } - static void assign(char_type *s, size_t n, char_type c) + static void assign( char_type *s, size_t n, char_type c ) { - wmemset(s, c, n); + wmemset( s, c, n ); } - static int compare(const char_type *s1, const char_type *s2, - size_t n) + static int compare( const char_type *s1, const char_type *s2, size_t n ) { - return wmemcmp(s1, s2, n); + return wmemcmp( s1, s2, n ); } - static char_type *copy(char_type *s1, const char_type *s2, size_t n) + static char_type *copy( char_type *s1, const char_type *s2, size_t n ) { - return wmemcpy(s1, s2, n); + return wmemcpy( s1, s2, n ); } - static const char_type *find(const char_type *s, size_t n, - const char_type& c) + static const char_type *find( const char_type *s, size_t n, const char_type& c ) { - return wmemchr(s, c, n); + return wmemchr( s, c, n ); } - static size_t length(const char_type *s) + static size_t length( const char_type *s ) { - return wcslen(s); + return wcslen( s ); } - static char_type *move(char_type *s1, const char_type *s2, size_t n) + static char_type *move( char_type *s1, const char_type *s2, size_t n ) { - return wmemmove(s1, s2, n); + return wmemmove( s1, s2, n ); } }; diff --git a/stepmania/src/archutils/Darwin/wchar.cpp b/stepmania/src/archutils/Darwin/wchar.cpp index a588a59af1..3f8cb9ca24 100644 --- a/stepmania/src/archutils/Darwin/wchar.cpp +++ b/stepmania/src/archutils/Darwin/wchar.cpp @@ -4,55 +4,55 @@ extern "C" { #if ! _GLIBCPP_HAVE_WCLEN -size_t wcslen(const wchar_t *ws) +size_t wcslen( const wchar_t *ws ) { size_t n = 0; - while (*(ws++) != L'\0') + while( *(ws++) != L'\0' ) ++n; return n; } #endif #if ! _GLIBCPP_HAVE_WMEMCHR -wchar_t *wmemchr(const wchar_t *ws, wchar_t wc, size_t n) +wchar_t *wmemchr( const wchar_t *ws, wchar_t wc, size_t n ) { - for (unsigned i=0; i