From 45d706943b837b276bc8c5d5571f8b1cd1d8158a Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sat, 25 May 2013 12:46:03 -0700 Subject: [PATCH] Clean up ripple_json module and remove unnecessary includes --- .../ripple_json/json/json_batchallocator.h | 3 -- modules/ripple_json/json/json_features.h | 2 -- modules/ripple_json/json/json_forwards.h | 4 +-- modules/ripple_json/json/json_reader.cpp | 15 --------- modules/ripple_json/json/json_reader.h | 8 ----- modules/ripple_json/json/json_value.cpp | 21 ------------ modules/ripple_json/json/json_value.h | 14 -------- modules/ripple_json/json/json_writer.cpp | 13 -------- modules/ripple_json/json/json_writer.h | 6 ---- modules/ripple_json/ripple_json.cpp | 32 +++++++++++++++++++ modules/ripple_json/ripple_json.h | 25 ++++++++++++++- 11 files changed, 57 insertions(+), 86 deletions(-) diff --git a/modules/ripple_json/json/json_batchallocator.h b/modules/ripple_json/json/json_batchallocator.h index 87ea5ed80..a044d6e81 100644 --- a/modules/ripple_json/json/json_batchallocator.h +++ b/modules/ripple_json/json/json_batchallocator.h @@ -1,9 +1,6 @@ #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED # define JSONCPP_BATCHALLOCATOR_H_INCLUDED -# include -# include - # ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { diff --git a/modules/ripple_json/json/json_features.h b/modules/ripple_json/json/json_features.h index 5e4a6df8f..aac1686d1 100644 --- a/modules/ripple_json/json/json_features.h +++ b/modules/ripple_json/json/json_features.h @@ -1,8 +1,6 @@ #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED -#include "json_forwards.h" - namespace Json { /** \brief Configuration passed to reader and writer. diff --git a/modules/ripple_json/json/json_forwards.h b/modules/ripple_json/json/json_forwards.h index c9141edc1..e489b2b0b 100644 --- a/modules/ripple_json/json/json_forwards.h +++ b/modules/ripple_json/json/json_forwards.h @@ -1,7 +1,5 @@ #ifndef JSON_FORWARDS_H_INCLUDED -# define JSON_FORWARDS_H_INCLUDED - -# include "json_config.h" +#define JSON_FORWARDS_H_INCLUDED namespace Json { diff --git a/modules/ripple_json/json/json_reader.cpp b/modules/ripple_json/json/json_reader.cpp index e43ec107a..4e548b2dc 100644 --- a/modules/ripple_json/json/json_reader.cpp +++ b/modules/ripple_json/json/json_reader.cpp @@ -1,18 +1,3 @@ - -#include "json_reader.h" -#include "json_value.h" - -#include -#include -#include -#include -#include -#include - -#if _MSC_VER >= 1400 // VC++ 8.0 -#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. -#endif - namespace Json { // Implementation of class Features diff --git a/modules/ripple_json/json/json_reader.h b/modules/ripple_json/json/json_reader.h index a4dc4c58d..a4136f6e3 100644 --- a/modules/ripple_json/json/json_reader.h +++ b/modules/ripple_json/json/json_reader.h @@ -1,14 +1,6 @@ #ifndef CPPTL_JSON_READER_H_INCLUDED # define CPPTL_JSON_READER_H_INCLUDED -#include "json_features.h" -#include "json_value.h" - -#include -#include -#include -#include - namespace Json { /** \brief Unserialize a JSON document into a Value. diff --git a/modules/ripple_json/json/json_value.cpp b/modules/ripple_json/json/json_value.cpp index 49dc2d9bd..cf0dc8413 100644 --- a/modules/ripple_json/json/json_value.cpp +++ b/modules/ripple_json/json/json_value.cpp @@ -1,24 +1,3 @@ -#include -#include "json_value.h" -#include "json_writer.h" -#include -#include -#include -#include -#ifdef JSON_USE_CPPTL -# include -#endif -#include // size_t - -#include - -#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR -# include "json_batchallocator.h" -#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR - -#define JSON_ASSERT_UNREACHABLE assert( false ) -#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw -#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); namespace Json { diff --git a/modules/ripple_json/json/json_value.h b/modules/ripple_json/json/json_value.h index d16762f34..ae3dcf1fe 100644 --- a/modules/ripple_json/json/json_value.h +++ b/modules/ripple_json/json/json_value.h @@ -1,20 +1,6 @@ #ifndef CPPTL_JSON_H_INCLUDED # define CPPTL_JSON_H_INCLUDED -#include "json_forwards.h" - -#include -#include - -#ifndef JSON_USE_CPPTL_SMALLMAP -# include -#else -# include -#endif -#ifdef JSON_USE_CPPTL -# include -#endif - /** \brief JSON (JavaScript Object Notation). */ namespace Json { diff --git a/modules/ripple_json/json/json_writer.cpp b/modules/ripple_json/json/json_writer.cpp index f0ce4f67b..6fff8f9e0 100644 --- a/modules/ripple_json/json/json_writer.cpp +++ b/modules/ripple_json/json/json_writer.cpp @@ -1,16 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include - -#include "json_writer.h" - -#if _MSC_VER >= 1400 // VC++ 8.0 -#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. -#endif namespace Json { diff --git a/modules/ripple_json/json/json_writer.h b/modules/ripple_json/json/json_writer.h index a6b476e7f..e38761510 100644 --- a/modules/ripple_json/json/json_writer.h +++ b/modules/ripple_json/json/json_writer.h @@ -1,12 +1,6 @@ #ifndef JSON_WRITER_H_INCLUDED # define JSON_WRITER_H_INCLUDED -# include "json_value.h" - -# include -# include -# include - namespace Json { class Value; diff --git a/modules/ripple_json/ripple_json.cpp b/modules/ripple_json/ripple_json.cpp index a81d5fa0b..ea4c6cf77 100644 --- a/modules/ripple_json/ripple_json.cpp +++ b/modules/ripple_json/ripple_json.cpp @@ -24,6 +24,38 @@ #include "ripple_json.h" +// VFALCO: TODO Remove unneeded includes +#include +//#include +//#include +#include +//#include +//#include +//#include +//#include +//#include +//#include + +#ifdef JSON_USE_CPPTL +# include +#endif + +// VFALCO: TODO, eliminate this boost dependency +#include + +#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR +#include "json/json_batchallocator.h" +#endif + +#define JSON_ASSERT_UNREACHABLE assert( false ) +#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw +#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message ); + +//#if _MSC_VER >= 1400 // VC++ 8.0 +//#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated. +//#endif + #include "json/json_reader.cpp" #include "json/json_value.cpp" #include "json/json_writer.cpp" + diff --git a/modules/ripple_json/ripple_json.h b/modules/ripple_json/ripple_json.h index 64834cea0..009acd54f 100644 --- a/modules/ripple_json/ripple_json.h +++ b/modules/ripple_json/ripple_json.h @@ -32,8 +32,31 @@ #ifndef RIPPLE_JSON_H #define RIPPLE_JSON_H +// VFALCO: TODO Remove unneeded includes +#include +//#include +#include +//#include +#include +//#include +#include + +// Needed before these cpptl includes +#include "json/json_config.h" + +#ifndef JSON_USE_CPPTL_SMALLMAP +# include +#else +# include +#endif +#ifdef JSON_USE_CPPTL +# include +#endif + +#include "json/json_forwards.h" +#include "json/json_features.h" +#include "json/json_value.h" #include "json/json_reader.h" #include "json/json_writer.h" -#include "json/json_value.h" #endif