summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrkhsh <me@drkhsh.at>2022-10-28 00:49:31 +0200
committerRafael Marçalo <raroma09@gmail.com>2022-10-28 22:22:49 +0100
commit35249fb0feb52a7fcaab2d2322c073b042c68453 (patch)
tree9c464c22ccea5000d888e98c3ce187340eda23aa
parenta50807c7c0e07d399ee4d4224306f2eb5bba413d (diff)
radical re-formatting 1/3: Fix spacing
Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
-rw-r--r--arg.h4
-rw-r--r--components/battery.c16
-rw-r--r--components/swap.c10
-rw-r--r--components/wifi.c2
-rw-r--r--slstatus.c16
5 files changed, 24 insertions, 24 deletions
diff --git a/arg.h b/arg.h
index e0adb9f..5f1f408 100644
--- a/arg.h
+++ b/arg.h
@@ -13,7 +13,7 @@ extern char *argv0;
break; \
} \
for (i_ = 1, argused_ = 0; (*argv)[i_]; i_++) { \
- switch((*argv)[i_])
+ switch ((*argv)[i_])
#define ARGEND if (argused_) { \
if ((*argv)[i_ + 1]) { \
break; \
@@ -24,7 +24,7 @@ extern char *argv0;
} \
} \
}
-#define ARGC() ((*argv)[i_])
+#define ARGC() ((*argv)[i_])
#define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1, &((*argv)[i_ + 1])) : \
(*(argv + 1)) ? (argused_ = 1, *(argv + 1)) : (x))
#define EARGF(x) ARGF_(((x), exit(1), (char *)0))
diff --git a/components/battery.c b/components/battery.c
index 3746095..00ae70a 100644
--- a/components/battery.c
+++ b/components/battery.c
@@ -226,14 +226,14 @@
if (sysctlbyname(BATTERY_STATE, &state, &len, NULL, 0) < 0 || !len)
return NULL;
- switch(state) {
- case 0:
- case 2:
- return "+";
- case 1:
- return "-";
- default:
- return "?";
+ switch (state) {
+ case 0: /* FALLTHROUGH */
+ case 2:
+ return "+";
+ case 1:
+ return "-";
+ default:
+ return "?";
}
}
diff --git a/components/swap.c b/components/swap.c
index 523d9cd..7ae0c7f 100644
--- a/components/swap.c
+++ b/components/swap.c
@@ -210,7 +210,7 @@
kvm_t *kd;
kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, NULL);
- if(kd == NULL) {
+ if (kd == NULL) {
warn("kvm_openfiles '/dev/null':");
return 0;
}
@@ -231,7 +231,7 @@
struct kvm_swap swap_info[1];
long used, total;
- if(!getswapinfo(swap_info, 1))
+ if (!getswapinfo(swap_info, 1))
return NULL;
total = swap_info[0].ksw_total;
@@ -246,7 +246,7 @@
struct kvm_swap swap_info[1];
long used, total;
- if(!getswapinfo(swap_info, 1))
+ if (!getswapinfo(swap_info, 1))
return NULL;
total = swap_info[0].ksw_total;
@@ -261,7 +261,7 @@
struct kvm_swap swap_info[1];
long total;
- if(!getswapinfo(swap_info, 1))
+ if (!getswapinfo(swap_info, 1))
return NULL;
total = swap_info[0].ksw_total;
@@ -275,7 +275,7 @@
struct kvm_swap swap_info[1];
long used;
- if(!getswapinfo(swap_info, 1))
+ if (!getswapinfo(swap_info, 1))
return NULL;
used = swap_info[0].ksw_used;
diff --git a/components/wifi.c b/components/wifi.c
index d75a613..a20e8d4 100644
--- a/components/wifi.c
+++ b/components/wifi.c
@@ -257,7 +257,7 @@
fmt = NULL;
len = sizeof(ssid);
memset(&ssid, 0, len);
- if (load_ieee80211req(sockfd, interface, &ssid, IEEE80211_IOC_SSID, &len )) {
+ if (load_ieee80211req(sockfd, interface, &ssid, IEEE80211_IOC_SSID, &len)) {
if (len < sizeof(ssid))
len += 1;
else
diff --git a/slstatus.c b/slstatus.c
index 8fe5b44..a8ac28e 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -56,14 +56,14 @@ main(int argc, char *argv[])
sflag = 0;
ARGBEGIN {
- case '1':
- done = 1;
- /* fallthrough */
- case 's':
- sflag = 1;
- break;
- default:
- usage();
+ case '1':
+ done = 1;
+ /* FALLTHROUGH */
+ case 's':
+ sflag = 1;
+ break;
+ default:
+ usage();
} ARGEND
if (argc) {