Fix some warnings on linux using C99 scanf modifiers.

Signed-off-by: Tom Prince <tom.prince@ualberta.net>
develop
Tom Prince 2011-03-01 17:36:26 -05:00
parent a82e249205
commit f28a29d29d
2 changed files with 4 additions and 4 deletions

@ -268,7 +268,7 @@ void SHMProcess::getMemRanges( vector<t_memrange> & ranges )
char buffer[1024]; char buffer[1024];
char permissions[5]; // r/-, w/-, x/-, p/s, 0 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"); FILE *mapFile = ::fopen(buffer, "r");
uint64_t offset, device1, device2, node; uint64_t offset, device1, device2, node;
@ -276,7 +276,7 @@ void SHMProcess::getMemRanges( vector<t_memrange> & ranges )
{ {
t_memrange temp; t_memrange temp;
temp.name[0] = 0; 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.start,
&temp.end, &temp.end,
(char*)&permissions, (char*)&permissions,

@ -85,7 +85,7 @@ void LinuxProcessBase::getMemRanges( vector<t_memrange> & ranges )
char buffer[1024]; char buffer[1024];
char permissions[5]; // r/-, w/-, x/-, p/s, 0 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"); FILE *mapFile = ::fopen(buffer, "r");
uint64_t offset, device1, device2, node; uint64_t offset, device1, device2, node;
@ -93,7 +93,7 @@ void LinuxProcessBase::getMemRanges( vector<t_memrange> & ranges )
{ {
t_memrange temp; t_memrange temp;
temp.name[0] = 0; 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.start,
&temp.end, &temp.end,
(char*)&permissions, (char*)&permissions,