fixed more signed vs unsigned warnings
[libfirm] / ir / ana2 / timing.c
index cb1088a..fabe9d1 100644 (file)
@@ -22,9 +22,9 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <sys/time.h>
 
-# include "timing.h"
+#include "timing.h"
+#include "xmalloc.h"
 
 struct timing_env
 {
@@ -32,7 +32,15 @@ struct timing_env
   struct timeval *end;
 };
 
-\f
+#ifdef _WIN32
+/* no support yet */
+timing_t *start_timing (void) {}
+int end_timing (timing_t *t) {}
+
+#else
+#include <sys/time.h>
+
+
 /*
 Helpers
 */
@@ -55,17 +63,17 @@ timeval_subtract (struct timeval *x, struct timeval *y)
   return ((x->tv_sec - y->tv_sec) * 1000000 + (x->tv_usec - y->tv_usec));
 }
 
-\f
+
 /*
   Public Interface
 */
 timing_t *
 start_timing (void)
 {
-  timing_t *t = (timing_t*) malloc (sizeof (timing_t));
+  timing_t *t = (timing_t*) xmalloc (sizeof (timing_t));
 
-  t->start = (struct timeval*) malloc (sizeof (struct timeval));
-  t->end   = (struct timeval*) malloc (sizeof (struct timeval));
+  t->start = (struct timeval*) xmalloc (sizeof (struct timeval));
+  t->end   = (struct timeval*) xmalloc (sizeof (struct timeval));
 
   gettimeofday (t->start, NULL);
 
@@ -92,15 +100,23 @@ end_timing (timing_t *t)
 
   return (time);
 }
+#endif /* _WIN32 */
+
 
-\f
 /*
   $Log$
+  Revision 1.5  2006/09/12 12:17:37  matze
+  more warning fixes
+
+  Revision 1.4  2006/06/06 12:06:27  beck
+  use xmalloc instead of malloc
+
+  Revision 1.3  2005/01/05 14:25:38  beck
+  added Win32 "support"
+
   Revision 1.2  2004/12/21 15:52:23  beck
   moved struct timing_env to .c file, added config.h
 
   Revision 1.1  2004/10/29 18:55:52  liekweg
   (mostly) generic timimg
-
-
 */