summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authornakeee <nakeee@gmail.com>2009-03-20 15:01:49 +0000
committernakeee <nakeee@gmail.com>2009-03-20 15:01:49 +0000
commitad76edd1571fc447be1c5cc169a029c52bed134b (patch)
treee8e10803b01ca396a4be35243bff9d794f36cb56 /Source/Core
parented70ca6d48333fb4797419506b30c8e9735d4be7 (diff)
Fixed some log messages
Fixed a crash when no game ini exists git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2690 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/IniFile.cpp6
-rw-r--r--Source/Core/Common/Src/IniFile.h2
-rw-r--r--Source/Core/Common/Src/Thread.cpp21
-rw-r--r--Source/Core/Core/Src/HW/CommandProcessor.cpp4
-rw-r--r--Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp6
5 files changed, 16 insertions, 23 deletions
diff --git a/Source/Core/Common/Src/IniFile.cpp b/Source/Core/Common/Src/IniFile.cpp
index 038fe0b1d7..772a822919 100644
--- a/Source/Core/Common/Src/IniFile.cpp
+++ b/Source/Core/Common/Src/IniFile.cpp
@@ -74,7 +74,7 @@ const Section* IniFile::GetSection(const char* sectionName) const
Section* IniFile::GetSection(const char* sectionName)
{
for (std::vector<Section>::iterator iter = sections.begin(); iter != sections.end(); ++iter)
- if (!strcmp(iter->name.c_str(), sectionName))
+ if (!strcasecmp(iter->name.c_str(), sectionName))
return (&(*iter));
return 0;
}
@@ -171,10 +171,10 @@ std::string* IniFile::GetLine(Section* section, const char* key, std::string* va
return 0;
}
-bool IniFile::Exists(const char* sectionName, const char* key)
+bool IniFile::Exists(const char* const sectionName, const char* key) const
{
- const Section* section = GetSection(sectionName);
+ const Section* const section = GetSection(sectionName);
if (!section)
return false;
diff --git a/Source/Core/Common/Src/IniFile.h b/Source/Core/Common/Src/IniFile.h
index 04f6aab246..d55ff54054 100644
--- a/Source/Core/Common/Src/IniFile.h
+++ b/Source/Core/Common/Src/IniFile.h
@@ -58,7 +58,7 @@ public:
void SetLines(const char* sectionName, const std::vector<std::string> &lines);
// Returns true if exists key in section
- bool Exists(const char* sectionName, const char* key);
+ bool Exists(const char* sectionName, const char* key) const;
// getter should be const
bool Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue = "");
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index b4ddb1b5be..d601dfef3c 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -17,6 +17,7 @@
#include "Setup.h"
#include "Thread.h"
+#include "Log.h"
// -----------------------------------------
#ifdef SETUP_TIMER_WAITING
// -----------------
@@ -26,8 +27,6 @@
#endif
// ------------------------
-#define THREAD_DEBUG 1
-
namespace Common
{
#ifdef _WIN32
@@ -373,7 +372,7 @@ CriticalSection::~CriticalSection()
void CriticalSection::Enter()
{
int ret = pthread_mutex_lock(&mutex);
- if (ret) fprintf(stderr, "%s: pthread_mutex_lock(%p) failed: %s\n",
+ if (ret) ERROR_LOG(COMMON, "%s: pthread_mutex_lock(%p) failed: %s\n",
__FUNCTION__, &mutex, strerror(ret));
}
@@ -387,7 +386,7 @@ bool CriticalSection::TryEnter()
void CriticalSection::Leave()
{
int ret = pthread_mutex_unlock(&mutex);
- if (ret) fprintf(stderr, "%s: pthread_mutex_unlock(%p) failed: %s\n",
+ if (ret) ERROR_LOG(COMMON, "%s: pthread_mutex_unlock(%p) failed: %s\n",
__FUNCTION__, &mutex, strerror(ret));
}
@@ -399,12 +398,10 @@ Thread::Thread(ThreadFunc function, void* arg)
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 1024 * 1024);
int ret = pthread_create(&thread_id, &attr, function, arg);
- if (ret) fprintf(stderr, "%s: pthread_create(%p, %p, %p, %p) failed: %s\n",
+ if (ret) ERROR_LOG(COMMON, "%s: pthread_create(%p, %p, %p, %p) failed: %s\n",
__FUNCTION__, &thread_id, &attr, function, arg, strerror(ret));
-#ifdef THREAD_DEBUG
- fprintf(stderr, "created new thread %lu (func=%p, arg=%p)\n", thread_id, function, arg);
-#endif
+ INFO_LOG(COMMON, "created new thread %lu (func=%p, arg=%p)\n", thread_id, function, arg);
}
@@ -420,9 +417,9 @@ void Thread::WaitForDeath()
{
void* exit_status;
int ret = pthread_join(thread_id, &exit_status);
- if (ret) fprintf(stderr, "error joining thread %lu: %s\n", thread_id, strerror(ret));
+ if (ret) ERROR_LOG(COMMON, "error joining thread %lu: %s\n", thread_id, strerror(ret));
if (exit_status)
- fprintf(stderr, "thread %lu exited with status %d\n", thread_id, *(int *)exit_status);
+ ERROR_LOG(COMMON, "thread %lu exited with status %d\n", thread_id, *(int *)exit_status);
thread_id = 0;
}
}
@@ -480,9 +477,7 @@ void SleepCurrentThread(int ms)
void SetCurrentThreadName(const TCHAR* szThreadName)
{
pthread_setspecific(threadname_key, strdup(szThreadName));
-#ifdef THREAD_DEBUG
- fprintf(stderr, "%s(%s)\n", __FUNCTION__, szThreadName);
-#endif
+ INFO_LOG(COMMON, "%s(%s)\n", __FUNCTION__, szThreadName);
}
diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp
index 2ee79e4dad..5ac5ad6aca 100644
--- a/Source/Core/Core/Src/HW/CommandProcessor.cpp
+++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp
@@ -377,13 +377,13 @@ void Write16(const u16 _Value, const u32 _Address)
" - Anyway, fifo flush will be forced if you press OK and dolphin might continue to work...\n"
" - We aren't betting on that :)", fifo.CPReadWriteDistance);
*/
- WARN_LOG(COMMANDPROCESSOR, "*********************** GXSetGPFifo very soon? ***********************");
+ DEBUG_LOG(COMMANDPROCESSOR, "*********************** GXSetGPFifo very soon? ***********************");
u32 ct=0;
// (mb2) We don't sleep here since it could be a perf issue for super monkey ball (yup only this game IIRC)
// Touching that game is a no-go so I don't want to take the risk :p
while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > 0 )
ct++;
- if (ct) {WARN_LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);}
+ if (ct) {INFO_LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);}
}
}
diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
index 8a2455875f..e31db78ba5 100644
--- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
+++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
@@ -109,7 +109,7 @@ CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
}
else
{
- ERROR_LOG(WII_IPC_FILEIO, " failed - File doesn't exist");
+ ERROR_LOG(WII_IPC_FILEIO, " FileIO failed open: %s - File doesn't exist", m_Filename.c_str());
ReturnValue = -106;
}
@@ -155,10 +155,9 @@ CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
// What should we return for Zelda, the new correct or old incorrect seek position?
ReturnValue = SeekPosition;
} else {
- ERROR_LOG(WII_IPC_FILEIO, "FILEIO: Seek failed");
+ ERROR_LOG(WII_IPC_FILEIO, "FILEIO: Seek failed - %s", GetDeviceName().c_str());
}
} else {
- ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_FileIO unsupported seek mode %i", Mode);
PanicAlert("CWII_IPC_HLE_Device_FileIO unsupported seek mode %i", Mode);
}
@@ -241,7 +240,6 @@ CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress)
default:
{
- ERROR_LOG(WII_IPC_FILEIO, "CWII_IPC_HLE_Device_FileIO: Parameter %i", Parameter);
PanicAlert("CWII_IPC_HLE_Device_FileIO: Parameter %i", Parameter);
}
break;