From 3fef9169720d03dd2e134b5396d25401a7f7d539 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 16 Sep 2014 16:33:57 -0700 Subject: [PATCH] Move some constants to core/SystemParameters.h --- Builds/VisualStudio2013/RippleD.vcxproj | 4 ++-- Builds/VisualStudio2013/RippleD.vcxproj.filters | 6 +++--- src/ripple/core/Config.h | 10 +--------- .../RippleSystem.h => core/SystemParameters.h} | 13 +++++++++++-- src/ripple/core/impl/Config.cpp | 2 +- src/ripple/data/protocol/STAmount.cpp | 3 ++- src/ripple/net/impl/RPCUtil.cpp | 2 +- src/ripple/unity/data.h | 1 - 8 files changed, 21 insertions(+), 20 deletions(-) rename src/ripple/{data/protocol/RippleSystem.h => core/SystemParameters.h} (77%) diff --git a/Builds/VisualStudio2013/RippleD.vcxproj b/Builds/VisualStudio2013/RippleD.vcxproj index 83161c7440..7666a98643 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj +++ b/Builds/VisualStudio2013/RippleD.vcxproj @@ -2459,6 +2459,8 @@ + + True @@ -2504,8 +2506,6 @@ - - True diff --git a/Builds/VisualStudio2013/RippleD.vcxproj.filters b/Builds/VisualStudio2013/RippleD.vcxproj.filters index 64d3f98d86..53206b12fe 100644 --- a/Builds/VisualStudio2013/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2013/RippleD.vcxproj.filters @@ -3525,6 +3525,9 @@ ripple\core + + ripple\core + ripple\data\crypto @@ -3579,9 +3582,6 @@ ripple\data\protocol - - ripple\data\protocol - ripple\data\protocol diff --git a/src/ripple/core/Config.h b/src/ripple/core/Config.h index 271e6ea9d8..db72e91d2b 100644 --- a/src/ripple/core/Config.h +++ b/src/ripple/core/Config.h @@ -21,6 +21,7 @@ #define RIPPLE_CORE_CONFIG_H_INCLUDED #include +#include #include #include #include @@ -99,15 +100,6 @@ protected: //------------------------------------------------------------------------------ -// VFALCO TODO Replace these with beast "unsigned long long" generators -// VFALCO NOTE Apparently these are used elsewhere. Make them constants in the config -// or in the Application -// -#define SYSTEM_CURRENCY_GIFT 1000ull -#define SYSTEM_CURRENCY_USERS 100000000ull -#define SYSTEM_CURRENCY_PARTS 1000000ull // 10^SYSTEM_CURRENCY_PRECISION -#define SYSTEM_CURRENCY_START (SYSTEM_CURRENCY_GIFT*SYSTEM_CURRENCY_USERS*SYSTEM_CURRENCY_PARTS) - const int SYSTEM_PEER_PORT = 6561; enum SizedItemName diff --git a/src/ripple/data/protocol/RippleSystem.h b/src/ripple/core/SystemParameters.h similarity index 77% rename from src/ripple/data/protocol/RippleSystem.h rename to src/ripple/core/SystemParameters.h index 188e156b4a..842b2c1617 100644 --- a/src/ripple/data/protocol/RippleSystem.h +++ b/src/ripple/core/SystemParameters.h @@ -17,8 +17,8 @@ */ //============================================================================== -#ifndef RIPPLE_RIPPLESYSTEM_H -#define RIPPLE_RIPPLESYSTEM_H +#ifndef RIPPLE_CORE_SYSTEMPARAMETERS_H_INCLUDED +#define RIPPLE_CORE_SYSTEMPARAMETERS_H_INCLUDED namespace ripple { @@ -56,6 +56,15 @@ public: #define SYSTEM_NAME "ripple" #define SYSTEM_CURRENCY_PRECISION 6 +// VFALCO TODO Replace with C++11 long long constants +// VFALCO NOTE Apparently these are used elsewhere. Make them constants in the config +// or in the Application +// +#define SYSTEM_CURRENCY_GIFT 1000ull +#define SYSTEM_CURRENCY_USERS 100000000ull +#define SYSTEM_CURRENCY_PARTS 1000000ull // 10^SYSTEM_CURRENCY_PRECISION +#define SYSTEM_CURRENCY_START (SYSTEM_CURRENCY_GIFT*SYSTEM_CURRENCY_USERS*SYSTEM_CURRENCY_PARTS) + } // ripple #endif diff --git a/src/ripple/core/impl/Config.cpp b/src/ripple/core/impl/Config.cpp index ab9e7e88e0..cd96868bbd 100644 --- a/src/ripple/core/impl/Config.cpp +++ b/src/ripple/core/impl/Config.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/ripple/data/protocol/STAmount.cpp b/src/ripple/data/protocol/STAmount.cpp index fc15f58b8e..0bca31763d 100644 --- a/src/ripple/data/protocol/STAmount.cpp +++ b/src/ripple/data/protocol/STAmount.cpp @@ -17,8 +17,9 @@ */ //============================================================================== -#include +#include #include +#include #include namespace ripple { diff --git a/src/ripple/net/impl/RPCUtil.cpp b/src/ripple/net/impl/RPCUtil.cpp index c35e095311..86a6a45817 100644 --- a/src/ripple/net/impl/RPCUtil.cpp +++ b/src/ripple/net/impl/RPCUtil.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include namespace ripple { diff --git a/src/ripple/unity/data.h b/src/ripple/unity/data.h index 124e3acbe6..4b3d755997 100644 --- a/src/ripple/unity/data.h +++ b/src/ripple/unity/data.h @@ -34,7 +34,6 @@ typedef struct bignum_st BIGNUM; #include #include #include -#include #include // needs CKey #include #include // needs Serializer, TER