From f28a29d29d8502a38582b02f382967c80e9c54a9 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Tue, 1 Mar 2011 17:36:26 -0500 Subject: [PATCH] Fix some warnings on linux using C99 scanf modifiers. Signed-off-by: Tom Prince --- library/DFProcess-linux-SHM.cpp | 4 ++-- library/DFProcess-linux-base.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/DFProcess-linux-SHM.cpp b/library/DFProcess-linux-SHM.cpp index 2f5889908..b23132066 100644 --- a/library/DFProcess-linux-SHM.cpp +++ b/library/DFProcess-linux-SHM.cpp @@ -268,7 +268,7 @@ void SHMProcess::getMemRanges( vector & ranges ) char buffer[1024]; char permissions[5]; // r/-, w/-, x/-, p/s, 0 - sprintf(buffer, "/proc/%lu/maps", d->process_ID); + sprintf(buffer, "/proc/%lu/maps", (long unsigned)d->process_ID); FILE *mapFile = ::fopen(buffer, "r"); uint64_t offset, device1, device2, node; @@ -276,7 +276,7 @@ void SHMProcess::getMemRanges( vector & ranges ) { t_memrange temp; temp.name[0] = 0; - sscanf(buffer, "%llx-%llx %s %llx %2llu:%2llu %llu %s", + sscanf(buffer, "%zx-%zx %s %zx %2zu:%2zu %zu %s", &temp.start, &temp.end, (char*)&permissions, diff --git a/library/DFProcess-linux-base.cpp b/library/DFProcess-linux-base.cpp index f704d384e..b3a774e2e 100644 --- a/library/DFProcess-linux-base.cpp +++ b/library/DFProcess-linux-base.cpp @@ -85,7 +85,7 @@ void LinuxProcessBase::getMemRanges( vector & ranges ) char buffer[1024]; char permissions[5]; // r/-, w/-, x/-, p/s, 0 - sprintf(buffer, "/proc/%lu/maps", my_pid); + sprintf(buffer, "/proc/%lu/maps", (long unsigned)my_pid); FILE *mapFile = ::fopen(buffer, "r"); uint64_t offset, device1, device2, node; @@ -93,7 +93,7 @@ void LinuxProcessBase::getMemRanges( vector & ranges ) { t_memrange temp; temp.name[0] = 0; - sscanf(buffer, "%llx-%llx %s %llx %2llu:%2llu %llu %s", + sscanf(buffer, "%zx-%zx %s %zx %2zu:%2zu %zu %s", &temp.start, &temp.end, (char*)&permissions,