From 4fcef1c5b6e7326b5ae339a9df84c49da16961f6 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 8 Nov 2021 17:05:22 +0100 Subject: [PATCH] Fix some warnings for clang and intel compilers --- chan.c | 6 +++--- chan.h | 4 ++-- emu.c | 2 +- emu_ovni.c | 4 ++-- ovni.c | 2 ++ 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/chan.c b/chan.c index 5758ea5..2b6c46c 100644 --- a/chan.c +++ b/chan.c @@ -24,7 +24,7 @@ #include "utlist.h" static void -chan_init(struct ovni_chan *chan, int track, int row, int type, FILE *prv, int64_t *clock) +chan_init(struct ovni_chan *chan, enum chan_track track, int row, int type, FILE *prv, int64_t *clock) { chan->n = 0; chan->type = type; @@ -53,7 +53,7 @@ void chan_th_init(struct ovni_ethread *th, struct ovni_chan **update_list, enum chan id, - int track, + enum chan_track track, int init_st, int enabled, int dirty, @@ -82,7 +82,7 @@ void chan_cpu_init(struct ovni_cpu *cpu, struct ovni_chan **update_list, enum chan id, - int track, + enum chan_track track, int init_st, int enabled, int dirty, diff --git a/chan.h b/chan.h index 7ee9d72..de98cc9 100644 --- a/chan.h +++ b/chan.h @@ -24,7 +24,7 @@ void chan_th_init(struct ovni_ethread *th, struct ovni_chan **update_list, enum chan id, - int track, + enum chan_track track, int init_st, int enabled, int dirty, @@ -36,7 +36,7 @@ void chan_cpu_init(struct ovni_cpu *cpu, struct ovni_chan **update_list, enum chan id, - int track, + enum chan_track track, int row, int init_st, int enabled, diff --git a/emu.c b/emu.c index 2c9d92a..ccf0f41 100644 --- a/emu.c +++ b/emu.c @@ -48,7 +48,7 @@ evclock(struct ovni_stream *stream, struct ovni_ev *ev) static void print_ev(struct ovni_stream *stream, struct ovni_ev *ev) { - int64_t clock, delta; + int64_t clock, delta = 0; int i, payloadsize; UNUSED(delta); diff --git a/emu_ovni.c b/emu_ovni.c index 59e621b..0bf4e6d 100644 --- a/emu_ovni.c +++ b/emu_ovni.c @@ -106,7 +106,7 @@ chan_tracking_update(struct ovni_chan *chan, struct ovni_ethread *th) /* Sets the state of the thread and updates the thread tracking channels */ static void -thread_set_state(struct ovni_ethread *th, int state) +thread_set_state(struct ovni_ethread *th, enum ethread_state state) { int i; @@ -521,7 +521,7 @@ static void pre_burst(struct ovni_emu *emu) { struct ovni_ethread *th; - int64_t dt; + int64_t dt = 0; UNUSED(dt); diff --git a/ovni.c b/ovni.c index 6e34990..1b21066 100644 --- a/ovni.c +++ b/ovni.c @@ -300,6 +300,7 @@ ovni_thread_isready(void) return rthread.ready; } +#ifdef USE_RDTSC static inline uint64_t rdtsc(void) { @@ -309,6 +310,7 @@ uint64_t rdtsc(void) __asm__ volatile("rdtsc" : "=a" (lo), "=d" (hi)); return (uint64_t) hi << 32 | lo; } +#endif uint64_t ovni_get_clock(void)