Merge pull request #8955

192d87c remove more 'using namespace' statements from headers (jeffro256)
This commit is contained in:
luigi1111 2023-08-17 10:25:51 -05:00
commit e3c990f03a
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
5 changed files with 15 additions and 30 deletions

View file

@ -35,7 +35,6 @@
namespace epee namespace epee
{ {
using namespace misc_utils::parse;
namespace serialization namespace serialization
{ {
namespace json namespace json
@ -91,7 +90,7 @@ namespace epee
switch(*it) switch(*it)
{ {
case '"': case '"':
match_string2(it, buf_end, name); misc_utils::parse::match_string2(it, buf_end, name);
state = match_state_waiting_separator; state = match_state_waiting_separator;
break; break;
case '}': case '}':
@ -112,7 +111,7 @@ namespace epee
if(*it == '"') if(*it == '"')
{//just a named string value started {//just a named string value started
std::string val; std::string val;
match_string2(it, buf_end, val); misc_utils::parse::match_string2(it, buf_end, val);
//insert text value //insert text value
stg.set_value(name, std::move(val), current_section); stg.set_value(name, std::move(val), current_section);
state = match_state_wonder_after_value; state = match_state_wonder_after_value;
@ -120,7 +119,7 @@ namespace epee
{//just a named number value started {//just a named number value started
boost::string_ref val; boost::string_ref val;
bool is_v_float = false;bool is_signed = false; bool is_v_float = false;bool is_signed = false;
match_number2(it, buf_end, val, is_v_float, is_signed); misc_utils::parse::match_number2(it, buf_end, val, is_v_float, is_signed);
if(!is_v_float) if(!is_v_float)
{ {
if(is_signed) if(is_signed)
@ -147,7 +146,7 @@ namespace epee
}else if(isalpha(*it) ) }else if(isalpha(*it) )
{// could be null, true or false {// could be null, true or false
boost::string_ref word; boost::string_ref word;
match_word2(it, buf_end, word); misc_utils::parse::match_word2(it, buf_end, word);
if(boost::iequals(word, "null")) if(boost::iequals(word, "null"))
{ {
state = match_state_wonder_after_value; state = match_state_wonder_after_value;
@ -202,7 +201,7 @@ namespace epee
{ {
//mean array of strings //mean array of strings
std::string val; std::string val;
match_string2(it, buf_end, val); misc_utils::parse::match_string2(it, buf_end, val);
h_array = stg.insert_first_value(name, std::move(val), current_section); h_array = stg.insert_first_value(name, std::move(val), current_section);
CHECK_AND_ASSERT_THROW_MES(h_array, " failed to insert values entry"); CHECK_AND_ASSERT_THROW_MES(h_array, " failed to insert values entry");
state = match_state_array_after_value; state = match_state_array_after_value;
@ -211,7 +210,7 @@ namespace epee
{//array of numbers value started {//array of numbers value started
boost::string_ref val; boost::string_ref val;
bool is_v_float = false;bool is_signed_val = false; bool is_v_float = false;bool is_signed_val = false;
match_number2(it, buf_end, val, is_v_float, is_signed_val); misc_utils::parse::match_number2(it, buf_end, val, is_v_float, is_signed_val);
if(!is_v_float) if(!is_v_float)
{ {
if (is_signed_val) if (is_signed_val)
@ -246,7 +245,7 @@ namespace epee
}else if(isalpha(*it) ) }else if(isalpha(*it) )
{// array of booleans {// array of booleans
boost::string_ref word; boost::string_ref word;
match_word2(it, buf_end, word); misc_utils::parse::match_word2(it, buf_end, word);
if(boost::iequals(word, "true")) if(boost::iequals(word, "true"))
{ {
h_array = stg.insert_first_value(name, true, current_section); h_array = stg.insert_first_value(name, true, current_section);
@ -290,7 +289,7 @@ namespace epee
if(*it == '"') if(*it == '"')
{ {
std::string val; std::string val;
match_string2(it, buf_end, val); misc_utils::parse::match_string2(it, buf_end, val);
bool res = stg.insert_next_value(h_array, std::move(val)); bool res = stg.insert_next_value(h_array, std::move(val));
CHECK_AND_ASSERT_THROW_MES(res, "failed to insert values"); CHECK_AND_ASSERT_THROW_MES(res, "failed to insert values");
state = match_state_array_after_value; state = match_state_array_after_value;
@ -301,7 +300,7 @@ namespace epee
{//array of numbers value started {//array of numbers value started
boost::string_ref val; boost::string_ref val;
bool is_v_float = false;bool is_signed_val = false; bool is_v_float = false;bool is_signed_val = false;
match_number2(it, buf_end, val, is_v_float, is_signed_val); misc_utils::parse::match_number2(it, buf_end, val, is_v_float, is_signed_val);
bool insert_res = false; bool insert_res = false;
if(!is_v_float) if(!is_v_float)
{ {
@ -334,7 +333,7 @@ namespace epee
if(isalpha(*it) ) if(isalpha(*it) )
{// array of booleans {// array of booleans
boost::string_ref word; boost::string_ref word;
match_word2(it, buf_end, word); misc_utils::parse::match_word2(it, buf_end, word);
if(boost::iequals(word, "true")) if(boost::iequals(word, "true"))
{ {
bool r = stg.insert_next_value(h_array, true); bool r = stg.insert_next_value(h_array, true);

View file

@ -37,6 +37,7 @@
#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" #define MONERO_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options; namespace po = boost::program_options;
using namespace cryptonote;
using namespace epee; using namespace epee;
int main(int argc, char* argv[]) int main(int argc, char* argv[])

View file

@ -50,10 +50,6 @@
#include "blockchain_utilities.h" #include "blockchain_utilities.h"
using namespace cryptonote;
class BlocksdatFile class BlocksdatFile
{ {
public: public:
@ -63,7 +59,7 @@ public:
protected: protected:
Blockchain* m_blockchain_storage; cryptonote::Blockchain* m_blockchain_storage;
std::ofstream * m_raw_data_file; std::ofstream * m_raw_data_file;

View file

@ -48,10 +48,6 @@
#include "blockchain_utilities.h" #include "blockchain_utilities.h"
using namespace cryptonote;
class BootstrapFile class BootstrapFile
{ {
public: public:
@ -66,9 +62,9 @@ public:
protected: protected:
Blockchain* m_blockchain_storage; cryptonote::Blockchain* m_blockchain_storage;
tx_memory_pool* m_tx_pool; cryptonote::tx_memory_pool* m_tx_pool;
typedef std::vector<char> buffer_type; typedef std::vector<char> buffer_type;
std::ofstream * m_raw_data_file; std::ofstream * m_raw_data_file;
buffer_type m_buffer; buffer_type m_buffer;
@ -78,7 +74,7 @@ protected:
bool open_writer(const boost::filesystem::path& file_path, uint64_t start_block, uint64_t stop_block); bool open_writer(const boost::filesystem::path& file_path, uint64_t start_block, uint64_t stop_block);
bool initialize_file(uint64_t start_block, uint64_t stop_block); bool initialize_file(uint64_t start_block, uint64_t stop_block);
bool close(); bool close();
void write_block(block& block); void write_block(cryptonote::block& block);
void flush_chunk(); void flush_chunk();
private: private:

View file

@ -1167,13 +1167,6 @@ namespace cryptonote
m_sync_download_objects_size += size; m_sync_download_objects_size += size;
MDEBUG(context << " downloaded " << size << " bytes worth of blocks"); MDEBUG(context << " downloaded " << size << " bytes worth of blocks");
/*using namespace boost::chrono;
auto point = steady_clock::now();
auto time_from_epoh = point.time_since_epoch();
auto sec = duration_cast< seconds >( time_from_epoh ).count();*/
//epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size());
if(arg.blocks.empty()) if(arg.blocks.empty())
{ {
LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: no blocks"); LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: no blocks");