Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2021-07-21 11:07:16 +0300
committerCorinna Vinschen <corinna@vinschen.de>2021-07-21 11:07:22 +0300
commitbf8f2a95dfb0f780e65cd9821b397fbb47e1c0ce (patch)
treef3eb8264459a124142b6bdd81771779820a222f7 /winsup/utils/profiler.cc
parentca7b4bd23676a9cb6d82974c2ed452e08abb7ecf (diff)
Cygwin: profiler: Fix formatting warnings
DWORD has different types on 32 and 64 bit. Use a common cast to unsigned long to use %lu format for DWORD values throughout. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/utils/profiler.cc')
-rw-r--r--winsup/utils/profiler.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/utils/profiler.cc b/winsup/utils/profiler.cc
index d1a01c3a2..354aefca8 100644
--- a/winsup/utils/profiler.cc
+++ b/winsup/utils/profiler.cc
@@ -312,10 +312,11 @@ dump_profile_data (child *c)
if (s->name)
{
WCHAR *name = 1 + wcsrchr (s->name, L'\\');
- sprintf (filename, "%s.%u.%ls", prefix, c->pid, name);
+ sprintf (filename, "%s.%lu.%ls", prefix, (unsigned long) c->pid,
+ name);
}
else
- sprintf (filename, "%s.%u", prefix, c->pid);
+ sprintf (filename, "%s.%lu", prefix, (unsigned long) c->pid);
fd = open (filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY);
if (fd < 0)
@@ -804,9 +805,10 @@ cygwin_pid (DWORD winpid)
cygpid = (DWORD) cygwin_internal (CW_WINPID_TO_CYGWIN_PID, winpid);
if (cygpid >= max_cygpid)
- snprintf (buf, sizeof buf, "%u", winpid);
+ snprintf (buf, sizeof buf, "%lu", (unsigned long) winpid);
else
- snprintf (buf, sizeof buf, "%u (pid: %u)", winpid, cygpid);
+ snprintf (buf, sizeof buf, "%lu (pid: %lu)", (unsigned long) winpid,
+ (unsigned long) cygpid);
return buf;
}