[dasher: 9/61] Cleanup in Common project.
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 9/61] Cleanup in Common project.
- Date: Thu, 28 Dec 2017 10:03:20 +0000 (UTC)
commit 22bfc6d89e9979a76138374c50cf7e98e6655354
Author: Ada Majorek <amajorek google com>
Date: Mon Mar 7 21:13:22 2016 -0800
Cleanup in Common project.
Src/Common/Common.vcxproj | 6 ------
Src/Common/Hash.h | 20 --------------------
Src/Common/Makefile.am | 6 +-----
Src/Common/Random.h | 29 -----------------------------
Src/Common/Types/int.h | 20 +++-----------------
Src/Common/Types/int32.h | 22 ----------------------
Src/Common/Types/int64.h | 27 ---------------------------
Src/Common/myassert.h | 10 ----------
Src/DasherCore/DasherModel.cpp | 1 -
Src/DasherCore/DasherTypes.h | 8 +++-----
Src/Win32/Widgets/Screen.h | 2 --
11 files changed, 7 insertions(+), 144 deletions(-)
---
diff --git a/Src/Common/Common.vcxproj b/Src/Common/Common.vcxproj
index 90b0112..050e14b 100644
--- a/Src/Common/Common.vcxproj
+++ b/Src/Common/Common.vcxproj
@@ -191,18 +191,12 @@
<ClInclude Include="Allocators\PooledAlloc.h" />
<ClInclude Include="Allocators\SimplePooledAlloc.h" />
<ClInclude Include="Common.h" />
- <ClInclude Include="Hash.h" />
<ClInclude Include="MSVC_Unannoy.h" />
<ClInclude Include="myassert.h" />
<ClInclude Include="NoClones.h" />
- <ClInclude Include="Platform.h" />
- <ClInclude Include="Random.h" />
<ClInclude Include="SBTree.h" />
<ClInclude Include="Trace.h" />
<ClInclude Include="Types\int.h" />
- <ClInclude Include="Types\int32.h" />
- <ClInclude Include="Types\int64.h" />
- <ClInclude Include="Types\Range.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="SBTree.cpp" />
diff --git a/Src/Common/Makefile.am b/Src/Common/Makefile.am
index e69dce0..0ac8dac 100644
--- a/Src/Common/Makefile.am
+++ b/Src/Common/Makefile.am
@@ -5,22 +5,18 @@ libdashermisc_la_SOURCES = \
Common.h \
Globber.h \
Globber.cpp \
- Hash.h \
I18n.h \
MSVC_Unannoy.h \
myassert.h \
mydebug.h \
ModuleSettings.h \
NoClones.h \
- Random.h \
Trace.cpp \
Trace.h \
Allocators/PooledAlloc.h \
Allocators/SimplePooledAlloc.h \
Platform/stdminmax.h \
- Types/int.h \
- Types/int32.h \
- Types/int64.h
+ Types/int.h
# IOstreamDasherEdit.cc I have no idea what this does, but it's broken now
# IOstreamDasherEdit.h
diff --git a/Src/Common/Types/int.h b/Src/Common/Types/int.h
index 29c2b88..82fa009 100644
--- a/Src/Common/Types/int.h
+++ b/Src/Common/Types/int.h
@@ -16,13 +16,6 @@ typedef unsigned __int64 uint64;
typedef int int32;
typedef unsigned int uint32;
-#include <limits>
-
-#ifndef LLONG_MAX
-#define LLONG_MAX 9223372036854775807
-#define LLONG_MIN (-LLONG_MAX - 1)
-#endif
-
#else
typedef long long int int64;
@@ -30,18 +23,11 @@ typedef unsigned long long int uint64;
typedef int int32;
typedef unsigned int uint32;
-#ifndef LLONG_MAX
-#define LLONG_MAX 9223372036854775807LL
-#define LLONG_MIN (-LLONG_MAX - 1LL)
#endif
-#endif
-
-const int64 int64_max = LLONG_MAX;
-const int64 int64_min = LLONG_MIN;
+#include <limits>
-template < class T > inline bool AreDifferentSigns(T lhs, T rhs) {
- return ((lhs ^ rhs) < 0);
-}
+const int64 int64_max = std::numeric_limits<int64>::max();
+const int64 int64_min = std::numeric_limits<int64>::min();
#endif
diff --git a/Src/Common/myassert.h b/Src/Common/myassert.h
index 09357fc..e710405 100644
--- a/Src/Common/myassert.h
+++ b/Src/Common/myassert.h
@@ -61,16 +61,6 @@ void __cdecl __debugbreak(void);
/////////////////////////////////////////////////////////////////////////////
-// DJW - useful 'compile time' assertion
-template < int >struct CompileTimeError;
-template <> struct CompileTimeError <true > {
-};
-
-#define STATIC_CHECK(expr, msg) \
-{ CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; };
-
-/////////////////////////////////////////////////////////////////////////////
-
// Pointer checking - some CRTs provide functionality to check the integrity of memory
// DASHER_ASSERT_VALIDPTR_RW(p) asserts that a pointer is valid for read and write
diff --git a/Src/DasherCore/DasherModel.cpp b/Src/DasherCore/DasherModel.cpp
index 8d1cdfd..3bc9a22 100644
--- a/Src/DasherCore/DasherModel.cpp
+++ b/Src/DasherCore/DasherModel.cpp
@@ -24,7 +24,6 @@
#include <iostream>
#include <cstring>
-#include "../Common/Random.h"
#include "DasherModel.h"
#include "DasherView.h"
#include "Parameters.h"
diff --git a/Src/DasherCore/DasherTypes.h b/Src/DasherCore/DasherTypes.h
index 8de53bc..41af4d7 100644
--- a/Src/DasherCore/DasherTypes.h
+++ b/Src/DasherCore/DasherTypes.h
@@ -34,18 +34,16 @@
//
#include "../Common/Types/int.h"
-#include "../Common/Types/int32.h"
-#include "../Common/Types/int64.h"
#include <string>
#include <vector>
namespace Dasher {
// DasherModel co-ordinates are of type myint
- typedef Cint64 myint;
- typedef Cint64 dasherint;
+ typedef int64 myint;
+ typedef int64 dasherint;
// All screen co-ordinates are of type screenint
- typedef Cint32 screenint;
+ typedef int32 screenint;
// Using a signed symbol type allows "Out of band" ie negative {{{
// values to be used to flag non-symbol data. For example commands
diff --git a/Src/Win32/Widgets/Screen.h b/Src/Win32/Widgets/Screen.h
index 07f63af..43651c8 100644
--- a/Src/Win32/Widgets/Screen.h
+++ b/Src/Win32/Widgets/Screen.h
@@ -9,8 +9,6 @@
#ifndef __Screen_h__
#define __Screen_h__
-#include "../../Common/Hash.h"
-
#include "../../DasherCore/DasherScreen.h"
#include "../../DasherCore/DasherInterfaceBase.h"
#include "../../Common/NoClones.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]