From a61ea1fb0cd6a14abe7f631f8f862111b6209033 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 22 Jul 2020 09:02:30 +0200 Subject: [PATCH] Fix a compil warning --- pcbnew/pcb_expr_evaluator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index af98297104..f70f066945 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -101,14 +101,14 @@ PCB_EXPR_BUILTIN_FUNCTIONS::PCB_EXPR_BUILTIN_FUNCTIONS() BOARD_ITEM* PCB_EXPR_VAR_REF::GetObject( LIBEVAL::UCODE* aUcode ) const -{ +{ const PCB_EXPR_UCODE* ucode = static_cast( aUcode ); BOARD_ITEM* item = ucode->GetItem( m_itemIndex ); return item; } -LIBEVAL::VALUE PCB_EXPR_VAR_REF::GetValue( LIBEVAL::UCODE* aUcode ) +LIBEVAL::VALUE PCB_EXPR_VAR_REF::GetValue( LIBEVAL::UCODE* aUcode ) { BOARD_ITEM* item = const_cast( GetObject( aUcode ) ); auto it = m_matchingTypes.find( TYPE_HASH( *item ) ); @@ -187,7 +187,7 @@ LIBEVAL::VAR_REF* PCB_EXPR_UCODE::createVarRef( LIBEVAL::COMPILER *aCompiler, if( propMgr.IsOfType( cls.type, TYPE_HASH( BOARD_ITEM ) ) ) { PROPERTY_BASE* prop = propMgr.GetProperty( cls.type, field ); - + if( prop ) { //printf("Field '%s' class %s ptr %p haschoices %d typeid %s\n", field.c_str(), (const char *) cls.name.c_str(), prop, !!prop->HasChoices(), typeid(*prop).name() ); @@ -260,7 +260,7 @@ PCB_EXPR_COMPILER::PCB_EXPR_COMPILER() PCB_EXPR_EVALUATOR::PCB_EXPR_EVALUATOR() { - m_result = NAN; + m_result = 0; m_errorStatus.pendingError = false; }