diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/bpf/ChangeLog | 4 | ||||
-rw-r--r-- | sim/bpf/bpf-helpers.c | 24 |
2 files changed, 16 insertions, 12 deletions
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog index 7c48d28..b53b986 100644 --- a/sim/bpf/ChangeLog +++ b/sim/bpf/ChangeLog @@ -1,5 +1,9 @@ 2021-06-27 Mike Frysinger <vapier@gentoo.org> + * bpf-helpers.c (bpf_trace_printk): Add casts to every value printf. + +2021-06-27 Mike Frysinger <vapier@gentoo.org> + * bpf-helpers.c (bpf_trace_printk): Move value decl to top of scope. * mloop.in: Move off16 & imm32 decls to top of scope. diff --git a/sim/bpf/bpf-helpers.c b/sim/bpf/bpf-helpers.c index 79a3a7d..d72c22a 100644 --- a/sim/bpf/bpf-helpers.c +++ b/sim/bpf/bpf-helpers.c @@ -95,16 +95,16 @@ bpf_trace_printk (SIM_CPU *current_cpu) fmt_address + i))) { case 'd': - trace_printf (sd, current_cpu, "%d", value); + trace_printf (sd, current_cpu, "%d", (int) value); break; case 'i': - trace_printf (sd, current_cpu, "%i", value); + trace_printf (sd, current_cpu, "%i", (int) value); break; case 'u': - trace_printf (sd, current_cpu, "%u", value); + trace_printf (sd, current_cpu, "%u", (unsigned int) value); break; case 'x': - trace_printf (sd, current_cpu, "%x", value); + trace_printf (sd, current_cpu, "%x", (unsigned int) value); break; case 'l': { @@ -114,16 +114,16 @@ bpf_trace_printk (SIM_CPU *current_cpu) fmt_address + i)) { case 'd': - trace_printf (sd, current_cpu, "%ld", value); + trace_printf (sd, current_cpu, "%ld", (long) value); break; case 'i': - trace_printf (sd, current_cpu, "%li", value); + trace_printf (sd, current_cpu, "%li", (long) value); break; case 'u': - trace_printf (sd, current_cpu, "%lu", value); + trace_printf (sd, current_cpu, "%lu", (unsigned long) value); break; case 'x': - trace_printf (sd, current_cpu, "%lx", value); + trace_printf (sd, current_cpu, "%lx", (unsigned long) value); break; case 'l': { @@ -132,16 +132,16 @@ bpf_trace_printk (SIM_CPU *current_cpu) switch (GETMEMUQI (current_cpu, CPU_PC_GET (current_cpu), fmt_address + i)) { case 'd': - trace_printf (sd, current_cpu, "%lld", value); + trace_printf (sd, current_cpu, "%lld", (long long) value); break; case 'i': - trace_printf (sd, current_cpu, "%lli", value); + trace_printf (sd, current_cpu, "%lli", (long long) value); break; case 'u': - trace_printf (sd, current_cpu, "%llu", value); + trace_printf (sd, current_cpu, "%llu", (unsigned long long) value); break; case 'x': - trace_printf (sd, current_cpu, "%llx", value); + trace_printf (sd, current_cpu, "%llx", (unsigned long long) value); break; default: assert (0); |