]> git.sesse.net Git - stockfish/commitdiff
Retire timeoday.cpp
authorMarco Costalba <mcostalba@gmail.com>
Mon, 27 Apr 2009 12:48:14 +0000 (13:48 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 27 Apr 2009 12:48:14 +0000 (13:48 +0100)
Move the only function gettimeofday in misc.cpp
where is used.

This avoids polluting the global namespace.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/misc.cpp
src/timeoday.cpp [deleted file]

index 1c16726e809bf11fd70887f0bd4cc8f8f0c82c40..281d8595a7cca6dd227fe6c0f83b1cb7610beb04 100644 (file)
 #  include <unistd.h>
 
 #else
+/*
+   (c) Copyright 1992 Eric Backus
 
+   This software may be used freely so long as this copyright notice is
+   left intact. There is no warrantee on this software.
+*/
 #  include <windows.h>
 #  include <time.h>
 #  include "dos.h"
-int gettimeofday(struct timeval * tp, struct timezone * tzp);
+static int gettimeofday(struct timeval* tp, struct timezone*)
+{
+    SYSTEMTIME systime;
+
+    if (tp)
+    {
+        struct tm tmrec;
+        time_t theTime = time(NULL);
+
+        tmrec = *localtime(&theTime);
+        tp->tv_sec = mktime(&tmrec);
+        GetLocalTime(&systime); /* system time */
+
+        tp->tv_usec = systime.wMilliseconds * 1000;
+    }
+    return 0;
+}
 
 #endif
 
diff --git a/src/timeoday.cpp b/src/timeoday.cpp
deleted file mode 100644 (file)
index 6909c2d..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-   (c) Copyright 1992 Eric Backus
-
-   This software may be used freely so long as this copyright notice is
-   left intact. There is no warrantee on this software.
-*/
-
-#include <windows.h>
-#include <time.h>
-#include "dos.h"
-
-int gettimeofday(struct timeval* tp, struct timezone*)
-{
-    SYSTEMTIME systime;
-
-    if (tp)
-    {
-        struct tm tmrec;
-        time_t theTime = time(NULL);
-
-        tmrec = *localtime(&theTime);
-        tp->tv_sec = mktime(&tmrec);
-        GetLocalTime(&systime); /* system time */
-
-        tp->tv_usec = systime.wMilliseconds * 1000;
-    }
-    return 0;
-}