[gray-matter] r1606 committed - some fixes for windows.

1 view
Skip to first unread message

codesite...@google.com

unread,
Jul 28, 2010, 1:48:58 PM7/28/10
to gray-matter-...@googlegroups.com
Revision: 1606
Author: protonspring
Date: Wed Jul 28 10:48:07 2010
Log: some fixes for windows.
http://code.google.com/p/gray-matter/source/detail?r=1606

Modified:
/trunk/grayMatter.sln
/trunk/grayMatter.vcproj
/trunk/inc/library.h
/trunk/src/book.cpp
/trunk/src/library.cpp

=======================================
--- /trunk/grayMatter.sln Fri Jun 19 17:01:16 2009
+++ /trunk/grayMatter.sln Wed Jul 28 10:48:07 2010
@@ -1,6 +1,6 @@

-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}")
= "grayMatter", "grayMatter.vcproj", "{B7A7668B-33A8-418D-BDE7-F2A289333238}"
EndProject
Global
=======================================
--- /trunk/grayMatter.vcproj Tue Jul 7 14:13:45 2009
+++ /trunk/grayMatter.vcproj Wed Jul 28 10:48:07 2010
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="grayMatter"
ProjectGUID="{B7A7668B-33A8-418D-BDE7-F2A289333238}"
RootNamespace="grayMatter2"
Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@@ -68,6 +69,8 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@@ -88,9 +91,6 @@
<Tool
Name="VCAppVerifierTool"
/>
- <Tool
- Name="VCWebDeploymentTool"
- />
<Tool
Name="VCPostBuildEventTool"
/>
@@ -146,6 +146,8 @@
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
@@ -166,9 +168,6 @@
<Tool
Name="VCAppVerifierTool"
/>
- <Tool
- Name="VCWebDeploymentTool"
- />
<Tool
Name="VCPostBuildEventTool"
/>
@@ -224,6 +223,8 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
Profile="true"
/>
@@ -245,9 +246,6 @@
<Tool
Name="VCAppVerifierTool"
/>
- <Tool
- Name="VCWebDeploymentTool"
- />
<Tool
Name="VCPostBuildEventTool"
/>
@@ -303,6 +301,8 @@
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="17"
/>
<Tool
@@ -323,9 +323,6 @@
<Tool
Name="VCAppVerifierTool"
/>
- <Tool
- Name="VCWebDeploymentTool"
- />
<Tool
Name="VCPostBuildEventTool"
/>
=======================================
--- /trunk/inc/library.h Wed Jul 28 10:11:39 2010
+++ /trunk/inc/library.h Wed Jul 28 10:48:07 2010
@@ -67,7 +67,6 @@

// Win32 header files:
#ifdef _MSDEV_WINDOWS
-#define _WIN32_WINNT 0x0501
#include "MSDEVstdint.h"
#else
#include <stdint.h>
@@ -124,7 +123,9 @@
static int timer_function(void (*function)(void *), void *data);
static int timer_set(int csec);
static int timer_cancel();
- static void timer_handler(int num);
+#if defined(LINUX) || defined(OS_X)
+ void timer_handler(int num);
+#endif

// Function prototypes related to 64-bit pseudo-random number generation
and
// bitwise operations:
@@ -140,5 +141,8 @@
static void *callback_data;
};

+#if defined(_MINGW_WINDOWS)
+ DWORD timer_handler(LPVOID arg);
+#endif

#endif
=======================================
--- /trunk/src/book.cpp Sat Jul 25 16:06:03 2009
+++ /trunk/src/book.cpp Wed Jul 28 10:48:07 2010
@@ -22,6 +22,7 @@
#include "gray.h"
#include "book.h"
#include "board_heuristic.h"
+#include <time.h>

using namespace std;

@@ -91,7 +92,7 @@
if (moves.empty())
continue;
//randomly put game on front or back
- srand(time(NULL));
+ srand((unsigned)time(NULL));
if (rand() % 1)
games.push_back(moves);
else
=======================================
--- /trunk/src/library.cpp Wed Jul 28 10:11:39 2010
+++ /trunk/src/library.cpp Wed Jul 28 10:48:07 2010
@@ -295,7 +295,7 @@
(*callback)(callback_data);
}
#elif defined(_MINGW_WINDOWS)
-DWORD Library::timer_handler(LPVOID arg)
+DWORD timer_handler(LPVOID arg)
{

// On Windows, Steve Ballmer is too busy throwing chairs to implement
SIGALRM.
@@ -319,7 +319,7 @@
// notifying the
other
// thread.

- double dTimeInterval = (double)timePerMove;
+ double dTimeInterval = (double)Library::timePerMove;

HANDLE timer_id = INVALID_HANDLE_VALUE;

@@ -342,13 +342,13 @@
goto end;

// Notify the other thread - call the previously specified function.
- (*callback)(callback_data);
+ (*Library::callback)(Library::callback_data);

// Exit the timer thread.
end:
if (timer_id != INVALID_HANDLE_VALUE)
CloseHandle(timer_id);
- thread_destroy(&timer_thread);
+ Library::thread_destroy(&timer_thread);
return 0;
}
#endif
Reply all
Reply to author
Forward
0 new messages