[hackers] [slstatus] Clean up header includes || Aaron Marcher
commit b0401b13bb78bacde9d10b00766830cbeb2c90f6
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Wed May 30 19:35:37 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Wed May 30 19:35:37 2018 +0200
Clean up header includes
- Remove <errno.h> because related functions are in util.c now
- Remove corresponding <string.h> if not used otherwise
diff --git a/components/battery.c b/components/battery.c
index 8bfe42a..99e09d5 100644
--- a/components/battery.c
+++ b/components/battery.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
#include <string.h>
diff --git a/components/cpu.c b/components/cpu.c
index ecd45a6..cd5ebe4 100644
--- a/components/cpu.c
+++ b/components/cpu.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
#include <string.h>
diff --git a/components/disk.c b/components/disk.c
index f3c96d5..9d2284e 100644
--- a/components/disk.c
+++ b/components/disk.c
_AT_@ -1,7 +1,5 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
-#include <string.h>
#include <sys/statvfs.h>
#include "../util.h"
diff --git a/components/hostname.c b/components/hostname.c
index dc3bbf1..23da677 100644
--- a/components/hostname.c
+++ b/components/hostname.c
_AT_@ -1,7 +1,5 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
-#include <string.h>
#include <unistd.h>
#include "../util.h"
diff --git a/components/ip.c b/components/ip.c
index 468dc84..f26e49a 100644
--- a/components/ip.c
+++ b/components/ip.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <stdio.h>
diff --git a/components/kernel_release.c b/components/kernel_release.c
index 531014c..0457301 100644
--- a/components/kernel_release.c
+++ b/components/kernel_release.c
_AT_@ -1,8 +1,6 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <sys/utsname.h>
#include <stdio.h>
-#include <string.h>
#include "../util.h"
diff --git a/components/num_files.c b/components/num_files.c
index 9179037..86ea064 100644
--- a/components/num_files.c
+++ b/components/num_files.c
_AT_@ -1,6 +1,5 @@
/* See LICENSE file for copyright and license details. */
#include <dirent.h>
-#include <errno.h>
#include <stdio.h>
#include <string.h>
diff --git a/components/run_command.c b/components/run_command.c
index 7ae1b69..e00b478 100644
--- a/components/run_command.c
+++ b/components/run_command.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
#include <string.h>
diff --git a/components/swap.c b/components/swap.c
index 9bd599a..b3b519e 100644
--- a/components/swap.c
+++ b/components/swap.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/components/temperature.c b/components/temperature.c
index bbec80b..fe2e0c9 100644
--- a/components/temperature.c
+++ b/components/temperature.c
_AT_@ -16,9 +16,7 @@
return bprintf("%d", temp / 1000);
}
#elif defined(__OpenBSD__)
- #include <errno.h>
#include <stdio.h>
- #include <string.h>
#include <sys/time.h> /* before <sys/sensors.h> for struct timeval */
#include <sys/sensors.h>
#include <sys/sysctl.h>
diff --git a/components/uptime.c b/components/uptime.c
index f97809d..8f15d71 100644
--- a/components/uptime.c
+++ b/components/uptime.c
_AT_@ -29,8 +29,6 @@ format(int uptime)
return format(uptime);
}
#elif defined(__OpenBSD__)
- #include <errno.h>
- #include <string.h>
#include <sys/sysctl.h>
#include <sys/time.h>
diff --git a/components/user.c b/components/user.c
index cd503f6..71a0c9d 100644
--- a/components/user.c
+++ b/components/user.c
_AT_@ -1,8 +1,6 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <pwd.h>
#include <stdio.h>
-#include <string.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/components/volume.c b/components/volume.c
index 8674211..8a70b20 100644
--- a/components/volume.c
+++ b/components/volume.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
diff --git a/components/wifi.c b/components/wifi.c
index b3e1723..7815c86 100644
--- a/components/wifi.c
+++ b/components/wifi.c
_AT_@ -1,5 +1,4 @@
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <ifaddrs.h>
#include <stdio.h>
#include <string.h>
Received on Wed May 30 2018 - 19:37:45 CEST
This archive was generated by hypermail 2.3.0
: Wed May 30 2018 - 19:48:25 CEST