1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

minor fixes for compilation on OS X / BSD

This commit is contained in:
Steffen Vogel 2017-12-08 13:10:08 +08:00
parent 5ce1f7a8c6
commit f5aed9f399
3 changed files with 4 additions and 5 deletions

View file

@ -21,6 +21,7 @@
*********************************************************************************/
#include <string.h>
#include <inttypes.h>
#include "node.h"
#include "plugin.h"
@ -159,7 +160,7 @@ int influxdb_write(struct node *n, struct sample *smps[], unsigned cnt)
switch (sample_get_data_format(smps[k], j)) {
case SAMPLE_DATA_FORMAT_FLOAT: strcatf(&buf, "%f", smps[k]->data[j].f); break;
case SAMPLE_DATA_FORMAT_INT: strcatf(&buf, "%ld", smps[k]->data[j].i); break;
case SAMPLE_DATA_FORMAT_INT: strcatf(&buf, "%" PRIi64, smps[k]->data[j].i); break;
}
}

View file

@ -319,7 +319,7 @@ int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt)
/* Wait */
steps = task_wait(&t->task);
if (steps > 1)
warn("Skipped %zu steps", steps - 1);
warn("Skipped %ld steps", (long) (steps - 1));
struct timespec now = time_now();

View file

@ -95,7 +95,7 @@ int task_set_rate(struct task *t, double rate)
next = time_add(&now, &t->period);
return time_set_next(t, &next);
return task_set_next(t, &next);
#elif PERIODIC_TASK_IMPL == TIMERFD
int ret;
struct itimerspec its = {
@ -158,8 +158,6 @@ uint64_t task_wait(struct task *t)
if (ret < 0)
return 0;
struct timespec now;
ret = clock_gettime(t->clock, &now);
if (ret)
return 0;