aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey <jeffryan@tamu.edu>2022-03-07 18:27:28 -0600
committerJeffrey <jeffryan@tamu.edu>2022-04-18 09:55:20 -0500
commit12b1b74d322f9933bb5d2ccbccd2566ee44cd3fc (patch)
treef786d2690abe629f655d521d9fc26f28e4805daa
parentBoring Old Deletes (diff)
downloadmonero-12b1b74d322f9933bb5d2ccbccd2566ee44cd3fc.tar.xz
Trimming Fat
Remove unused include statements or unused definitions.
-rw-r--r--contrib/epee/include/file_io_utils.h3
-rw-r--r--contrib/epee/include/misc_language.h52
-rw-r--r--contrib/epee/include/net/local_ip.h1
-rw-r--r--contrib/epee/include/storages/levin_abstract_invoke2.h48
-rw-r--r--contrib/epee/src/connection_basic.cpp1
-rw-r--r--contrib/epee/src/file_io_utils.cpp43
-rw-r--r--contrib/epee/src/network_throttle-detail.cpp1
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp1
-rw-r--r--src/p2p/net_node.inl1
9 files changed, 0 insertions, 151 deletions
diff --git a/contrib/epee/include/file_io_utils.h b/contrib/epee/include/file_io_utils.h
index 84dc79266..da05520c1 100644
--- a/contrib/epee/include/file_io_utils.h
+++ b/contrib/epee/include/file_io_utils.h
@@ -36,10 +36,7 @@ namespace file_io_utils
{
bool is_file_exist(const std::string& path);
bool save_string_to_file(const std::string& path_to_file, const std::string& str);
- bool get_file_time(const std::string& path_to_file, time_t& ft);
- bool set_file_time(const std::string& path_to_file, const time_t& ft);
bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size = 1000000000);
- bool append_string_to_file(const std::string& path_to_file, const std::string& str);
bool get_file_size(const std::string& path_to_file, uint64_t &size);
}
}
diff --git a/contrib/epee/include/misc_language.h b/contrib/epee/include/misc_language.h
index 5ccfe6fcc..bf75da23f 100644
--- a/contrib/epee/include/misc_language.h
+++ b/contrib/epee/include/misc_language.h
@@ -30,47 +30,13 @@
#include <boost/utility/value_init.hpp>
#include <boost/shared_ptr.hpp>
-#include <limits>
-#include <functional>
#include <vector>
namespace epee
{
-#define STD_TRY_BEGIN() try {
-
-#define STD_TRY_CATCH(where_, ret_val) \
- } \
- catch (const std::exception &e) \
- { \
- LOG_ERROR("EXCEPTION: " << where_ << ", mes: "<< e.what()); \
- return ret_val; \
- } \
- catch (...) \
- { \
- LOG_ERROR("EXCEPTION: " << where_ ); \
- return ret_val; \
- }
-
-
-
#define AUTO_VAL_INIT(v) boost::value_initialized<decltype(v)>()
namespace misc_utils
{
- template<typename t_type>
- t_type get_max_t_val(t_type t)
- {
- return (std::numeric_limits<t_type>::max)();
- }
-
-
- template<typename t_iterator>
- t_iterator move_it_forward(t_iterator it, size_t count)
- {
- while(count--)
- it++;
- return it;
- }
-
template<typename t_iterator>
t_iterator move_it_backward(t_iterator it, size_t count)
{
@@ -79,24 +45,6 @@ namespace misc_utils
return it;
}
-
- // TEMPLATE STRUCT less
- template<class _Ty>
- struct less_as_pod
- : public std::binary_function<_Ty, _Ty, bool>
- { // functor for operator<
- bool operator()(const _Ty& _Left, const _Ty& _Right) const
- { // apply operator< to operands
- return memcmp(&_Left, &_Right, sizeof(_Left)) < 0;
- }
- };
-
- template<class _Ty>
- bool is_less_as_pod(const _Ty& _Left, const _Ty& _Right)
- { // apply operator< to operands
- return memcmp(&_Left, &_Right, sizeof(_Left)) < 0;
- }
-
bool sleep_no_w(long ms );
template <typename T>
diff --git a/contrib/epee/include/net/local_ip.h b/contrib/epee/include/net/local_ip.h
index 1eeab2dc5..1c501d24b 100644
--- a/contrib/epee/include/net/local_ip.h
+++ b/contrib/epee/include/net/local_ip.h
@@ -27,7 +27,6 @@
#pragma once
-#include <string>
#include "int-util.h"
// IP addresses are kept in network byte order
diff --git a/contrib/epee/include/storages/levin_abstract_invoke2.h b/contrib/epee/include/storages/levin_abstract_invoke2.h
index 383d67cc2..7fd786a53 100644
--- a/contrib/epee/include/storages/levin_abstract_invoke2.h
+++ b/contrib/epee/include/storages/levin_abstract_invoke2.h
@@ -56,54 +56,6 @@ namespace epee
{
namespace net_utils
{
-#if 0
- template<class t_arg, class t_result, class t_transport>
- bool invoke_remote_command2(int command, const t_arg& out_struct, t_result& result_struct, t_transport& transport)
- {
- if(!transport.is_connected())
- return false;
-
- serialization::portable_storage stg;
- out_struct.store(stg);
- std::string buff_to_send, buff_to_recv;
- stg.store_to_binary(buff_to_send);
-
- int res = transport.invoke(command, buff_to_send, buff_to_recv);
- if( res <=0 )
- {
- MERROR("Failed to invoke command " << command << " return code " << res);
- return false;
- }
- serialization::portable_storage stg_ret;
- if(!stg_ret.load_from_binary(buff_to_recv, &default_levin_limits))
- {
- LOG_ERROR("Failed to load_from_binary on command " << command);
- return false;
- }
- return result_struct.load(stg_ret);
- }
-
- template<class t_arg, class t_transport>
- bool notify_remote_command2(int command, const t_arg& out_struct, t_transport& transport)
- {
- if(!transport.is_connected())
- return false;
-
- serialization::portable_storage stg;
- out_struct.store(&stg);
- std::string buff_to_send;
- stg.store_to_binary(buff_to_send);
-
- int res = transport.notify(command, buff_to_send);
- if(res <=0 )
- {
- LOG_ERROR("Failed to notify command " << command << " return code " << res);
- return false;
- }
- return true;
- }
-#endif
-
template<class t_arg, class t_result, class t_transport>
bool invoke_remote_command2(const epee::net_utils::connection_context_base context, int command, const t_arg& out_struct, t_result& result_struct, t_transport& transport)
{
diff --git a/contrib/epee/src/connection_basic.cpp b/contrib/epee/src/connection_basic.cpp
index 85ff55587..b0a30f47f 100644
--- a/contrib/epee/src/connection_basic.cpp
+++ b/contrib/epee/src/connection_basic.cpp
@@ -39,7 +39,6 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread/thread.hpp>
#include "misc_language.h"
-#include "pragma_comp_defs.h"
#include <iomanip>
#include <boost/asio/basic_socket.hpp>
diff --git a/contrib/epee/src/file_io_utils.cpp b/contrib/epee/src/file_io_utils.cpp
index 5072adcbc..a8348431c 100644
--- a/contrib/epee/src/file_io_utils.cpp
+++ b/contrib/epee/src/file_io_utils.cpp
@@ -102,29 +102,6 @@ namespace file_io_utils
}
- bool get_file_time(const std::string& path_to_file, time_t& ft)
- {
- boost::system::error_code ec;
- ft = boost::filesystem::last_write_time(boost::filesystem::path(path_to_file), ec);
- if(!ec)
- return true;
- else
- return false;
- }
-
-
- bool set_file_time(const std::string& path_to_file, const time_t& ft)
- {
- boost::system::error_code ec;
- boost::filesystem::last_write_time(boost::filesystem::path(path_to_file), ft, ec);
- if(!ec)
- return true;
- else
- return false;
- }
-
-
-
bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size)
{
#ifdef WIN32
@@ -174,26 +151,6 @@ namespace file_io_utils
}
- bool append_string_to_file(const std::string& path_to_file, const std::string& str)
- {
- // No special Windows implementation because so far not used in Monero code
- try
- {
- std::ofstream fstream;
- fstream.exceptions(std::ifstream::failbit | std::ifstream::badbit);
- fstream.open(path_to_file.c_str(), std::ios_base::binary | std::ios_base::out | std::ios_base::app);
- fstream << str;
- fstream.close();
- return true;
- }
-
- catch(...)
- {
- return false;
- }
- }
-
-
bool get_file_size(const std::string& path_to_file, uint64_t &size)
{
#ifdef WIN32
diff --git a/contrib/epee/src/network_throttle-detail.cpp b/contrib/epee/src/network_throttle-detail.cpp
index 0374a449c..978572120 100644
--- a/contrib/epee/src/network_throttle-detail.cpp
+++ b/contrib/epee/src/network_throttle-detail.cpp
@@ -46,7 +46,6 @@
#include "misc_log_ex.h"
#include <boost/chrono.hpp>
#include "misc_language.h"
-#include "pragma_comp_defs.h"
#include <sstream>
#include <iomanip>
#include <algorithm>
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
index 4c21de7a5..92ee08054 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp
@@ -43,7 +43,6 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread/thread.hpp>
#include "misc_language.h"
-#include "pragma_comp_defs.h"
#include <algorithm>
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 5c61ede3f..a3bc3bf24 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -55,7 +55,6 @@
#include "math_helper.h"
#include "misc_log_ex.h"
#include "p2p_protocol_defs.h"
-#include "net/local_ip.h"
#include "crypto/crypto.h"
#include "storages/levin_abstract_invoke2.h"
#include "cryptonote_core/cryptonote_core.h"