From eda65f5f60c01a6eb4f2e9e7ff79c59fe755c2f7 Mon Sep 17 00:00:00 2001 From: Scott Tsai Date: Sat, 21 Mar 2009 08:17:41 +0800 Subject: [PATCH] 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*' --- emulator/qtools/dmtrace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emulator/qtools/dmtrace.cpp b/emulator/qtools/dmtrace.cpp index 66e12a85e..c486c5fe9 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) {