Skip to content

Display and control your Android device

Fix discarded-qualifiers warnings

Saifulb64b5339eae8
diff --git a/app/src/adb/adb.c b/app/src/adb/adb.c
index e388d862..2dc44085 100644
--- a/app/src/adb/adb.c
+++ b/app/src/adb/adb.c
@@ -480,10 +480,10 @@ sc_adb_accept_device(const struct sc_adb_device *device,
return true;
case SC_ADB_DEVICE_SELECT_SERIAL:
assert(selector->serial);
- char *device_serial_colon = strchr(device->serial, ':');
+ const char *device_serial_colon = strchr(device->serial, ':');
if (device_serial_colon) {
// The device serial is an IP:port...
- char *serial_colon = strchr(selector->serial, ':');
+ const char *serial_colon = strchr(selector->serial, ':');
if (!serial_colon) {
// But the requested serial has no ':', so only consider
// the IP part of the device serial. This allows to use
diff --git a/app/src/cli.c b/app/src/cli.c
index 1624c293..5fffcbe2 100644
--- a/app/src/cli.c
+++ b/app/src/cli.c
@@ -1917,7 +1917,7 @@ parse_shortcut_mods(const char *s, uint8_t *shortcut_mods) {
// A list of shortcut modifiers, for example "lctrl,rctrl,rsuper"
for (;;) {
- char *comma = strchr(s, ',');
+ const char *comma = strchr(s, ',');
assert(!comma || comma > s);
size_t limit = comma ? (size_t) (comma - s) : strlen(s);
diff --git a/app/src/util/str.c b/app/src/util/str.c
index c4f04b55..17dd19fe 100644
--- a/app/src/util/str.c
+++ b/app/src/util/str.c
@@ -154,7 +154,7 @@ sc_str_parse_integer_with_suffix(const char *s, long *out) {
bool
sc_str_list_contains(const char *list, char sep, const char *s) {
- char *p;
+ const char *p;
do {
p = strchr(list, sep);