diff --git a/include/villas/utils.h b/include/villas/utils.h index 8b3a1e2bf..99fbf4bfb 100644 --- a/include/villas/utils.h +++ b/include/villas/utils.h @@ -138,10 +138,6 @@ char * vstrcatf(char **dest, const char *fmt, va_list va) #define strf(fmt, ...) strcatf(&(char *) { NULL }, fmt, ##__VA_ARGS__) #define vstrf(fmt, va) vstrcatf(&(char *) { NULL }, fmt, va) -/** Format a struct timespec date similar to strftime() */ -int strftimespec(char *s, size_t max, const char *format, struct timespec *ts) - __attribute__ ((format(strftime, 3, 0))); - /** Convert integer to cpu_set_t. * * @param set An integer number which is used as the mask diff --git a/lib/utils.c b/lib/utils.c index 9d478686e..4b408d940 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -38,35 +38,6 @@ int version_cmp(struct version *a, struct version *b) { return major ? major : minor; } -int strftimespec(char *dst, size_t max, const char *fmt, struct timespec *ts) -{ - int s, d; - char fmt2[64], dst2[64]; - - for (s=0, d=0; fmt[s] && d < 64;) { - char c = fmt2[d++] = fmt[s++]; - if (c == '%') { - char n = fmt[s]; - if (n == 'u') { - fmt2[d++] = '0'; - fmt2[d++] = '3'; - } - else - fmt2[d++] = '%'; - } - } - - /* Print sub-second part to format string */ - snprintf(dst2, sizeof(dst2), fmt2, ts->tv_nsec / 1000000); - - /* Print timestamp */ - struct tm tm; - if (localtime_r(&(ts->tv_sec), &tm) == NULL) - return -1; - - return strftime(dst, max, dst2, &tm); -} - double box_muller(float m, float s) { double x1, x2, y1;