From: nhmall Date: Wed, 3 Feb 2021 02:53:13 +0000 (-0500) Subject: Windows format string bits X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b454f8ba3f3be66084b2e908e1d963c703beb6f;p=nethack Windows format string bits --- diff --git a/sys/winnt/nh340key.c b/sys/winnt/nh340key.c index ec2e82711..1a54ff27b 100644 --- a/sys/winnt/nh340key.c +++ b/sys/winnt/nh340key.c @@ -183,7 +183,7 @@ ProcessKeystroke( if (portdebug) { char buf[BUFSZ]; Sprintf(buf, - "PORTDEBUG (%s): ch=%u, sc=%u, vk=%d, sh=0x%X (ESC to end)", + "PORTDEBUG (%s): ch=%u, sc=%u, vk=%d, sh=0x%lX (ESC to end)", shortdllname, ch, scan, vk, shiftstate); fprintf(stdout, "\n%s", buf); } diff --git a/sys/winnt/nhdefkey.c b/sys/winnt/nhdefkey.c index 1f2f9d51e..a3bde087e 100644 --- a/sys/winnt/nhdefkey.c +++ b/sys/winnt/nhdefkey.c @@ -214,7 +214,7 @@ ProcessKeystroke( #ifdef PORT_DEBUG if (portdebug) { char buf[BUFSZ]; - Sprintf(buf, "PORTDEBUG (%s): ch=%u, sc=%u, vk=%d, pre=%d, sh=0x%X, " + Sprintf(buf, "PORTDEBUG (%s): ch=%u, sc=%u, vk=%d, pre=%d, sh=0x%lX, " "ta=%d (ESC to end)", shortdllname, ch, scan, vk, pre_ch, shiftstate, k); fprintf(stdout, "\n%s", buf); diff --git a/sys/winnt/nhraykey.c b/sys/winnt/nhraykey.c index 51d513587..978b6564f 100644 --- a/sys/winnt/nhraykey.c +++ b/sys/winnt/nhraykey.c @@ -401,7 +401,7 @@ ProcessKeystroke( if (portdebug) { char buf[BUFSZ]; Sprintf(buf, "PORTDEBUG: ch=%u, scan=%u, vk=%d, pre=%d, " - "shiftstate=0x%X (ESC to end)\n", + "shiftstate=0x%lX (ESC to end)\n", ch, scan, vk, pre_ch, shiftstate); fprintf(stdout, "\n%s", buf); } diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index dc98e95f5..45ececc75 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -422,7 +422,7 @@ GetConsoleHwnd(void) /* Get current window title */ GetConsoleTitle(OldTitle, sizeof OldTitle); - (void) sprintf(NewTitle, "NETHACK%d/%d", GetTickCount(), + (void) sprintf(NewTitle, "NETHACK%ld/%ld", GetTickCount(), GetCurrentProcessId()); SetConsoleTitle(NewTitle); diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 60d65ff2a..3ebb1922e 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -2178,7 +2178,7 @@ initMapTiles(void) char errmsg[BUFSZ]; errcode = GetLastError(); - Sprintf(errmsg, "%s (0x%x).", + Sprintf(errmsg, "%s (0x%lx).", "Cannot load tiles from the file. Reverting back to default", errcode); raw_print(errmsg);