Linux: Minor fixups!

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1952 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-10-04 09:00:07 +00:00
parent 8ba39b71de
commit db01c15977
7 changed files with 34 additions and 33 deletions

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -229,7 +229,7 @@ This theoretically unoptimizes. Not having much luck so far.
# define __naked // GCC lacks the naked specifier
# define __assume(cond) // GCC has no equivalent for __assume
# define CALLBACK __stdcall
# define CALLBACK __attribute__((stdcall))
// Inlining note: GCC needs ((unused)) attributes defined on inlined functions to suppress
// warnings when a static inlined function isn't used in the scope of a single file (which

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -47,12 +47,12 @@ DEVASSERT_INLINE void pxOnAssert( const wxChar* file, int line, const char* func
#ifdef PCSX2_DEVBUILD
RecursionGuard guard( s_assert_guard );
if( guard.IsReentrant() ) return;
if( wxTheApp == NULL )
{
// Note: Format uses MSVC's syntax for output window hotlinking.
wxsFormat( L"%s(%d): Assertion failed in %s: %s\n",
file, line, fromUTF8(func), msg );
file, line, fromUTF8(func).c_str(), msg );
wxLogError( msg );
}
@ -179,7 +179,7 @@ wxString Exception::StateCrcMismatch::FormatDisplayMessage() const
{
return wxsFormat(
m_message_user + L"\n\n" +
wxsFormat(
wxsFormat(
L"Savestate game/crc mismatch. Cdvd CRC: 0x%X Game CRC: 0x%X\n",
Crc_Savestate, Crc_Cdvd
)

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -92,7 +92,7 @@ void wxDirName::Rmdir()
bool wxDirName::Mkdir()
{
if( Exists() ) return true;
// Recursively create child directories as needed:
wxDirName recurse( *this );
recurse.RemoveLastDir();
@ -173,7 +173,7 @@ wxString Path::GetDirectory( const wxString& src )
// Example /this/that/something.txt -> dest == "/"
wxString Path::GetRootDirectory( const wxString& src )
{
int pos = src.find_first_of( wxFileName::GetPathSeparators() );
size_t pos = src.find_first_of( wxFileName::GetPathSeparators() );
if( pos == wxString::npos )
return wxString();
else

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
const wxRect wxDefaultRect( wxDefaultCoord, wxDefaultCoord, wxDefaultCoord, wxDefaultCoord );
@ -161,7 +161,7 @@ bool TryParse( wxRect& dest, const wxString& src, const wxRect& defval, const wx
dest = defval;
wxStringTokenizer parts( src, separators );
wxPoint point;
wxSize size;
@ -172,7 +172,7 @@ bool TryParse( wxRect& dest, const wxString& src, const wxRect& defval, const wx
return true;
}
// Performs a cross-platform puts operation, which adds CRs to naked LFs on Win32 platforms,
// Performs a cross-platform puts operation, which adds CRs to naked LFs on Win32 platforms,
// so that Notepad won't throw a fit and Rama can read the logs again! On Unix and Mac platforms,
// the input string is written unmodified.
//
@ -187,7 +187,7 @@ void px_fputs( FILE* fp, const char* src )
#ifdef _WIN32
// Windows needs CR's partnered with all newlines, or else notepad.exe can't view
// the stupid logfile. Best way is to write one char at a time.. >_<
const char* curchar = src;
bool prevcr = false;
while( *curchar != 0 )
@ -214,6 +214,6 @@ void px_fputs( FILE* fp, const char* src )
// Linux is happy with plain old LFs. Not sure about Macs... does OSX still
// go by the old school Mac style of using Crs only?
fputs( src, emuLog ); // fputs does not do automatic newlines, so it's ok!
fputs( src, fp ); // fputs does not do automatic newlines, so it's ok!
#endif
}
}

View File

@ -1,6 +1,6 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2009 PCSX2 Dev Team
*
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "Threading.h"
@ -52,7 +52,7 @@ namespace Threading
// against the thread. Extending classes should almost always implement their own
// thread closure process, since any PersistentThread will, by design, not terminate
// unless it has been properly canceled.
//
//
// Thread safetly: This class must not be deleted from its own thread. That would be
// like marrying your sister, and then cheating on her with your daughter.
PersistentThread::~PersistentThread() throw()
@ -222,12 +222,12 @@ namespace Threading
catch( std::logic_error& ex )
{
throw Exception::LogicError( wxsFormat( L"(thread: %s) STL Logic Error: %s\n\t%s",
GetName().c_str(), wxString::FromUTF8( ex.what() ) )
GetName().c_str(), fromUTF8( ex.what() ).c_str() )
);
}
catch( Exception::LogicError& ex )
{
m_except->DiagMsg() = wxsFormat( L"(thread:%s) ", GetName() ) + m_except->DiagMsg();
m_except->DiagMsg() = wxsFormat( L"(thread:%s) ", GetName().c_str() ) + m_except->DiagMsg();
ex.Rethrow();
}
catch( std::runtime_error& ex )
@ -235,25 +235,25 @@ namespace Threading
m_except = new Exception::RuntimeError(
// Diagnostic message:
wxsFormat( L"(thread: %s) STL Runtime Error: %s\n\t%s",
GetName().c_str(), wxString::FromUTF8( ex.what() )
GetName().c_str(), fromUTF8( ex.what() ).c_str()
),
// User Message (not translated, std::exception doesn't have that kind of fancy!
wxsFormat( L"A runtime error occurred in %s:\n\n%s (STL)",
GetName().c_str(), wxString::FromUTF8( ex.what() )
GetName().c_str(), fromUTF8( ex.what() ).c_str()
)
);
}
catch( Exception::RuntimeError& ex )
{
m_except = ex.Clone();
m_except->DiagMsg() = wxsFormat( L"(thread:%s) ", GetName() ) + m_except->DiagMsg();
m_except->DiagMsg() = wxsFormat( L"(thread:%s) ", GetName().c_str() ) + m_except->DiagMsg();
}
}
void PersistentThread::OnStart() {}
void PersistentThread::OnThreadCleanup() {}
void* PersistentThread::_internal_callback( void* itsme )
{
jASSUME( itsme != NULL );
@ -269,17 +269,17 @@ namespace Threading
{
DoSetThreadName( toUTF8(name) );
}
void PersistentThread::DoSetThreadName( __unused const char* name )
{
wxASSERT( IsSelf() ); // only allowed from our own thread, thanks.
#ifdef _WINDOWS_
// This code sample was borrowed form some obscure MSDN article.
// In a rare bout of sanity, it's an actual Micrsoft-published hack
// that actually works!
static const int MS_VC_EXCEPTION = 0x406D1388;
#pragma pack(push,8)
@ -332,7 +332,7 @@ namespace Threading
m_post_TaskComplete.Reset();
m_sem_event.Post();
}
// Blocks current thread execution pending the completion of the parallel task.
void BaseTaskThread::WaitForResult()
{
@ -402,7 +402,7 @@ namespace Threading
// --------------------------------------------------------------------------------------
// Semaphore Implementations
// --------------------------------------------------------------------------------------
Semaphore::Semaphore()
{
sem_init( &sema, false, 0 );
@ -452,7 +452,7 @@ namespace Threading
{
// In order to avoid deadlock we need to make sure we cut some time
// to handle messages.
do {
wxTheApp->Yield();
} while( !Wait( ts_msec_250 ) );

View File

@ -269,6 +269,7 @@
<Unit filename="../gui/AppAssert.cpp" />
<Unit filename="../gui/AppConfig.cpp" />
<Unit filename="../gui/AppConfig.h" />
<Unit filename="../gui/AppInit.cpp" />
<Unit filename="../gui/AppMain.cpp" />
<Unit filename="../gui/AppRes.cpp" />
<Unit filename="../gui/CheckedStaticBox.cpp" />

View File

@ -566,7 +566,7 @@ void Panels::PluginSelectorPanel::EnumThread::ExecuteTask()
DoNextPlugin( curidx );
if( (curidx & 3) == 3 ) wxGetApp().Ping(); // gives the gui thread some time to refresh
pthread_testcancel();
Sleep(150);
//Sleep(150); // uncomment this to slow down the selector, for debugging threading.
}
wxCommandEvent done( pxEVT_EnumerationFinished );