Correctly expect the return value of rindex(const char*) to be of type
'const char*' to make the code build on gcc-4.4.
The C++ spec overloads string fucntions like strtsr and rindex so that
rindex(char *) returns 'char*' and rindex(const char*) returns 'const
char*'.
Without this patch you get an "invalid conversion from ‘const char*’ to
‘char*’" error on gcc-4.4
diff --git a/emulator/qtools/trace_reader.cpp b/emulator/qtools/trace_reader.cpp
index b38c0b4..0bf64dd 100644
--- a/emulator/qtools/trace_reader.cpp
+++ b/emulator/qtools/trace_reader.cpp
@@ -1009,10 +1009,10 @@
// be freed by the caller after it is no longer needed.
static char *ExtractDexPathFromMmap(const char *mmap_path)
{
- char *end = rindex(mmap_path, '@');
+ const char *end = rindex(mmap_path, '@');
if (end == NULL)
return NULL;
- char *start = rindex(mmap_path, '/');
+ const char *start = rindex(mmap_path, '/');
if (start == NULL)
return NULL;
int len = end - start;