Uwe Hermann <uwe@hermann-uwe.de> One of them is fixing a few compiler warnings (see...
[fw/openocd] / src / helper / replacements.c
index 5804b1973adb2946bf6e3e30e191c92717042ff5..b6ddfd7c562082c9db9cd3a98b23e3ba1ace9bef 100644 (file)
@@ -2,6 +2,12 @@
  *   Copyright (C) 2006 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
+ *   Copyright (C) 2007,2008 Ã˜yvind Harboe                                 *
+ *   oyvind.harboe@zylin.com                                               *
+ *                                                                         *
+ *   Copyright (C) 2008 by Spencer Oliver                                  *
+ *   spen@spen-soft.co.uk                                                  *
+ *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  ***************************************************************************/
 #ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif\r
-\r
+#endif
+
 /* DANGER!!!! These must be defined *BEFORE* replacements.h and the malloc() macro!!!! */
 
 #include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
-/* \r
- * clear_malloc\r
- *\r
- * will alloc memory and clear it\r
+#endif
+/* 
+ * clear_malloc
+ *
+ * will alloc memory and clear it
  */
 void *clear_malloc(size_t size)
 {
@@ -73,19 +82,19 @@ void *fill_malloc(size_t size)
 
 int gettimeofday(struct timeval *tv, struct timezone *tz)
 {
-       FILETIME        ft;
-       LARGE_INTEGER   li;
-       __int64         t;
-       static int      tzflag;
+       FILETIME ft;
+       LARGE_INTEGER li;
+       __int64 t;
+       static int tzflag;
 
        if (tv)
        {
                GetSystemTimeAsFileTime(&ft);
                li.LowPart  = ft.dwLowDateTime;
                li.HighPart = ft.dwHighDateTime;
-               t  = li.QuadPart;                   /* In 100-nanosecond intervals */
-               t -= EPOCHFILETIME;                 /* Offset to the Epoch time */
-               t /= 10;                            /* In microseconds */
+               t  = li.QuadPart;                                       /* In 100-nanosecond intervals */
+               t -= EPOCHFILETIME;                                     /* Offset to the Epoch time */
+               t /= 10;                                                        /* In microseconds */
                tv->tv_sec  = (long)(t / 1000000);
                tv->tv_usec = (long)(t % 1000000);
        }