aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/qtools
diff options
context:
space:
mode:
authorScott Tsai <scottt.tw@gmail.com>2009-03-21 08:17:41 +0800
committerScott Tsai <scottt.tw@gmail.com>2009-03-21 08:17:41 +0800
commit7d281f64a1aacf621f0a7b47c46a6a944fd9e631 (patch)
treee37e257fca1fa731a5b56644faa3c22cb8655753 /emulator/qtools
parentfa602acc7575c3b557f6e8f6aeac569ab99a3655 (diff)
downloadsdk-7d281f64a1aacf621f0a7b47c46a6a944fd9e631.zip
sdk-7d281f64a1aacf621f0a7b47c46a6a944fd9e631.tar.gz
sdk-7d281f64a1aacf621f0a7b47c46a6a944fd9e631.tar.bz2
q2dm: correctly expect the return type of strchr(const char*) to be
'const char*' in C++ so that the code builds on gcc-4.4 ISO C++ overloads strchr() so that strchr(const char*) return 'const char*' and strchr(char *) return 'char *'. Since DmTrace::parseAndAddFunction really wants to write to its 'const char *name' argument I just casted a pointer pointing inside of 'name' to 'char*'
Diffstat (limited to 'emulator/qtools')
-rw-r--r--emulator/qtools/dmtrace.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/emulator/qtools/dmtrace.cpp b/emulator/qtools/dmtrace.cpp
index 66e12a8..c486c5f 100644
--- a/emulator/qtools/dmtrace.cpp
+++ b/emulator/qtools/dmtrace.cpp
@@ -164,7 +164,7 @@ void DmTrace::parseAndAddFunction(int functionId, const char *name)
// sig = "()I"
// Find the first parenthesis, the start of the signature.
- char *paren = strchr(name, '(');
+ char *paren = (char*)strchr(name, '(');
// If not found, then add the original name.
if (paren == NULL) {
@@ -181,7 +181,7 @@ void DmTrace::parseAndAddFunction(int functionId, const char *name)
*paren = 0;
// Search for the last period, the start of the method name
- char *dot = strrchr(name, '.');
+ char *dot = (char*)strrchr(name, '.');
// If not found, then add the original name.
if (dot == NULL || dot == name) {