#include <sys/time.h>
#endif
+#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#if defined(USE_CLOCK_GETTIME)
struct timespec val;
- (void)clock_gettime(CLOCK_MONOTONIC, &val);
+ (void) clock_gettime(CLOCK_MONOTONIC, &val);
/* With conversion from nanosecond to millisecond */
set_bench_time(&self->start, val.tv_sec, val.tv_nsec / 1000);
#else
struct timeval val;
- (void)gettimeofday(&val, NULL);
+ (void) gettimeofday(&val, NULL);
set_bench_time(&self->start, val.tv_sec, val.tv_usec);
#endif
#if defined(USE_CLOCK_GETTIME)
struct timespec val;
- (void)clock_gettime(CLOCK_MONOTONIC, &val);
+ (void) clock_gettime(CLOCK_MONOTONIC, &val);
/* With conversion from nanosecond to millisecond */
set_bench_time(&self->stop, val.tv_sec, val.tv_nsec / 1000);
#else
struct timeval val;
- (void)gettimeofday(&val, NULL);
+ (void) gettimeofday(&val, NULL);
set_bench_time(&self->stop, val.tv_sec, val.tv_usec);
#endif
{
struct bench_time elapsed;
char *buf;
+ int ret;
bench_timer_get_elapsed_time(self, &elapsed);
normalize_bench_time(&elapsed);
- asprintf(&buf, "%ld.%06ld", elapsed.seconds, elapsed.milliseconds);
+ ret = asprintf(&buf, "%ld.%06ld", elapsed.seconds, elapsed.milliseconds);
+ assert(ret >= 0);
return buf;
}
sigaction(SIGTERM, &act, NULL);
/* Instead of fiddling with termios.. */
- system("stty -echo");
+ (void) system("stty -echo");
ret = loop(kbds);
if (ret)
goto err_stty;
err_stty:
- system("stty echo");
+ (void) system("stty echo");
free_keyboards(kbds);
err_compose:
xkb_compose_table_unref(compose_table);