From f19ac83152b54a204b8148815a538d868973e1e1 Mon Sep 17 00:00:00 2001 From: Andreas Färber Date: Sun, 22 May 2016 04:34:04 +0200 Subject: Fix usage of timeval_ms() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First, fix the timeval_ms() implementation to not have K&R but ANSI argument semantics by adding a missing void. timeval_ms() returns an int64_t, not uint64_t or long long. Consistently use int64_t for variables and PRI*64 as format string. While at it, change a few related variables to bool for clarity. Note that timeval_ms() may return a negative error code, but not a single caller checks for that. Change-Id: I27cf83e75b3e9a8913f6c43e98a281bea77aac13 Signed-off-by: Andreas Färber Reviewed-on: http://openocd.zylin.com/3499 Tested-by: jenkins Reviewed-by: Andreas Fritiofson Reviewed-by: Tomas Vanek --- src/jtag/zy1000/zy1000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/jtag/zy1000/zy1000.c') diff --git a/src/jtag/zy1000/zy1000.c b/src/jtag/zy1000/zy1000.c index 271a2817..67d99070 100644 --- a/src/jtag/zy1000/zy1000.c +++ b/src/jtag/zy1000/zy1000.c @@ -145,8 +145,8 @@ static int zy1000_power_dropout(int *dropout) static void waitSRST(bool asserted) { bool first = true; - long long start = 0; - long total = 0; + int64_t start = 0; + int64_t total = 0; const char *mode = asserted ? "assert" : "deassert"; for (;; ) { @@ -167,7 +167,7 @@ static void waitSRST(bool asserted) keep_alive(); if (total > 5000) { - LOG_ERROR("SRST took too long to %s: %dms", mode, (int)total); + LOG_ERROR("SRST took too long to %s: %" PRId64 "ms", mode, total); break; } } -- cgit v1.2.3-18-g5258