From edb922f6139b73a261809cc0741db0ade0d4c664 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Fri, 14 Oct 2016 20:35:36 +0100 Subject: [PATCH] Use correct format strings for PLI_UINT64 in printf/scanf functions. --- vpi/vhdl_textio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vpi/vhdl_textio.c b/vpi/vhdl_textio.c index 3892ef5b7..f75cfabeb 100644 --- a/vpi/vhdl_textio.c +++ b/vpi/vhdl_textio.c @@ -188,7 +188,7 @@ static int read_time(const char *string, s_vpi_value *val, PLI_INT32 scope_unit) char units[2]; int time_unit, processed_chars; - if(sscanf(string, "%ld %2s%n", &period, units, &processed_chars) != 2) + if(sscanf(string, "%" PLI_UINT64_FMT " %2s%n", &period, units, &processed_chars) != 2) return 0; if(!strncasecmp(units, "fs", 2)) @@ -289,9 +289,9 @@ static int write_time(char *string, const s_vpi_value* val, } if(prefix) - sprintf(string, "%ld %cs", period, prefix); + sprintf(string, "%" PLI_UINT64_FMT " %cs", period, prefix); else - sprintf(string, "%ld s", period); + sprintf(string, "%" PLI_UINT64_FMT " s", period); return 0; }