summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/win32/IOManager.c9
-rw-r--r--testsuite/tests/rts/testheapalloced.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/rts/win32/IOManager.c b/rts/win32/IOManager.c
index 2427687136..7eaf4891da 100644
--- a/rts/win32/IOManager.c
+++ b/rts/win32/IOManager.c
@@ -436,8 +436,9 @@ AddIORequest ( int fd,
CompletionProc onCompletion)
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
- unsigned int reqID = ioMan->requestID++;
+ unsigned int reqID;
if (!ioMan || !wItem) return 0;
+ reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = ( isSocket ? WORKER_FOR_SOCKET : 0 ) |
@@ -464,8 +465,9 @@ AddDelayRequest ( unsigned int usecs,
CompletionProc onCompletion)
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
- unsigned int reqID = ioMan->requestID++;
+ unsigned int reqID;
if (!ioMan || !wItem) return FALSE;
+ reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = WORKER_DELAY;
@@ -488,8 +490,9 @@ AddProcRequest ( void* proc,
CompletionProc onCompletion)
{
WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
- unsigned int reqID = ioMan->requestID++;
+ unsigned int reqID;
if (!ioMan || !wItem) return FALSE;
+ reqID = ioMan->requestID++;
/* Fill in the blanks */
wItem->workKind = WORKER_DO_PROC;
diff --git a/testsuite/tests/rts/testheapalloced.c b/testsuite/tests/rts/testheapalloced.c
index cc4dad40d4..3d8fa05eb3 100644
--- a/testsuite/tests/rts/testheapalloced.c
+++ b/testsuite/tests/rts/testheapalloced.c
@@ -85,7 +85,7 @@ int main (int argc, char *argv[])
printf("%d\n", j);
}
- printf("misses: %ld, %ld%\n", mpc_misses, mpc_misses / (LOOPS*20));
+ printf("misses: %ld, %ld%%\n", mpc_misses, mpc_misses / (LOOPS*20));
for (i=0; i < ARRSIZE; i++)
{