diff options
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/common/util.c b/common/util.c index 5ea94f48..7c492bcb 100644 --- a/common/util.c +++ b/common/util.c | |||
@@ -1,4 +1,3 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | ||
2 | #include <ctype.h> | 1 | #include <ctype.h> |
3 | #include <fcntl.h> | 2 | #include <fcntl.h> |
4 | #include <math.h> | 3 | #include <math.h> |
@@ -10,12 +9,6 @@ | |||
10 | #include "log.h" | 9 | #include "log.h" |
11 | #include "util.h" | 10 | #include "util.h" |
12 | 11 | ||
13 | uint32_t get_current_time_msec(void) { | ||
14 | struct timespec now; | ||
15 | clock_gettime(CLOCK_MONOTONIC, &now); | ||
16 | return now.tv_sec * 1000 + now.tv_nsec / 1000000; | ||
17 | } | ||
18 | |||
19 | int wrap(int i, int max) { | 12 | int wrap(int i, int max) { |
20 | return ((i % max) + max) % max; | 13 | return ((i % max) + max) % max; |
21 | } | 14 | } |
@@ -86,6 +79,12 @@ enum movement_unit parse_movement_unit(const char *unit) { | |||
86 | 79 | ||
87 | int parse_movement_amount(int argc, char **argv, | 80 | int parse_movement_amount(int argc, char **argv, |
88 | struct movement_amount *amount) { | 81 | struct movement_amount *amount) { |
82 | if (!sway_assert(argc > 0, "Expected args in parse_movement_amount")) { | ||
83 | amount->amount = 0; | ||
84 | amount->unit = MOVEMENT_UNIT_INVALID; | ||
85 | return 0; | ||
86 | } | ||
87 | |||
89 | char *err; | 88 | char *err; |
90 | amount->amount = (int)strtol(argv[0], &err, 10); | 89 | amount->amount = (int)strtol(argv[0], &err, 10); |
91 | if (*err) { | 90 | if (*err) { |