Commit 5d2dd1c5 authored by William Gropp's avatar William Gropp
Browse files

Add explicit casts to unsigned long for printing types of size_t

parent 89958058
...@@ -351,7 +351,7 @@ void MPL_trfree(void *a_ptr, int line, const char file[]) ...@@ -351,7 +351,7 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
if (TRidSet) { if (TRidSet) {
MPL_error_printf MPL_error_printf
("[%d] Block [id=%d(%lu)] at address %s was already freed\n", world_rank, ("[%d] Block [id=%d(%lu)] at address %s was already freed\n", world_rank,
head->id, head->size, hexstring); head->id, (unsigned long)head->size, hexstring);
} }
else { else {
MPL_error_printf("[%d] Block at address %s was already freed\n", MPL_error_printf("[%d] Block at address %s was already freed\n",
...@@ -371,7 +371,7 @@ void MPL_trfree(void *a_ptr, int line, const char file[]) ...@@ -371,7 +371,7 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
if (TRidSet) { if (TRidSet) {
MPL_error_printf MPL_error_printf
("[%d] Block [id=%d(%lu)] at address %s is corrupted (probably write past end)\n", ("[%d] Block [id=%d(%lu)] at address %s is corrupted (probably write past end)\n",
world_rank, head->id, head->size, hexstring); world_rank, head->id, (unsigned long)head->size, hexstring);
} }
else { else {
MPL_error_printf MPL_error_printf
...@@ -412,7 +412,8 @@ void MPL_trfree(void *a_ptr, int line, const char file[]) ...@@ -412,7 +412,8 @@ void MPL_trfree(void *a_ptr, int line, const char file[])
if (TRlevel & TR_FREE) { if (TRlevel & TR_FREE) {
addrToHex(a_ptr, hexstring); addrToHex(a_ptr, hexstring);
MPL_error_printf("[%d] Freeing %lu bytes at %s in %s[%d]\n", MPL_error_printf("[%d] Freeing %lu bytes at %s in %s[%d]\n",
world_rank, head->size, hexstring, file, line); world_rank, (unsigned long)head->size, hexstring,
file, line);
} }
/* /*
...@@ -530,7 +531,7 @@ int MPL_trvalid2(const char str[], int line, const char file[] ) ...@@ -530,7 +531,7 @@ int MPL_trvalid2(const char str[], int line, const char file[] )
if (TRidSet) { if (TRidSet) {
MPL_error_printf MPL_error_printf
("[%d] Block [id=%d(%lu)] at address %s is corrupted (probably write past end)\n", ("[%d] Block [id=%d(%lu)] at address %s is corrupted (probably write past end)\n",
world_rank, head->id, head->size, hexstring); world_rank, head->id, (unsigned long)head->size, hexstring);
} }
else { else {
MPL_error_printf MPL_error_printf
...@@ -594,7 +595,8 @@ void MPL_trdump(FILE * fp, int minid) ...@@ -594,7 +595,8 @@ void MPL_trdump(FILE * fp, int minid)
MPL_VG_MAKE_MEM_DEFINED(head, sizeof(*head)); MPL_VG_MAKE_MEM_DEFINED(head, sizeof(*head));
if (head->id >= minid) { if (head->id >= minid) {
addrToHex((char *) head + sizeof(TrSPACE), hexstring); addrToHex((char *) head + sizeof(TrSPACE), hexstring);
fprintf(fp, "[%d] %lu at [%s], ", world_rank, head->size, hexstring); fprintf(fp, "[%d] %lu at [%s], ", world_rank,
(unsigned long)head->size, hexstring);
head->fname[TR_FNAME_LEN - 1] = 0; /* Be extra careful */ head->fname[TR_FNAME_LEN - 1] = 0; /* Be extra careful */
if (TRidSet) { if (TRidSet) {
/* For head->id >= 0, we can add code to map the id to /* For head->id >= 0, we can add code to map the id to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment