From 9e1330184cf19f0e53fd1f5000ae2bd6b771bccc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 15 May 2024 10:54:26 +0100 Subject: [PATCH] Patch another dynamic_cast-across-compile-unit-boundaries issue. --- common/fp_lib_table.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/fp_lib_table.cpp b/common/fp_lib_table.cpp index 85be988ec9..1c63bead2c 100644 --- a/common/fp_lib_table.cpp +++ b/common/fp_lib_table.cpp @@ -320,10 +320,7 @@ void FP_LIB_TABLE::PrefetchLib( const wxString& aNickname ) const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname, bool aCheckIfEnabled ) { - // Do not optimize this code. Is done this way specifically to fix a runtime - // error with clang 4.0.1. - LIB_TABLE_ROW* ltrow = findRow( aNickname, aCheckIfEnabled ); - FP_LIB_TABLE_ROW* row = dynamic_cast< FP_LIB_TABLE_ROW* >( ltrow ); + FP_LIB_TABLE_ROW* row = static_cast( findRow( aNickname, aCheckIfEnabled ) ); if( !row ) { @@ -333,9 +330,8 @@ const FP_LIB_TABLE_ROW* FP_LIB_TABLE::FindRow( const wxString& aNickname, bool a THROW_IO_ERROR( msg ); } - // We've been 'lazy' up until now, but it cannot be deferred any longer, - // instantiate a PCB_IO of the proper kind if it is not already in this - // FP_LIB_TABLE_ROW. + // We've been 'lazy' up until now, but it cannot be deferred any longer; instantiate a + // PCB_IO of the proper kind if it is not already in this FP_LIB_TABLE_ROW. if( !row->plugin ) row->setPlugin( PCB_IO_MGR::PluginFind( row->type ) );