summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-08-18 11:17:20 -0700
committerJack Palevich <jackpal@google.com>2009-08-18 11:17:20 -0700
commit632ca4c55226c689de2194b3291897784df6070e (patch)
tree244856b2328138bff954f004df15a8f37eb6ded6
parent7793e23e0420919c2970edc4a2ace1aabc3ed385 (diff)
downloadexternal_webkit-632ca4c55226c689de2194b3291897784df6070e.zip
external_webkit-632ca4c55226c689de2194b3291897784df6070e.tar.gz
external_webkit-632ca4c55226c689de2194b3291897784df6070e.tar.bz2
Fix errors when compiled under g++ 4.4.1 on Ubuntu 9.10a4
This environment ends up using the C++ version of strrchr rather than the C version. Apparently older environments use the C version of strrchr. I'm guessing the change is due to one of the standard C++ header files changing so that includes the new C++ version of strrchr. The difference is that the C version of strrchr is: char* strrchr(const char*, char); while the C++ version of strrchr is overloaded: const char* strrchr(const char*, char); char* strrchr(char*, char); This code depended on the C version to convert a const char* pointer into a non-const char* pointer. The fix is to change the code to work with a const char* result, and if that is not possible, manually insert a hard cast of the return value.
-rw-r--r--WebKitTools/android/webkitmerge/webkitmerge.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/WebKitTools/android/webkitmerge/webkitmerge.cpp b/WebKitTools/android/webkitmerge/webkitmerge.cpp
index c769f5a..22eeb54 100644
--- a/WebKitTools/android/webkitmerge/webkitmerge.cpp
+++ b/WebKitTools/android/webkitmerge/webkitmerge.cpp
@@ -1159,7 +1159,7 @@ void CompareDirs(const char* workingDir, bool renamePass)
workingDir, oldFile);
if (sandOrder < 0 && renamePass == false) {
// file added by android -- should always have name 'android?'
- char* android = strstr(sandFile, "ndroid");
+ const char* android = strstr(sandFile, "ndroid");
if (android == NULL)
fprintf(stderr, "warning: expect added %s to contain 'android': %s/%s\n",
sandDir ? "directory" : "file" , workingDir, sandFile);
@@ -1202,7 +1202,7 @@ void CompareDirs(const char* workingDir, bool renamePass)
if (iter != renameMap.end()) {
string newName = renameMap[rename];
renamedDir = newName.c_str();
- char* renamed = strrchr(renamedDir, '/');
+ char* renamed = (char*) strrchr(renamedDir, '/');
*renamed++ = '\0'; // splits rename into two strings
if (options.emitPerforceCommands) {
fprintf(commandFile, "p4 integrate \"%s/%s/%s\" \"%s/%s/%s\"\n", sandboxCmd, workingDir, oldFile,