summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-01-07 18:08:42 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-08-25 18:26:58 +0200
commitab3b19e4fe97a19d7a19a4a53292230876903643 (patch)
tree4b8d49a05d793aea3a5a1a8634ba866d7094d020
parentb6e95a58fe9109ea8aa6878535267df90dd39455 (diff)
downloadsystem_core-ab3b19e4fe97a19d7a19a4a53292230876903643.tar.gz
system_core-ab3b19e4fe97a19d7a19a4a53292230876903643.tar.bz2
system_core-ab3b19e4fe97a19d7a19a4a53292230876903643.zip
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 c09aee357..9f9e6bdfe 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 26eea2ff9..eb0c84b6f 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;
}
@@ -1571,7 +1571,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);
@@ -1617,7 +1617,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 59e5b0b3d..3550a44c4 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 )