Skip to content

Commit 7f93f26

Browse files
authored
Merge pull request #120 from pmconrad/1584_simplification
1584 simplifications
2 parents 6b1fdd5 + 4511300 commit 7f93f26

File tree

141 files changed

+412
-6331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+412
-6331
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ script:
3131
- set -o pipefail
3232
- tests/run-parallel-tests.sh tests/all_tests
3333
- "tests/api 2>&1 | grep -vE 'callback result 9|remote_calc->add. 4, 5 .: 9|set callback|] \\.$'"
34-
- tests/bip_lock 2>&1 | cat
3534
- tests/hmac_test 2>&1 | cat
3635
- tests/ecc_test README.md 2>&1 | cat
3736
- tests/log_test 2>&1 | cat

CMakeLists.txt

+3-22
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ SET( DEFAULT_LIBRARY_INSTALL_DIR lib/ )
2424
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
2525
SET( CMAKE_DEBUG_POSTFIX _debug )
2626
SET( BUILD_SHARED_LIBS NO )
27-
SET( ECC_IMPL secp256k1 CACHE STRING "secp256k1 or openssl or mixed" )
2827

2928
set(platformBitness 32)
3029
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -37,17 +36,6 @@ SET(BOOST_COMPONENTS)
3736
LIST(APPEND BOOST_COMPONENTS thread date_time filesystem system program_options chrono unit_test_framework context iostreams regex)
3837
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
3938

40-
IF( ECC_IMPL STREQUAL openssl )
41-
SET( ECC_REST src/crypto/elliptic_impl_pub.cpp )
42-
ELSE( ECC_IMPL STREQUAL openssl )
43-
SET( ECC_LIB secp256k1 )
44-
IF( ECC_IMPL STREQUAL mixed )
45-
SET( ECC_REST src/crypto/elliptic_impl_priv.cpp src/crypto/elliptic_impl_pub.cpp )
46-
ELSE( ECC_IMPL STREQUAL mixed )
47-
SET( ECC_REST src/crypto/elliptic_impl_priv.cpp )
48-
ENDIF( ECC_IMPL STREQUAL mixed )
49-
ENDIF( ECC_IMPL STREQUAL openssl )
50-
5139
# Configure secp256k1-zkp
5240
if ( MSVC )
5341
# autoconf won't work here, hard code the defines
@@ -233,17 +221,12 @@ set( fc_sources
233221
src/io/sstream.cpp
234222
src/io/json.cpp
235223
src/io/varint.cpp
236-
src/io/console.cpp
237224
src/filesystem.cpp
238225
src/interprocess/signals.cpp
239226
src/interprocess/file_mapping.cpp
240-
src/interprocess/mmap_struct.cpp
241-
src/interprocess/file_mutex.cpp
242227
src/rpc/cli.cpp
243228
src/rpc/http_api.cpp
244-
src/rpc/json_connection.cpp
245229
src/rpc/state.cpp
246-
src/rpc/bstate.cpp
247230
src/rpc/websocket_api.cpp
248231
src/log/log_message.cpp
249232
src/log/logger.cpp
@@ -257,7 +240,6 @@ set( fc_sources
257240
src/crypto/aes.cpp
258241
src/crypto/crc.cpp
259242
src/crypto/city.cpp
260-
src/crypto/base36.cpp
261243
src/crypto/base58.cpp
262244
src/crypto/base64.cpp
263245
src/crypto/bigint.cpp
@@ -268,10 +250,9 @@ set( fc_sources
268250
src/crypto/sha224.cpp
269251
src/crypto/sha512.cpp
270252
src/crypto/dh.cpp
271-
src/crypto/blowfish.cpp
272253
src/crypto/elliptic_common.cpp
273-
${ECC_REST}
274-
src/crypto/elliptic_${ECC_IMPL}.cpp
254+
src/crypto/elliptic_impl_priv.cpp
255+
src/crypto/elliptic_secp256k1.cpp
275256
src/crypto/rand.cpp
276257
src/network/tcp_socket.cpp
277258
src/network/udp_socket.cpp
@@ -401,7 +382,7 @@ target_include_directories(fc
401382
IF(NOT WIN32)
402383
set(LINK_USR_LOCAL_LIB -L/usr/local/lib)
403384
ENDIF()
404-
target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${editline_libraries} ${ECC_LIB} )
385+
target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${editline_libraries} secp256k1 )
405386

406387
if(MSVC)
407388
set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )

fc.natvis

+1-7
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131
</Expand>
3232
</Type>
3333

34-
<Type Name="fc::string">
35-
<DisplayString>{my}</DisplayString>
36-
<Expand>
37-
<ExpandedItem>my</ExpandedItem>
38-
</Expand>
39-
</Type>
4034

4135
<Type Name="fc::optional&lt;*&gt;">
4236
<DisplayString Condition="!_valid">invalid</DisplayString>
@@ -54,4 +48,4 @@
5448
</Expand>
5549
</Type>
5650

57-
</AutoVisualizer>
51+
</AutoVisualizer>

include/fc/actor.hpp

-65
This file was deleted.

include/fc/aligned.hpp

-14
This file was deleted.

include/fc/any.hpp

-7
This file was deleted.

include/fc/api.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <fc/thread/future.hpp>
3-
#include <fc/any.hpp>
43
#include <functional>
4+
#include <boost/any.hpp>
55
#include <boost/config.hpp>
66

77
// ms visual c++ (as of 2013) doesn't accept the standard syntax for calling a
@@ -75,7 +75,7 @@ namespace fc {
7575
api( const T& p )
7676
:_vtable( std::make_shared<vtable_type>() )
7777
{
78-
_data = std::make_shared<fc::any>(p);
78+
_data = std::make_shared<boost::any>(p);
7979
T& ptr = boost::any_cast<T&>(*_data);
8080
auto& pointed_at = *ptr;
8181
typedef typename std::remove_reference<decltype(pointed_at)>::type source_vtable_type;
@@ -95,7 +95,7 @@ namespace fc {
9595

9696
protected:
9797
std::shared_ptr<vtable_type> _vtable;
98-
std::shared_ptr<fc::any> _data;
98+
std::shared_ptr<boost::any> _data;
9999
};
100100

101101
} // namespace fc

include/fc/array.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace fc {
112112
std::vector<char> ve = v.as< std::vector<char> >( 1 );
113113
if( ve.size() )
114114
{
115-
memcpy(&bi, ve.data(), fc::min<size_t>(ve.size(),sizeof(bi)) );
115+
memcpy(&bi, ve.data(), std::min<size_t>(ve.size(),sizeof(bi)) );
116116
}
117117
else
118118
memset( &bi, char(0), sizeof(bi) );

include/fc/asio.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ namespace asio {
282282
{
283283
public:
284284
istream( std::shared_ptr<AsyncReadStream> str )
285-
:_stream( fc::move(str) ){}
285+
:_stream( std::move(str) ){}
286286

287287
virtual size_t readsome( char* buf, size_t len )
288288
{
@@ -302,7 +302,7 @@ namespace asio {
302302
{
303303
public:
304304
ostream( std::shared_ptr<AsyncWriteStream> str )
305-
:_stream( fc::move(str) ){}
305+
:_stream( std::move(str) ){}
306306

307307
virtual size_t writesome( const char* buf, size_t len )
308308
{

include/fc/compress/zlib.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#pragma once
22

3-
#include <fc/string.hpp>
3+
#include <string>
44

55
namespace fc
66
{
77

8-
string zlib_compress(const string& in);
8+
std::string zlib_compress(const std::string& in);
99

1010
} // namespace fc

include/fc/container/deque_fwd.hpp

-14
This file was deleted.

include/fc/crypto/base36.hpp

-10
This file was deleted.

include/fc/crypto/base58.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <fc/string.hpp>
2+
#include <string>
33
#include <vector>
44

55
namespace fc {

include/fc/crypto/bigint.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include <stdint.h>
3-
#include <fc/string.hpp>
4-
#include <fc/vector.hpp>
3+
#include <string>
4+
#include <vector>
55

66
struct bignum_st;
77
typedef bignum_st BIGNUM;
@@ -55,7 +55,7 @@ namespace fc {
5555
bigint operator--(int);
5656
bigint& operator--();
5757

58-
operator fc::string()const;
58+
operator std::string()const;
5959

6060
// returns bignum as bigendian bytes
6161
operator std::vector<char>()const;

0 commit comments

Comments
 (0)