[Avida-SVN] r1382 - in development: . source/analyze source/platform source/targets/avida-viewer source/tools
brysonda at myxo.css.msu.edu
brysonda at myxo.css.msu.edu
Sat Mar 3 19:40:14 PST 2007
Author: brysonda
Date: 2007-03-03 22:40:14 -0500 (Sat, 03 Mar 2007)
New Revision: 1382
Removed:
development/source/platform/win32-pthread/
Modified:
development/Avida.vcproj
development/source/analyze/cMutationalNeighborhood.cc
development/source/analyze/cMutationalNeighborhood.h
development/source/analyze/cMutationalNeighborhoodResults.h
development/source/targets/avida-viewer/cAnalyzeScreen.h
development/source/targets/avida-viewer/cAnalyzeView.cc
development/source/targets/avida-viewer/cTextWindow.h
development/source/tools/cRWLock.h
development/source/tools/platform.h
Log:
Update Visual Studio project. Fix various windows specific errors in the platform macros. Change over MutationalNeighborhood's rwlock to cRWLock so that it compiles on windows.
Modified: development/Avida.vcproj
===================================================================
--- development/Avida.vcproj 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/Avida.vcproj 2007-03-04 03:40:14 UTC (rev 1382)
@@ -39,8 +39,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories=""$(ProjectDir)source\tools";"$(ProjectDir)source\targets\avida-viewer";"$(ProjectDir)source\platform\msvc2005";"$(ProjectDir)source\platform\msvc2005\pdcurses";"$(ProjectDir)source\platform\win32-pthread";"$(ProjectDir)source\main";"$(ProjectDir)source\drivers";"$(ProjectDir)source\cpu";"$(ProjectDir)source\classification";"$(ProjectDir)source\analyze";"$(ProjectDir)source\actions";"$(ProjectDir)source""
- PreprocessorDefinitions="NOMACROS;DEBUG;WINDOWS;WIN32;_WINDOWS"
+ AdditionalIncludeDirectories=""$(ProjectDir)source\tools";"$(ProjectDir)source\targets\avida-viewer";"$(ProjectDir)source\platform\msvc2005";"$(ProjectDir)source\platform\msvc2005\pdcurses";"$(ProjectDir)source\main";"$(ProjectDir)source\drivers";"$(ProjectDir)source\cpu";"$(ProjectDir)source\classification";"$(ProjectDir)source\analyze";"$(ProjectDir)source\actions";"$(ProjectDir)source""
+ PreprocessorDefinitions="NOMACROS;DEBUG;WIN32;_WIN32"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -121,8 +121,8 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
WholeProgramOptimization="true"
- AdditionalIncludeDirectories=""$(ProjectDir)source\tools";"$(ProjectDir)source\targets\avida-viewer";"$(ProjectDir)source\platform\msvc2005";"$(ProjectDir)source\platform\msvc2005\pdcurses";"$(ProjectDir)source\platform\win32-pthread";"$(ProjectDir)source\main";"$(ProjectDir)source\drivers";"$(ProjectDir)source\cpu";"$(ProjectDir)source\classification";"$(ProjectDir)source\analyze";"$(ProjectDir)source\actions";"$(ProjectDir)source""
- PreprocessorDefinitions="NOMACROS;NDEBUG;WINDOWS;WIN32;_WINDOWS"
+ AdditionalIncludeDirectories=""$(ProjectDir)source\tools";"$(ProjectDir)source\targets\avida-viewer";"$(ProjectDir)source\platform\msvc2005";"$(ProjectDir)source\platform\msvc2005\pdcurses";"$(ProjectDir)source\main";"$(ProjectDir)source\drivers";"$(ProjectDir)source\cpu";"$(ProjectDir)source\classification";"$(ProjectDir)source\analyze";"$(ProjectDir)source\actions";"$(ProjectDir)source""
+ PreprocessorDefinitions="NOMACROS;NDEBUG;WIN32;_WIN32"
ExceptionHandling="1"
RuntimeLibrary="0"
BufferSecurityCheck="false"
@@ -305,6 +305,10 @@
>
</File>
<File
+ RelativePath=".\source\tools\cConditionVariable.h"
+ >
+ </File>
+ <File
RelativePath=".\source\tools\cConstSchedule.h"
>
</File>
@@ -601,6 +605,10 @@
>
</File>
<File
+ RelativePath=".\source\tools\cMutex.h"
+ >
+ </File>
+ <File
RelativePath=".\source\main\cMxCodeArray.h"
>
</File>
@@ -693,6 +701,10 @@
>
</File>
<File
+ RelativePath=".\source\tools\cRWLock.h"
+ >
+ </File>
+ <File
RelativePath=".\source\main\cSaleItem.h"
>
</File>
@@ -897,15 +909,15 @@
>
</File>
<File
- RelativePath=".\source\actions\PopulationActions.h"
+ RelativePath=".\source\tools\platform.h"
>
</File>
<File
- RelativePath=".\source\actions\PrintActions.h"
+ RelativePath=".\source\actions\PopulationActions.h"
>
</File>
<File
- RelativePath=".\source\platform\win32-pthread\pthread.h"
+ RelativePath=".\source\actions\PrintActions.h"
>
</File>
<File
Modified: development/source/analyze/cMutationalNeighborhood.cc
===================================================================
--- development/source/analyze/cMutationalNeighborhood.cc 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/analyze/cMutationalNeighborhood.cc 2007-03-04 03:40:14 UTC (rev 1382)
@@ -379,7 +379,7 @@
delete pend;
}
- pthread_rwlock_unlock(&m_rwlock);
+ m_rwlock.WriteUnlock();
}
Modified: development/source/analyze/cMutationalNeighborhood.h
===================================================================
--- development/source/analyze/cMutationalNeighborhood.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/analyze/cMutationalNeighborhood.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -31,6 +31,9 @@
#ifndef cMutex_h
#include "cMutex.h"
#endif
+#ifndef cRWLock_h
+#include "cRWLock.h"
+#endif
#ifndef cString_h
#include "cString.h"
#endif
@@ -44,8 +47,6 @@
#include "tMatrix.h"
#endif
-#include <pthread.h>
-
class cAvidaContext;
class cCPUTestInfo;
class cDataFile;
@@ -64,7 +65,7 @@
// Internal state information
// --------------------------------------------------------------------------
- pthread_rwlock_t m_rwlock;
+ cRWLock m_rwlock;
cMutex m_mutex;
bool m_initialized;
@@ -191,15 +192,10 @@
cMutationalNeighborhood(cWorld* world, const cGenome& genome, const cInstSet& inst_set, int target)
: m_world(world), m_initialized(false), m_inst_set(inst_set), m_target(target), m_base_genome(genome)
{
- pthread_rwlock_init(&m_rwlock, NULL);
-
// Acquire write lock, to prevent any Results instances before computing
- pthread_rwlock_wrlock(&m_rwlock);
+ m_rwlock.WriteLock();
}
- ~cMutationalNeighborhood()
- {
- pthread_rwlock_destroy(&m_rwlock);
- }
+ ~cMutationalNeighborhood() { ; }
void Process(cAvidaContext& ctx);
Modified: development/source/analyze/cMutationalNeighborhoodResults.h
===================================================================
--- development/source/analyze/cMutationalNeighborhoodResults.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/analyze/cMutationalNeighborhoodResults.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -41,16 +41,16 @@
public:
cMutationalNeighborhoodResults(cMutationalNeighborhood& src) : m_src(src)
{
- pthread_rwlock_rdlock(&m_src.m_rwlock);
+ m_src.m_rwlock.ReadLock();
}
cMutationalNeighborhoodResults(cMutationalNeighborhood* src) : m_src(*src)
{
- pthread_rwlock_rdlock(&m_src.m_rwlock);
+ m_src.m_rwlock.ReadLock();
}
~cMutationalNeighborhoodResults()
{
- pthread_rwlock_unlock(&m_src.m_rwlock);
+ m_src.m_rwlock.ReadUnlock();
}
inline void PrintStats(cDataFile& df, int update = -1) const { m_src.PrintStats(df, update); }
Modified: development/source/targets/avida-viewer/cAnalyzeScreen.h
===================================================================
--- development/source/targets/avida-viewer/cAnalyzeScreen.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/targets/avida-viewer/cAnalyzeScreen.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -8,18 +8,17 @@
#ifndef cAnalyzeScreen_h
#define cAnalyzeScreen_h
-#ifndef cTabBox_h
-#include "cTabBox.h"
+#ifndef cScreen_h
+#include "cScreen.h"
#endif
-
#ifndef cStringList_h
#include "cStringList.h"
#endif
-
-#ifndef cScreen_h
-#include "cScreen.h"
+#ifndef cTabBox_h
+#include "cTabBox.h"
#endif
+
class cAnalyzeCommand;
class cWorld;
@@ -64,7 +63,7 @@
cAnalyzeScreen(cWorld* world, int y_size, int x_size, int y_start, int x_start, cViewInfo& in_info)
: cScreen(y_size, x_size, y_start, x_start, in_info)
, m_world(world)
- , tab_box(this, 0, 0, Height() - 1, Width())
+ , tab_box(this, 0, 0, Height() - 1, Width())
, rollback_line(0)
, cursor_pos(0)
, nest_depth(0)
Modified: development/source/targets/avida-viewer/cAnalyzeView.cc
===================================================================
--- development/source/targets/avida-viewer/cAnalyzeView.cc 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/targets/avida-viewer/cAnalyzeView.cc 2007-03-04 03:40:14 UTC (rev 1382)
@@ -25,7 +25,7 @@
using namespace std;
-cTextWindow * cAnalyzeView::base_window = NULL;
+cTextWindow* cAnalyzeView::base_window = NULL;
cBarScreen* cAnalyzeView::bar_screen = NULL;
Modified: development/source/targets/avida-viewer/cTextWindow.h
===================================================================
--- development/source/targets/avida-viewer/cTextWindow.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/targets/avida-viewer/cTextWindow.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -72,7 +72,7 @@
// These function return the number of characters wide or high
// (respectively) that the screen is.
-#if AVIDA_PLATFROM(WINDOWS)
+#if AVIDA_PLATFORM(WINDOWS)
// Windows returns the screen width and height
inline int Width() { return win_id->_maxx; }
inline int Height() { return win_id->_maxy; }
Modified: development/source/tools/cRWLock.h
===================================================================
--- development/source/tools/cRWLock.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/tools/cRWLock.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -101,3 +101,5 @@
#endif
+
+#endif
Modified: development/source/tools/platform.h
===================================================================
--- development/source/tools/platform.h 2007-03-04 00:20:46 UTC (rev 1381)
+++ development/source/tools/platform.h 2007-03-04 03:40:14 UTC (rev 1382)
@@ -25,7 +25,8 @@
#ifndef platform_h
#define platform_h
-#define AVIDA_PLATFORM(PROP) (defined(AVIDA_PLATFORM_##PROP) && AVIDA_PLATFORM_##PROP)
+// spaces between defined's parentheses and contained value are required by Visual Studio's preprocessor
+#define AVIDA_PLATFORM(PROP) (defined( AVIDA_PLATFORM_ ## PROP ) && AVIDA_PLATFORM_##PROP)
#if defined(WIN32) || defined(_WIN32)
# define AVIDA_PLATFORM_WINDOWS 1
@@ -34,6 +35,8 @@
# else
# define AVIDA_PLATFORM_THREADS 0
# endif
+ // Disable warning C4355: 'this' : used in base member initializer list
+# pragma warning( disable : 4355 )
#endif
#if defined(__APPLE__) || defined(unix) || defined(__unix) || defined(__unix__) || defined (__NetBSD__) || defined(_AIX)
More information about the Avida-cvs
mailing list