From 0f777d3fe1a9adf1fbda9f5a7f2e0a12793efece Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Mon, 9 Jul 2018 21:20:50 +0800 Subject: [PATCH] HV: assert: use signed int for __LINE__ GCC preprocessor expands __LINE__ to signed decimal integers. Keep the prototype of __assert aligned with this. Signed-off-by: Junjie Mao Acked-by: Eddie Dong --- hypervisor/debug/dump.c | 4 ++-- hypervisor/include/debug/assert.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hypervisor/debug/dump.c b/hypervisor/debug/dump.c index ea07fb366..2afc0dfe5 100644 --- a/hypervisor/debug/dump.c +++ b/hypervisor/debug/dump.c @@ -228,13 +228,13 @@ static void show_host_call_trace(uint64_t rsp, uint64_t rbp, uint16_t pcpu_id) printf("\r\n"); } -void __assert(uint32_t line, const char *file, const char *txt) +void __assert(int32_t line, const char *file, const char *txt) { uint16_t pcpu_id = get_cpu_id(); uint64_t rsp = cpu_rsp_get(); uint64_t rbp = cpu_rbp_get(); - printf("Assertion failed in file %s,line %u : %s", + printf("Assertion failed in file %s,line %d : %s", file, line, txt); show_host_call_trace(rsp, rbp, pcpu_id); dump_guest_context(pcpu_id); diff --git a/hypervisor/include/debug/assert.h b/hypervisor/include/debug/assert.h index e075fc5d3..370c649f3 100644 --- a/hypervisor/include/debug/assert.h +++ b/hypervisor/include/debug/assert.h @@ -8,7 +8,7 @@ #define ASSERT_H #ifdef HV_DEBUG -void __assert(uint32_t line, const char *file, const char *txt); +void __assert(int32_t line, const char *file, const char *txt); #define ASSERT(x, ...) \ if (!(x)) {\