summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-01-07 18:08:42 +0100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-01-07 18:08:42 +0100
commit2f1d4619dcdd9c124dbde7175654668fc6115bbb (patch)
treea99e22188875788dafe8e5f6660f68c4545c50c3
parent57f1debb3f1e615a4888fa83b9613920dd53ca6c (diff)
downloadsystem_core-2f1d4619dcdd9c124dbde7175654668fc6115bbb.zip
system_core-2f1d4619dcdd9c124dbde7175654668fc6115bbb.tar.gz
system_core-2f1d4619dcdd9c124dbde7175654668fc6115bbb.tar.bz2
strrchr() returns const char*, so casting is necessary
fixes build errors with custom toolchain Change-Id: I6aeddf8007a467b3e08af0e86d0016db7dd8ac9e Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
-rw-r--r--adb/adb.cpp6
-rw-r--r--adb/commandline.cpp6
-rw-r--r--adb/sysdeps.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/adb/adb.cpp b/adb/adb.cpp
index f64b19f..0ff9e3c 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -726,15 +726,15 @@ int handle_forward_request(const char* service, transport_type ttype, char* seri
int createForward = strncmp(service, "kill", 4);
int no_rebind = 0;
- local = strchr(service, ':') + 1;
+ local = (char*) strchr(service, ':') + 1;
// Handle forward:norebind:<local>... here
if (createForward && !strncmp(local, "norebind:", 9)) {
no_rebind = 1;
- local = strchr(local, ':') + 1;
+ local = (char*) strchr(local, ':') + 1;
}
- remote = strchr(local,';');
+ remote = (char*) strchr(local,';');
if (createForward) {
// Check forward: parameter format: '<local>;<remote>'
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index d38588f..cd635ce 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -463,7 +463,7 @@ static int adb_download_buffer(const char *service, const char *fn, const void*
const uint8_t* ptr = reinterpret_cast<const uint8_t*>(data);
if (show_progress) {
- char *x = strrchr(service, ':');
+ char *x = (char*) strrchr(service, ':');
if(x) service = x + 1;
}
@@ -1569,7 +1569,7 @@ static int install_app(transport_type transport, const char* serial, int argc,
int last_apk = -1;
for (i = argc - 1; i >= 0; i--) {
const char* file = argv[i];
- char* dot = strrchr(file, '.');
+ char* dot = (char*) strrchr(file, '.');
if (dot && !strcasecmp(dot, ".apk")) {
if (stat(file, &sb) == -1 || !S_ISREG(sb.st_mode)) {
fprintf(stderr, "Invalid APK file: %s\n", file);
@@ -1615,7 +1615,7 @@ static int install_multiple_app(transport_type transport, const char* serial, in
int first_apk = -1;
for (i = argc - 1; i >= 0; i--) {
const char* file = argv[i];
- char* dot = strrchr(file, '.');
+ char* dot = (char*) strrchr(file, '.');
if (dot && !strcasecmp(dot, ".apk")) {
if (stat(file, &sb) == -1 || !S_ISREG(sb.st_mode)) {
fprintf(stderr, "Invalid APK file: %s\n", file);
diff --git a/adb/sysdeps.h b/adb/sysdeps.h
index 59e5b0b..3550a44 100644
--- a/adb/sysdeps.h
+++ b/adb/sysdeps.h
@@ -502,12 +502,12 @@ static __inline__ void adb_sysdeps_init(void)
static __inline__ char* adb_dirstart(const char* path)
{
- return strchr(path, '/');
+ return (char*) strrchr(path, '/');
}
static __inline__ char* adb_dirstop(const char* path)
{
- return strrchr(path, '/');
+ return (char*) strrchr(path, '/');
}
static __inline__ int adb_is_absolute_host_path( const char* path )