summaryrefslogtreecommitdiffstats
path: root/tools/idevicesyslog.c
diff options
context:
space:
mode:
authorGravatar Rosen Penev2020-12-23 17:39:01 -0800
committerGravatar Nikias Bassen2022-04-30 13:34:21 +0200
commitcf2c7d48380969200034afeab93169e68c34c397 (patch)
treea96f518be279922d00898a3ce81dc0ff483a40b2 /tools/idevicesyslog.c
parent6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (diff)
downloadlibimobiledevice-cf2c7d48380969200034afeab93169e68c34c397.tar.gz
libimobiledevice-cf2c7d48380969200034afeab93169e68c34c397.tar.bz2
[clang-tidy] Do not use else after return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'tools/idevicesyslog.c')
-rw-r--r--tools/idevicesyslog.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c
index 2a72d72..f85c7cc 100644
--- a/tools/idevicesyslog.c
+++ b/tools/idevicesyslog.c
@@ -151,7 +151,9 @@ static void syslog_callback(char c, void *user_data)
shall_print = 1;
cprintf(COLOR_WHITE);
break;
- } else if (line[3] == ' ' && line[6] == ' ' && line[15] == ' ') {
+ }
+
+ if (line[3] == ' ' && line[6] == ' ' && line[15] == ' ') {
char* end = &line[lp];
char* p = &line[16];
@@ -190,10 +192,9 @@ static void syslog_callback(char c, void *user_data)
if (!found) {
shall_print = 0;
break;
- } else {
- triggered = 1;
- shall_print = 1;
}
+ triggered = 1;
+ shall_print = 1;
} else if (num_trigger_filters == 0 && num_untrigger_filters > 0 && !triggered) {
shall_print = 0;
quit_flag++;
@@ -213,9 +214,8 @@ static void syslog_callback(char c, void *user_data)
if (!found) {
shall_print = 0;
break;
- } else {
- shall_print = 1;
}
+ shall_print = 1;
}
/* process name */
@@ -430,7 +430,8 @@ static void device_event_cb(const idevice_event_t* event, void* userdata)
{
if (use_network && event->conn_type != CONNECTION_NETWORK) {
return;
- } else if (!use_network && event->conn_type != CONNECTION_USBMUXD) {
+ }
+ if (!use_network && event->conn_type != CONNECTION_USBMUXD) {
return;
}
if (event->event == IDEVICE_DEVICE_ADD) {
@@ -656,7 +657,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "ERROR: -p and -e/-q cannot be used together.\n");
print_usage(argc, argv, 1);
return 2;
- } else if (include_filter > 0 && exclude_kernel > 0) {
+ }
+ if (include_filter > 0 && exclude_kernel > 0) {
fprintf(stderr, "ERROR: -p and -K cannot be used together.\n");
print_usage(argc, argv, 1);
return 2;
@@ -699,9 +701,9 @@ int main(int argc, char *argv[])
if (!udid) {
fprintf(stderr, "No device found. Plug in a device or pass UDID with -u to wait for device to be available.\n");
return -1;
- } else {
- fprintf(stderr, "Waiting for device with UDID %s to become available...\n", udid);
}
+
+ fprintf(stderr, "Waiting for device with UDID %s to become available...\n", udid);
}
line_buffer_size = 1024;