diff options
author | Mattias Andrée <maandree@kth.se> | 2018-08-26 12:49:12 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2018-08-26 12:49:12 +0200 |
commit | f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f (patch) | |
tree | e8caadeb4359bb62c7ba0b13ce94704220dd9ac7 /libsimple.h | |
parent | Tests and minor improvements (diff) | |
download | libsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.gz libsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.bz2 libsimple-f2378869e1a3b1cb44b5c7973e0a9acfb2559d0f.tar.xz |
Fixes, more test, and add minimise_number_string
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libsimple.h')
-rw-r--r-- | libsimple.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libsimple.h b/libsimple.h index e1ecfdb..4619eef 100644 --- a/libsimple.h +++ b/libsimple.h @@ -1157,7 +1157,7 @@ libsimple_eputenvf(const char *__fmt, ...) /* TODO test */ { va_list __ap; va_start(__ap, __fmt); - envputenvf(1, __fmt, __ap); + envputenvf(libsimple_default_failure_exit, __fmt, __ap); va_end(__ap); } #ifndef eputenvf @@ -1410,7 +1410,7 @@ char *libsimple_timevaltostr(char *restrict, const struct timeval *restrict); _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline double -libsimple_timespectodouble(const struct timespec *__ts) /* TODO test */ +libsimple_timespectodouble(const struct timespec *__ts) { double __ret = (double)(__ts->tv_nsec); __ret /= (double)1000000000L; @@ -1424,7 +1424,7 @@ libsimple_timespectodouble(const struct timespec *__ts) /* TODO test */ _LIBSIMPLE_GCC_ONLY(__attribute__((__nonnull__))) static inline double -libsimple_timevaltodouble(const struct timeval *__tv) /* TODO test */ +libsimple_timevaltodouble(const struct timeval *__tv) { double __ret = (double)(__tv->tv_usec); __ret /= (double)1000000L; @@ -1450,6 +1450,13 @@ void libsimple_doubletotimeval(struct timeval *, double); #endif +_LIBSIMPLE_GCC_ONLY(__attribute__((__returns_nonnull__, __nonnull__))) +char *libsimple_minimise_number_string(char *); +#ifndef minimise_number_string +# define minimise_number_string libsimple_minimise_number_string +#endif + + #define LIBSIMPLE_UNLIST(LIST, I, NP) libsimple_unlist((LIST), (I), (NP), sizeof(*(LIST))) #ifndef UNLIST # define UNLIST(LIST, I, NP) LIBSIMPLE_UNLIST((LIST), (I), (NP)) |