This commit is contained in:
Daniel Larimer 2015-02-11 18:28:29 -05:00
commit 71e4e221b7
3 changed files with 26 additions and 10 deletions

View file

@ -1,15 +1,20 @@
#pragma once #pragma once
#include <fc/fwd.hpp> #include <fc/fwd.hpp>
#include <fc/string.hpp> #include <fc/io/raw_fwd.hpp>
#include <fc/reflect/typename.hpp> #include <fc/reflect/typename.hpp>
<<<<<<< HEAD
#include <fc/io/raw_fwd.hpp> #include <fc/io/raw_fwd.hpp>
=======
#include <fc/string.hpp>
>>>>>>> 13430fce127bb3fdba53d218dd840aea8e46408c
namespace fc{ namespace fc{
class sha512; class sha512;
class sha256; class sha256;
class ripemd160 class ripemd160
{ {
public: public:
ripemd160(); ripemd160();
@ -65,10 +70,10 @@ class ripemd160
friend bool operator != ( const ripemd160& h1, const ripemd160& h2 ); friend bool operator != ( const ripemd160& h1, const ripemd160& h2 );
friend ripemd160 operator ^ ( const ripemd160& h1, const ripemd160& h2 ); friend ripemd160 operator ^ ( const ripemd160& h1, const ripemd160& h2 );
friend bool operator >= ( const ripemd160& h1, const ripemd160& h2 ); friend bool operator >= ( const ripemd160& h1, const ripemd160& h2 );
friend bool operator > ( const ripemd160& h1, const ripemd160& h2 ); friend bool operator > ( const ripemd160& h1, const ripemd160& h2 );
friend bool operator < ( const ripemd160& h1, const ripemd160& h2 ); friend bool operator < ( const ripemd160& h1, const ripemd160& h2 );
uint32_t _hash[5]; uint32_t _hash[5];
}; };
class variant; class variant;

View file

@ -1,3 +1,4 @@
#pragma once
#include <fc/uint128.hpp> #include <fc/uint128.hpp>
#define FC_REAL128_PRECISION (uint64_t(1000000) * uint64_t(1000000) * uint64_t(1000000)) #define FC_REAL128_PRECISION (uint64_t(1000000) * uint64_t(1000000) * uint64_t(1000000))
@ -38,4 +39,14 @@ namespace fc {
void to_variant( const real128& var, variant& vo ); void to_variant( const real128& var, variant& vo );
void from_variant( const variant& var, real128& vo ); void from_variant( const variant& var, real128& vo );
namespace raw
{
template<typename Stream>
inline void pack( Stream& s, const real128& value_to_pack ) { s.write( (char*)&value_to_pack, sizeof(value_to_pack) ); }
template<typename Stream>
inline void unpack( Stream& s, real128& value_to_unpack ) { s.read( (char*)&value_to_unpack, sizeof(value_to_unpack) ); }
}
} // namespace fc } // namespace fc

View file

@ -520,13 +520,13 @@ namespace fc {
}; };
simple_lock_file::impl::impl(const path& lock_file_path) : simple_lock_file::impl::impl(const path& lock_file_path) :
is_locked(false),
lock_file_path(lock_file_path),
#ifdef _WIN32 #ifdef _WIN32
file_handle(INVALID_HANDLE_VALUE) file_handle(INVALID_HANDLE_VALUE),
#else #else
file_handle(-1) file_handle(-1),
#endif #endif
is_locked(false),
lock_file_path(lock_file_path)
{} {}
simple_lock_file::impl::~impl() simple_lock_file::impl::~impl()