Skip to content

Commit 0f777d3

Browse files
junjiemao1lijinxia
authored andcommitted
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 <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent d0c61ce commit 0f777d3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hypervisor/debug/dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ static void show_host_call_trace(uint64_t rsp, uint64_t rbp, uint16_t pcpu_id)
228228
printf("\r\n");
229229
}
230230

231-
void __assert(uint32_t line, const char *file, const char *txt)
231+
void __assert(int32_t line, const char *file, const char *txt)
232232
{
233233
uint16_t pcpu_id = get_cpu_id();
234234
uint64_t rsp = cpu_rsp_get();
235235
uint64_t rbp = cpu_rbp_get();
236236

237-
printf("Assertion failed in file %s,line %u : %s",
237+
printf("Assertion failed in file %s,line %d : %s",
238238
file, line, txt);
239239
show_host_call_trace(rsp, rbp, pcpu_id);
240240
dump_guest_context(pcpu_id);

hypervisor/include/debug/assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define ASSERT_H
99

1010
#ifdef HV_DEBUG
11-
void __assert(uint32_t line, const char *file, const char *txt);
11+
void __assert(int32_t line, const char *file, const char *txt);
1212

1313
#define ASSERT(x, ...) \
1414
if (!(x)) {\

0 commit comments

Comments
 (0)