diff options
| author | 2014-07-29 23:30:49 +0200 | |
|---|---|---|
| committer | 2014-07-30 01:11:09 +0200 | |
| commit | 764dafa29fdb42e331c3edc960f5938254ca77d5 (patch) | |
| tree | e77dd05c0bef29c2b627d66fceb7c026b648dab6 | |
| parent | 099102ef9890a754c686960bbe10f82776d77249 (diff) | |
| download | xkbcat-764dafa29fdb42e331c3edc960f5938254ca77d5.tar.gz xkbcat-764dafa29fdb42e331c3edc960f5938254ca77d5.zip | |
Consistency: Make default display a const char *
Yep, `hostname` is a `const char *` too, even though it's potentially
being assigned to. This is
[unintuitive](http://stackoverflow.com/a/9834194/777586), but
intentional.
| -rwxr-xr-x | compile | 2 | ||||
| -rw-r--r-- | xkbcat.c | 12 |
2 files changed, 7 insertions, 7 deletions
@@ -1 +1 @@ -clang --std=gnu11 -Wall -o xkbcat -lX11 xkbcat.c +clang --std=gnu11 -pedantic -Wall -o xkbcat -lX11 xkbcat.c @@ -8,9 +8,9 @@ #include <stdbool.h> #include <time.h> -char * DEFAULT_DISPLAY = ":0"; -const int DEFAULT_DELAY = 10000000; -const bool DEFAULT_PRINT_UP = false; +const char * DEFAULT_DISPLAY = ":0"; +const int DEFAULT_DELAY = 10000000; +const bool DEFAULT_PRINT_UP = false; typedef char KbBuffer[32]; static inline bool keyState(KbBuffer b, int key) { @@ -31,9 +31,9 @@ USAGE: xkbcat [-display <display>] [-delay <nanosec>] [-up]\n\ int main(int argc, char * argv[]) { - char * hostname = DEFAULT_DISPLAY; - int delay = DEFAULT_DELAY; - bool printKeyUps = DEFAULT_PRINT_UP; + const char * hostname = DEFAULT_DISPLAY; + int delay = DEFAULT_DELAY; + bool printKeyUps = DEFAULT_PRINT_UP; // Get args for (int i = 1; i < argc; i++) { |
