From 3e11506fa2ee87b4bd292ae46841404c5d5c372c Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Mon, 15 Aug 2022 20:45:54 +0100 Subject: [PATCH] Fix a few unused variable warnings on msvc --- eeschema/sim/sim_model.cpp | 20 ++++++++++---------- eeschema/sim/sim_model_ideal.cpp | 2 +- eeschema/sim/sim_model_source.cpp | 2 +- eeschema/sim/sim_value.cpp | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/eeschema/sim/sim_model.cpp b/eeschema/sim/sim_model.cpp index 452bed0207..3ae97965e3 100644 --- a/eeschema/sim/sim_model.cpp +++ b/eeschema/sim/sim_model.cpp @@ -117,7 +117,7 @@ SIM_MODEL::DEVICE_INFO SIM_MODEL::DeviceTypeInfo( DEVICE_TYPE_ aDeviceType ) SIM_MODEL::INFO SIM_MODEL::TypeInfo( TYPE aType ) { switch( aType ) - { + { case TYPE::NONE: return { DEVICE_TYPE_::NONE, "", "" }; case TYPE::R: return { DEVICE_TYPE_::R, "", "Ideal" }; @@ -139,7 +139,7 @@ SIM_MODEL::INFO SIM_MODEL::TypeInfo( TYPE aType ) case TYPE::SW_I: return { DEVICE_TYPE_::SW, "I", "Current-controlled" }; case TYPE::D: return { DEVICE_TYPE_::D, "", "" }; - + case TYPE::NPN_GUMMELPOON: return { DEVICE_TYPE_::NPN, "GUMMELPOON", "Gummel-Poon" }; case TYPE::PNP_GUMMELPOON: return { DEVICE_TYPE_::PNP, "GUMMELPOON", "Gummel-Poon" }; case TYPE::NPN_VBIC: return { DEVICE_TYPE_::NPN, "VBIC", "VBIC" }; @@ -261,7 +261,7 @@ SIM_MODEL::SPICE_INFO SIM_MODEL::SpiceInfo( TYPE aType ) case TYPE::L: return { "L", "" }; //case TYPE::L_ADV: return { "L", "l" }; case TYPE::L_BEHAVIORAL: return { "L", "", "", "0", false, true }; - + case TYPE::TLINE_Z0: return { "T" }; case TYPE::TLINE_RLGC: return { "O", "ltra" }; @@ -602,7 +602,7 @@ TYPE SIM_MODEL::InferTypeFromRefAndValue( const wxString& aRef, const wxString& } } } - catch( const tao::pegtl::parse_error& e ) + catch( const tao::pegtl::parse_error& ) { } @@ -925,7 +925,7 @@ wxString SIM_MODEL::GenerateSpiceModelLine( const wxString& aModelName ) const if( valueStr.IsEmpty() ) continue; - + wxString append = " " + param.info.name + "=" + valueStr; if( line.Length() + append.Length() > 60 ) @@ -974,7 +974,7 @@ wxString SIM_MODEL::GenerateSpiceItemLine( const wxString& aRefName, for( unsigned i = 0; i < aPinNetNames.size(); ++i ) { unsigned symbolPinNumber = i + 1; - + if( symbolPinNumber == pin.symbolPinNumber ) result << aPinNetNames[i] << " "; } @@ -1142,7 +1142,7 @@ bool SIM_MODEL::SetParamValue( const wxString& aParamName, const wxString& aValu { return param.info.name == aParamName.Lower(); } ); - + if( it == params.end() ) return false; @@ -1281,7 +1281,7 @@ void SIM_MODEL::ParseParamsField( const wxString& aParamsField ) try { // Using parse tree instead of actions because we don't care about performance that much, - // and having a tree greatly simplifies some things. + // and having a tree greatly simplifies some things. root = tao::pegtl::parse_tree::parse< SIM_MODEL_PARSER::fieldParamValuePairsGrammar, SIM_MODEL_PARSER::fieldParamValuePairsSelector> @@ -1300,7 +1300,7 @@ void SIM_MODEL::ParseParamsField( const wxString& aParamsField ) paramName = node->string(); // TODO: Do something with number. // It doesn't seem too useful? - else if( node->is_type() + else if( node->is_type() || node->is_type() ) { wxASSERT( paramName != "" ); @@ -1400,7 +1400,7 @@ std::unique_ptr SIM_MODEL::create( TYPE aType ) case TYPE::V_BEHAVIORAL: case TYPE::I_BEHAVIORAL: return std::make_unique( aType ); - + case TYPE::TLINE_Z0: case TYPE::TLINE_RLGC: return std::make_unique( aType ); diff --git a/eeschema/sim/sim_model_ideal.cpp b/eeschema/sim/sim_model_ideal.cpp index 783f2444b0..25ab843359 100644 --- a/eeschema/sim/sim_model_ideal.cpp +++ b/eeschema/sim/sim_model_ideal.cpp @@ -136,7 +136,7 @@ void SIM_MODEL_IDEAL::inferredReadDataFields( unsigned aSymbolPinCount, const st // The grammar and selector must guarantee having at least one child. SetParamValue( 0, root->children[0]->string() ); } - catch( const tao::pegtl::parse_error& e ) + catch( const tao::pegtl::parse_error& ) { THROW_IO_ERROR( wxString::Format( _( "Failed to infer model from Value '%s'" ), GetFieldValue( aFields, VALUE_FIELD ) ) ); diff --git a/eeschema/sim/sim_model_source.cpp b/eeschema/sim/sim_model_source.cpp index 69423f8244..44bef5823d 100644 --- a/eeschema/sim/sim_model_source.cpp +++ b/eeschema/sim/sim_model_source.cpp @@ -123,7 +123,7 @@ wxString SIM_MODEL_SOURCE::GenerateSpiceItemLine( const wxString& aRefName, SIM_MODEL_SOURCE_PARSER::pwlValuesSelector> ( in ); } - catch( const tao::pegtl::parse_error& e ) + catch( const tao::pegtl::parse_error& ) { break; } diff --git a/eeschema/sim/sim_value.cpp b/eeschema/sim/sim_value.cpp index e9e6d36fd2..222a4a5cbd 100644 --- a/eeschema/sim/sim_value.cpp +++ b/eeschema/sim/sim_value.cpp @@ -134,7 +134,7 @@ bool SIM_VALUE_GRAMMAR::IsValid( const wxString& aString, { CALL_INSTANCE( aValueType, aNotation, doIsValid, in ); } - catch( const tao::pegtl::parse_error& e ) + catch( const tao::pegtl::parse_error& ) { return false; } @@ -200,7 +200,7 @@ SIM_VALUE_PARSER::PARSE_RESULT SIM_VALUE_PARSER::Parse( const wxString& aString, { CALL_INSTANCE( aValueType, aNotation, root = doParse, in ); } - catch( tao::pegtl::parse_error& e ) + catch( tao::pegtl::parse_error& ) { result.isOk = false; return result; @@ -353,7 +353,7 @@ wxString SIM_VALUE_PARSER::ExponentToMetricSuffix( double aExponent, long& aRedu aReductionExponent = 18; return "E"; } - + aReductionExponent = 0; return ""; } @@ -381,7 +381,7 @@ std::unique_ptr SIM_VALUE::Create( TYPE aType ) case TYPE_FLOAT_VECTOR: return std::make_unique>(); case TYPE_COMPLEX_VECTOR: return std::make_unique>>(); } - + wxFAIL_MSG( _( "Unknown SIM_VALUE type" ) ); return nullptr; } @@ -484,7 +484,7 @@ bool SIM_VALUE_INST::FromString( const wxString& aString, NOTATION aNota { m_value = std::stod( parseResult.significand ) * std::pow( 10, exponent ); } - catch( const std::invalid_argument& e ) + catch( const std::invalid_argument& ) { return false; }