This commit is contained in:
Steve Checkoway
2005-10-31 21:28:53 +00:00
parent 6a7cf6be38
commit 4df02ed98d
8 changed files with 47 additions and 59 deletions
+4 -8
View File
@@ -1,13 +1,9 @@
#import <Cocoa/Cocoa.h>
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 )
{
@@ -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 );
@@ -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;
}
+2 -4
View File
@@ -2,11 +2,9 @@
#include <OpenGl/OpenGl.h>
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) );
}
/*
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef VSYNC_H
#define VSYNC_H
bool wglSwapIntervalEXT(int swapInterval);
bool wglSwapIntervalEXT( int swapInterval );
#endif
@@ -1,6 +1,3 @@
#import <Cocoa/Cocoa.h>
#import <assert.h>
void SM_ShowCursor( bool b )
{
if( b )
+24 -25
View File
@@ -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<mbstate_t> as per clause 27.2--whatever that is.
*/
/*
* streampos and wstreampos are both required to be typedefs for
* fpos<mbstate_t> 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 );
}
};
+14 -14
View File
@@ -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<n; ++i, ++ws)
if (*ws == wc)
for( unsigned i=0; i<n; ++i, ++ws )
if( *ws == wc )
return (wchar_t *)ws;
return NULL;
}
#endif
#if ! _GLIBCPP_HAVE_WMEMCMP
int wmemcmp(const wchar_t *ws1, const wchar_t *ws2, size_t n)
int wmemcmp( const wchar_t *ws1, const wchar_t *ws2, size_t n )
{
for (unsigned i=0; i<n; ++i, ++ws1, ++ws2)
if (*ws1 != *ws2)
for( unsigned i=0; i<n; ++i, ++ws1, ++ws2 )
if( *ws1 != *ws2 )
return *ws1 - *ws2;
return 0;
}
#endif
#if ! _GLIBCPP_HAVE_WMEMCPY
wchar_t *wmemcpy(wchar_t *ws1, const wchar_t *ws2, size_t n)
wchar_t *wmemcpy( wchar_t *ws1, const wchar_t *ws2, size_t n )
{
return (wchar_t *)memcpy(ws1, ws2, n * sizeof(wchar_t));
return (wchar_t *)memcpy( ws1, ws2, n * sizeof(wchar_t) );
}
#endif
#if ! _GLIBCPP_HAVE_WMEMMOVE
wchar_t *wmemmove(wchar_t *ws1, const wchar_t *ws2, size_t n)
wchar_t *wmemmove( wchar_t *ws1, const wchar_t *ws2, size_t n )
{
return (wchar_t *)memmove(ws1, ws2, n * sizeof(wchar_t));
return (wchar_t *)memmove( ws1, ws2, n * sizeof(wchar_t) );
}
#endif
#if ! _GLIBCPP_HAVE_WMEMSET
wchar_t *wmemset(wchar_t *ws , wchar_t wc, size_t n)
wchar_t *wmemset( wchar_t *ws , wchar_t wc, size_t n )
{
wchar_t *temp = ws;
for (unsigned i=0; i<n; ++i, ++temp)
for( unsigned i=0; i<n; ++i, ++temp )
*temp = wc;
return ws;
}