diff --git a/CMakeLists.txt b/CMakeLists.txt index 04b92c815..042b896b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -614,7 +614,6 @@ find_package(HIDAPI) add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S) add_definition_if_library_exists(c explicit_bzero "strings.h" HAVE_EXPLICIT_BZERO) -add_definition_if_function_found(strptime HAVE_STRPTIME) add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP) diff --git a/contrib/epee/include/serialization/keyvalue_serialization_overloads.h b/contrib/epee/include/serialization/keyvalue_serialization_overloads.h index a120c1d8f..abbd9b5a1 100644 --- a/contrib/epee/include/serialization/keyvalue_serialization_overloads.h +++ b/contrib/epee/include/serialization/keyvalue_serialization_overloads.h @@ -103,7 +103,7 @@ namespace epee static bool unserialize_stl_container_t_val(stl_container& container, t_storage& stg, typename t_storage::hsection hparent_section, const char* pname) { container.clear(); - typename stl_container::value_type exchange_val; + typename stl_container::value_type exchange_val{}; typename t_storage::harray hval_array = stg.get_first_value(pname, exchange_val, hparent_section); if(!hval_array) return false; container.insert(container.end(), std::move(exchange_val)); diff --git a/contrib/epee/include/storages/portable_storage_val_converters.h b/contrib/epee/include/storages/portable_storage_val_converters.h index 5eb9acffd..bd3707385 100644 --- a/contrib/epee/include/storages/portable_storage_val_converters.h +++ b/contrib/epee/include/storages/portable_storage_val_converters.h @@ -28,18 +28,15 @@ #pragma once -#include - #include "misc_language.h" #include "portable_storage_base.h" -#include "parserse_base_utils.h" #include "warnings.h" #include "misc_log_ex.h" -#include #include +#include +#include #include -#include namespace epee { @@ -140,36 +137,6 @@ POP_WARNINGS } }; - // For MyMonero/OpenMonero backend compatibility - // MyMonero backend sends amount, fees and timestamp values as strings. - // Until MM backend is updated, this is needed for compatibility between OpenMonero and MyMonero. - template<> - struct convert_to_integral - { - static void convert(const std::string& from, uint64_t& to) - { - MTRACE("Converting std::string to uint64_t. Source: " << from); - // String only contains digits - if(std::all_of(from.begin(), from.end(), epee::misc_utils::parse::isdigit)) - to = boost::lexical_cast(from); - // MyMonero ISO 8061 timestamp (2017-05-06T16:27:06Z) - else if (boost::regex_match (from, boost::regex("\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\dZ"))) - { - // Convert to unix timestamp -#ifdef HAVE_STRPTIME - struct tm tm; - if (strptime(from.c_str(), "%Y-%m-%dT%H:%M:%S", &tm)) -#else - std::tm tm = {}; - std::istringstream ss(from); - if (ss >> std::get_time(&tm, "%Y-%m-%dT%H:%M:%S")) -#endif - to = std::mktime(&tm); - } else - ASSERT_AND_THROW_WRONG_CONVERSION(); - } - }; - template struct is_convertable: std::integral_constant::value &&