summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2017-08-12 13:06:24 +0200
committerAaron Marcher <me@drkhsh.at>2017-08-12 13:16:12 +0200
commitbe12b6b350c7cf2ea826d3988371efb680b4ba30 (patch)
tree9c8c1a30d30253b418d0553f86001f1762ac6341
parent0c2ee7df91bfd72c8d51bf1234a2d8571931bdf1 (diff)
Removed #define for update interval
Debugging #define, especially in mathematical constructs is very difficult. The performance overhead of static const int is negligible.
-rw-r--r--config.def.h2
-rw-r--r--slstatus.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/config.def.h b/config.def.h
index ed339ed..2b06f34 100644
--- a/config.def.h
+++ b/config.def.h
@@ -1,7 +1,7 @@
/* See LICENSE file for copyright and license details. */
/* how often to update the statusbar (min value == 1) */
-#define UPDATE_INTERVAL 1
+static const int update_interval = 1;
/* text to show if no value can be retrieved */
#define UNKNOWN_STR "n/a"
diff --git a/slstatus.c b/slstatus.c
index aa05cd1..228c19b 100644
--- a/slstatus.c
+++ b/slstatus.c
@@ -914,11 +914,11 @@ main(int argc, char *argv[])
XSync(dpy, False);
}
- if ((UPDATE_INTERVAL - delay) <= 0) {
+ if ((update_interval - delay) <= 0) {
delay = 0;
continue;
} else {
- sleep(UPDATE_INTERVAL - delay);
+ sleep(update_interval - delay);
delay = 0;
}
}