[compiler-rt] r353485 - Silence -Wformat warnings about GetLastError returning ULONG
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 7 15:58:48 PST 2019
Author: rnk
Date: Thu Feb 7 15:58:48 2019
New Revision: 353485
URL: http://llvm.org/viewvc/llvm-project?rev=353485&view=rev
Log:
Silence -Wformat warnings about GetLastError returning ULONG
Modified:
compiler-rt/trunk/lib/profile/GCDAProfiling.c
Modified: compiler-rt/trunk/lib/profile/GCDAProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/GCDAProfiling.c?rev=353485&r1=353484&r2=353485&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/GCDAProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/GCDAProfiling.c Thu Feb 7 15:58:48 2019
@@ -268,14 +268,14 @@ static int map_file() {
mmap_handle = CreateFileMapping(mmap_fd, NULL, PAGE_READWRITE, DWORD_HI(file_size), DWORD_LO(file_size), NULL);
if (mmap_handle == NULL) {
- fprintf(stderr, "profiling: %s: cannot create file mapping: %d\n", filename,
- GetLastError());
+ fprintf(stderr, "profiling: %s: cannot create file mapping: %lu\n",
+ filename, GetLastError());
return -1;
}
write_buffer = MapViewOfFile(mmap_handle, FILE_MAP_WRITE, 0, 0, file_size);
if (write_buffer == NULL) {
- fprintf(stderr, "profiling: %s: cannot map: %d\n", filename,
+ fprintf(stderr, "profiling: %s: cannot map: %lu\n", filename,
GetLastError());
CloseHandle(mmap_handle);
return -1;
@@ -297,18 +297,18 @@ static int map_file() {
static void unmap_file() {
#if defined(_WIN32)
if (!FlushViewOfFile(write_buffer, file_size)) {
- fprintf(stderr, "profiling: %s: cannot flush mapped view: %d\n", filename,
+ fprintf(stderr, "profiling: %s: cannot flush mapped view: %lu\n", filename,
GetLastError());
}
if (!UnmapViewOfFile(write_buffer)) {
- fprintf(stderr, "profiling: %s: cannot unmap mapped view: %d\n", filename,
+ fprintf(stderr, "profiling: %s: cannot unmap mapped view: %lu\n", filename,
GetLastError());
}
if (!CloseHandle(mmap_handle)) {
- fprintf(stderr, "profiling: %s: cannot close file mapping handle: %d\n", filename,
- GetLastError());
+ fprintf(stderr, "profiling: %s: cannot close file mapping handle: %lu\n",
+ filename, GetLastError());
}
mmap_handle = NULL;
More information about the llvm-commits
mailing list