Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bug 552329: Fix compile warnings in xpcshell test TestOOM.cpp. r=doug…

…t, test-only change on CLOSED TREE to see if tinderbox still wants to be red
  • Loading branch information...
commit 5eaa5410d982fa15072afd0846ebe547ceec69d7 1 parent a393bc1
Daniel Holbert dholbert authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 xpcom/tests/TestOOM.cpp
13 xpcom/tests/TestOOM.cpp
View
@@ -62,6 +62,7 @@ int main(int argc, char **argv)
// the predicate should work with out having to rely on
// that.
void *big_alloc = malloc(1024 * 1024 * 16);
+ (void)big_alloc; // Tell compiler we're not using big_alloc, to fix warning
const int highpower = 500000;
@@ -77,10 +78,10 @@ int main(int argc, char **argv)
// You have to touch the buffer
if (!buffers[i])
- printf("Could not allocate a buffer of size %ld\n", s);
+ printf("Could not allocate a buffer of size %lu\n", (unsigned long)s);
else
{
- for (int j=0; j<s; j++)
+ for (size_t j=0; j<s; j++)
buffers[i][j] = 'a';
}
@@ -89,10 +90,10 @@ int main(int argc, char **argv)
PRIntervalTime cost = PR_IntervalNow() - start;
- printf("Total Allocated: %ld. \tLow Memory now? %s\t Took (%d)\n",
- s*i,
- lowMem ? "Yes" : "No",
- PR_IntervalToMilliseconds(cost));
+ printf("Total Allocated: %lu. \tLow Memory now? %s\t Took (%d)\n",
+ (unsigned long)s*i,
+ lowMem ? "Yes" : "No",
+ PR_IntervalToMilliseconds(cost));
if (lowMem)
break;
Please sign in to comment.
Something went wrong with that request. Please try again.