mirror of
https://github.com/pikami/slstatus.git
synced 2024-11-27 05:45:42 +00:00
radical re-formatting 1/3: Fix spacing
Fixes coding style. Formatting commits suck, incoherent coding style sucks more. https://suckless.org/coding_style/
This commit is contained in:
parent
0696635bcb
commit
2104dc362c
4
arg.h
4
arg.h
@ -13,7 +13,7 @@ extern char *argv0;
|
|||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
for (i_ = 1, argused_ = 0; (*argv)[i_]; i_++) { \
|
for (i_ = 1, argused_ = 0; (*argv)[i_]; i_++) { \
|
||||||
switch((*argv)[i_])
|
switch ((*argv)[i_])
|
||||||
#define ARGEND if (argused_) { \
|
#define ARGEND if (argused_) { \
|
||||||
if ((*argv)[i_ + 1]) { \
|
if ((*argv)[i_ + 1]) { \
|
||||||
break; \
|
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])) : \
|
#define ARGF_(x) (((*argv)[i_ + 1]) ? (argused_ = 1, &((*argv)[i_ + 1])) : \
|
||||||
(*(argv + 1)) ? (argused_ = 1, *(argv + 1)) : (x))
|
(*(argv + 1)) ? (argused_ = 1, *(argv + 1)) : (x))
|
||||||
#define EARGF(x) ARGF_(((x), exit(1), (char *)0))
|
#define EARGF(x) ARGF_(((x), exit(1), (char *)0))
|
||||||
|
@ -226,14 +226,14 @@
|
|||||||
if (sysctlbyname(BATTERY_STATE, &state, &len, NULL, 0) < 0 || !len)
|
if (sysctlbyname(BATTERY_STATE, &state, &len, NULL, 0) < 0 || !len)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
switch(state) {
|
switch (state) {
|
||||||
case 0:
|
case 0: /* FALLTHROUGH */
|
||||||
case 2:
|
case 2:
|
||||||
return "+";
|
return "+";
|
||||||
case 1:
|
case 1:
|
||||||
return "-";
|
return "-";
|
||||||
default:
|
default:
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@
|
|||||||
kvm_t *kd;
|
kvm_t *kd;
|
||||||
|
|
||||||
kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, NULL);
|
kd = kvm_openfiles(NULL, "/dev/null", NULL, 0, NULL);
|
||||||
if(kd == NULL) {
|
if (kd == NULL) {
|
||||||
warn("kvm_openfiles '/dev/null':");
|
warn("kvm_openfiles '/dev/null':");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@
|
|||||||
struct kvm_swap swap_info[1];
|
struct kvm_swap swap_info[1];
|
||||||
long used, total;
|
long used, total;
|
||||||
|
|
||||||
if(!getswapinfo(swap_info, 1))
|
if (!getswapinfo(swap_info, 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
total = swap_info[0].ksw_total;
|
total = swap_info[0].ksw_total;
|
||||||
@ -246,7 +246,7 @@
|
|||||||
struct kvm_swap swap_info[1];
|
struct kvm_swap swap_info[1];
|
||||||
long used, total;
|
long used, total;
|
||||||
|
|
||||||
if(!getswapinfo(swap_info, 1))
|
if (!getswapinfo(swap_info, 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
total = swap_info[0].ksw_total;
|
total = swap_info[0].ksw_total;
|
||||||
@ -261,7 +261,7 @@
|
|||||||
struct kvm_swap swap_info[1];
|
struct kvm_swap swap_info[1];
|
||||||
long total;
|
long total;
|
||||||
|
|
||||||
if(!getswapinfo(swap_info, 1))
|
if (!getswapinfo(swap_info, 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
total = swap_info[0].ksw_total;
|
total = swap_info[0].ksw_total;
|
||||||
@ -275,7 +275,7 @@
|
|||||||
struct kvm_swap swap_info[1];
|
struct kvm_swap swap_info[1];
|
||||||
long used;
|
long used;
|
||||||
|
|
||||||
if(!getswapinfo(swap_info, 1))
|
if (!getswapinfo(swap_info, 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
used = swap_info[0].ksw_used;
|
used = swap_info[0].ksw_used;
|
||||||
|
@ -257,7 +257,7 @@
|
|||||||
fmt = NULL;
|
fmt = NULL;
|
||||||
len = sizeof(ssid);
|
len = sizeof(ssid);
|
||||||
memset(&ssid, 0, len);
|
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))
|
if (len < sizeof(ssid))
|
||||||
len += 1;
|
len += 1;
|
||||||
else
|
else
|
||||||
|
16
slstatus.c
16
slstatus.c
@ -56,14 +56,14 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
sflag = 0;
|
sflag = 0;
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case '1':
|
case '1':
|
||||||
done = 1;
|
done = 1;
|
||||||
/* fallthrough */
|
/* FALLTHROUGH */
|
||||||
case 's':
|
case 's':
|
||||||
sflag = 1;
|
sflag = 1;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
} ARGEND
|
} ARGEND
|
||||||
|
|
||||||
if (argc) {
|
if (argc) {
|
||||||
|
Loading…
Reference in New Issue
Block a user