mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Tidy Json:
* Remove unused code. * Rename .inl file to .cpp. * Remove duplicate macros.
This commit is contained in:
committed by
Nik Bougalis
parent
57689c4e66
commit
7ef6e58024
@@ -2205,8 +2205,10 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\json\impl\json_valueiterator.inl">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_valueiterator.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
|
||||
@@ -2913,9 +2913,9 @@
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_value.cpp">
|
||||
<Filter>ripple\json\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\json\impl\json_valueiterator.inl">
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_valueiterator.cpp">
|
||||
<Filter>ripple\json\impl</Filter>
|
||||
</ClInclude>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp">
|
||||
<Filter>ripple\json\impl</Filter>
|
||||
</ClCompile>
|
||||
|
||||
@@ -30,34 +30,6 @@ const Int Value::minInt = Int ( ~ (UInt (-1) / 2) );
|
||||
const Int Value::maxInt = Int ( UInt (-1) / 2 );
|
||||
const UInt Value::maxUInt = UInt (-1);
|
||||
|
||||
// A "safe" implementation of strdup. Allow null pointer to be passed.
|
||||
// Also avoid warning on msvc80.
|
||||
//
|
||||
//inline char *safeStringDup( const char *czstring )
|
||||
//{
|
||||
// if ( czstring )
|
||||
// {
|
||||
// const size_t length = (unsigned int)( strlen(czstring) + 1 );
|
||||
// char *newString = static_cast<char *>( malloc( length ) );
|
||||
// memcpy( newString, czstring, length );
|
||||
// return newString;
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
//
|
||||
//inline char *safeStringDup( std::string const&str )
|
||||
//{
|
||||
// if ( !str.empty() )
|
||||
// {
|
||||
// const size_t length = str.length();
|
||||
// char *newString = static_cast<char *>( malloc( length + 1 ) );
|
||||
// memcpy( newString, str.c_str(), length );
|
||||
// newString[length] = 0;
|
||||
// return newString;
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
ValueAllocator::~ValueAllocator ()
|
||||
{
|
||||
}
|
||||
@@ -116,18 +88,6 @@ static struct DummyValueAllocatorInitializer
|
||||
}
|
||||
} dummyValueAllocatorInitializer;
|
||||
|
||||
|
||||
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// ValueInternals...
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
# include <ripple/json/impl/json_valueiterator.inl>
|
||||
|
||||
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
//==============================================================================
|
||||
|
||||
// included by json_value.cpp
|
||||
// everything is within Json namespace
|
||||
|
||||
#include <ripple/json/json_value.h>
|
||||
|
||||
namespace Json {
|
||||
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
@@ -206,3 +208,5 @@ ValueIterator::operator = ( const SelfType& other )
|
||||
copy ( other );
|
||||
return *this;
|
||||
}
|
||||
|
||||
} // Json
|
||||
@@ -25,15 +25,9 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
// For json/
|
||||
//
|
||||
|
||||
#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 );
|
||||
|
||||
#include <ripple/json/impl/json_reader.cpp>
|
||||
#include <ripple/json/impl/json_value.cpp>
|
||||
#include <ripple/json/impl/json_valueiterator.cpp>
|
||||
#include <ripple/json/impl/json_writer.cpp>
|
||||
#include <ripple/json/impl/to_string.cpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user