Clean up unused variable usage

Unused variables in function calls can be commented out.  Unused
return variables get a new routine `ignore_unused()` that silences the
warnings with zero overhead.
This commit is contained in:
Seth Hillbrand 2021-10-05 09:57:25 -07:00
parent 043c326278
commit 548e5f49bd
29 changed files with 97 additions and 96 deletions

View File

@ -837,10 +837,8 @@ void EDA_3D_CANVAS::OnMiddleUp( wxMouseEvent& event )
} }
void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& event ) void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& /* event */ )
{ {
(void)event;
m_mouse_is_moving = false; m_mouse_is_moving = false;
m_mouse_was_moved = false; m_mouse_was_moved = false;

View File

@ -131,11 +131,9 @@ public:
void SetDirection( const SFVEC3F& aDir ) { m_inv_direction = -aDir; } void SetDirection( const SFVEC3F& aDir ) { m_inv_direction = -aDir; }
// Imported functions from LIGHT // Imported functions from LIGHT
void GetLightParameters( const SFVEC3F& aHitPoint, SFVEC3F& aOutVectorToLight, void GetLightParameters( const SFVEC3F& /* aHitPoint */, SFVEC3F& aOutVectorToLight,
SFVEC3F& aOutLightColor, float& aOutDistance ) const override SFVEC3F& aOutLightColor, float& aOutDistance ) const override
{ {
(void)aHitPoint; // unused
aOutVectorToLight = m_inv_direction; aOutVectorToLight = m_inv_direction;
aOutDistance = std::numeric_limits<float>::infinity(); aOutDistance = std::numeric_limits<float>::infinity();
aOutLightColor = m_color; aOutLightColor = m_color;

View File

@ -839,10 +839,8 @@ void RENDER_3D_RAYTRACE::renderBlockTracing( GLubyte* ptrPBO, signed int iBlock
} }
void RENDER_3D_RAYTRACE::postProcessShading( GLubyte* ptrPBO, REPORTER* aStatusReporter ) void RENDER_3D_RAYTRACE::postProcessShading( GLubyte* /* ptrPBO */, REPORTER* aStatusReporter )
{ {
(void)ptrPBO; // unused
if( m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) ) if( m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) )
{ {
if( aStatusReporter ) if( aStatusReporter )
@ -894,10 +892,8 @@ void RENDER_3D_RAYTRACE::postProcessShading( GLubyte* ptrPBO, REPORTER* aStatusR
} }
void RENDER_3D_RAYTRACE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* aStatusReporter ) void RENDER_3D_RAYTRACE::postProcessBlurFinish( GLubyte* ptrPBO, REPORTER* /* aStatusReporter */ )
{ {
(void) aStatusReporter; //unused
if( m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) ) if( m_boardAdapter.GetFlag( FL_RENDER_RAYTRACING_POST_PROCESSING ) )
{ {
// Now blurs the shader result and compute the final color // Now blurs the shader result and compute the final color

View File

@ -167,9 +167,7 @@ bool CYLINDER::Intersects( const BBOX_3D& aBBox ) const
} }
SFVEC3F CYLINDER::GetDiffuseColor( const HITINFO& aHitInfo ) const SFVEC3F CYLINDER::GetDiffuseColor( const HITINFO& /* aHitInfo */ ) const
{ {
(void)aHitInfo; // unused
return m_diffusecolor; return m_diffusecolor;
} }

View File

@ -86,9 +86,7 @@ bool DUMMY_BLOCK::Intersects( const BBOX_3D& aBBox ) const
} }
SFVEC3F DUMMY_BLOCK::GetDiffuseColor( const HITINFO& aHitInfo ) const SFVEC3F DUMMY_BLOCK::GetDiffuseColor( const HITINFO& /* aHitInfo */ ) const
{ {
(void)aHitInfo; // unused
return m_diffusecolor; return m_diffusecolor;
} }

View File

@ -475,9 +475,7 @@ bool LAYER_ITEM::Intersects( const BBOX_3D& aBBox ) const
} }
SFVEC3F LAYER_ITEM::GetDiffuseColor( const HITINFO& aHitInfo ) const SFVEC3F LAYER_ITEM::GetDiffuseColor( const HITINFO& /* aHitInfo */ ) const
{ {
(void)aHitInfo; // unused
return m_diffusecolor; return m_diffusecolor;
} }

View File

@ -118,9 +118,7 @@ bool XY_PLANE::Intersects( const BBOX_3D& aBBox ) const
} }
SFVEC3F XY_PLANE::GetDiffuseColor( const HITINFO& aHitInfo ) const SFVEC3F XY_PLANE::GetDiffuseColor( const HITINFO& /* aHitInfo */ ) const
{ {
(void)aHitInfo; // unused
return m_diffusecolor; return m_diffusecolor;
} }

View File

@ -415,9 +415,7 @@ bool ROUND_SEGMENT::Intersects( const BBOX_3D& aBBox ) const
} }
SFVEC3F ROUND_SEGMENT::GetDiffuseColor( const HITINFO& aHitInfo ) const SFVEC3F ROUND_SEGMENT::GetDiffuseColor( const HITINFO& /* aHitInfo */ ) const
{ {
(void)aHitInfo; // unused
return m_diffusecolor; return m_diffusecolor;
} }

View File

@ -23,6 +23,7 @@
*/ */
#include <dialog_shim.h> #include <dialog_shim.h>
#include <ignore.h>
#include <kiway_player.h> #include <kiway_player.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <tool/tool_manager.h> #include <tool/tool_manager.h>
@ -336,6 +337,8 @@ static void selectAllInTextCtrls( wxWindowList& children )
{ {
childTextCtrl->SelectAll(); childTextCtrl->SelectAll();
} }
#else
ignore_unused( childTextCtrl );
#endif #endif
} }
else if( wxStyledTextCtrl* scintilla = dynamic_cast<wxStyledTextCtrl*>( child ) ) else if( wxStyledTextCtrl* scintilla = dynamic_cast<wxStyledTextCtrl*>( child ) )
@ -536,8 +539,7 @@ void DIALOG_SHIM::OnButton( wxCommandEvent& aEvent )
// isn't closing anyway) // isn't closing anyway)
if( Validate() ) if( Validate() )
{ {
bool success = TransferDataFromWindow(); ignore_unused( TransferDataFromWindow() );
(void) success;
} }
} }
else if( id == GetEscapeId() || else if( id == GetEscapeId() ||

View File

@ -24,6 +24,7 @@
#include <cstring> #include <cstring>
#include <ignore.h>
#include <macros.h> #include <macros.h>
#include <kiway.h> #include <kiway.h>
#include <kiway_player.h> #include <kiway_player.h>
@ -280,7 +281,7 @@ KIFACE* KIWAY::KiFACE( FACE_T aFaceId, bool doLoad )
if( kiface->OnKifaceStart( m_program, m_ctl ) ) if( kiface->OnKifaceStart( m_program, m_ctl ) )
{ {
// Tell dso's wxDynamicLibrary destructor not to Unload() the program image. // Tell dso's wxDynamicLibrary destructor not to Unload() the program image.
(void) dso.Detach(); ignore_unused( dso.Detach() );
return m_kiface[aFaceId] = kiface; return m_kiface[aFaceId] = kiface;
} }

View File

@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <ignore.h>
#include <kiway.h> #include <kiway.h>
#include <kiway_holder.h> #include <kiway_holder.h>
#include <project.h> #include <project.h>
@ -47,11 +48,11 @@ void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway )
if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) ) if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
{ {
int breakhere=1; int breakhere=1;
(void) breakhere; ignore_unused( breakhere );
} }
#endif #endif
(void) aDest; ignore_unused( aDest );
m_kiway = aKiway; m_kiway = aKiway;
} }

View File

@ -34,6 +34,7 @@
#include <wx/zstream.h> #include <wx/zstream.h>
#include <advanced_config.h> #include <advanced_config.h>
#include <ignore.h>
#include <macros.h> #include <macros.h>
#include <trigo.h> #include <trigo.h>
@ -535,7 +536,7 @@ void PDF_PLOTTER::closePdfStream()
int rc = fread( inbuf, 1, stream_len, workFile ); int rc = fread( inbuf, 1, stream_len, workFile );
wxASSERT( rc == stream_len ); wxASSERT( rc == stream_len );
(void) rc; ignore_unused( rc );
// We are done with the temporary file, junk it // We are done with the temporary file, junk it
fclose( workFile ); fclose( workFile );

View File

@ -26,6 +26,7 @@
#include <cstdarg> #include <cstdarg>
#include <config.h> // HAVE_FGETC_NOLOCK #include <config.h> // HAVE_FGETC_NOLOCK
#include <ignore.h>
#include <richio.h> #include <richio.h>
#include <errno.h> #include <errno.h>
@ -93,8 +94,7 @@ std::string StrPrintf( const char* format, ... )
va_list args; va_list args;
va_start( args, format ); va_start( args, format );
int ignore = vprint( &ret, format, args ); ignore_unused( vprint( &ret, format, args ) );
(void) ignore;
va_end( args ); va_end( args );
return ret; return ret;

View File

@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <ignore.h>
#include <macros.h> #include <macros.h>
#include <trace_helpers.h> #include <trace_helpers.h>
@ -378,7 +379,7 @@ OPT<TOOL_EVENT> TOOL_DISPATCHER::GetToolEvent( wxKeyEvent* aKeyEvent, bool* keyI
#ifdef __APPLE__ #ifdef __APPLE__
if( unicode_key >= 'A' && unicode_key <= 'Z' && key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z ) if( unicode_key >= 'A' && unicode_key <= 'Z' && key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z )
#else #else
(void) unicode_key; //not used: avoid compil warning ignore_unused( unicode_key );
if( key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z ) if( key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z )
#endif #endif

View File

@ -219,7 +219,7 @@ bool GAL_OPTIONS_PANEL::TransferDataToWindow()
else else
m_renderingEngine->SetSelection( 1 ); m_renderingEngine->SetSelection( 1 );
#else #else
(void) m_drawFrame; // Quiet unused variable warning ignore_unused( m_drawFrame );
#endif #endif
m_gridSnapOptions->SetSelection( UTIL::GetConfigForVal( gridSnapConfigVals, m_gridSnapOptions->SetSelection( UTIL::GetConfigForVal( gridSnapConfigVals,

View File

@ -37,9 +37,8 @@
static wxString StartLine( wxT( "." ) ); static wxString StartLine( wxT( "." ) );
bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName, bool NETLIST_EXPORTER_CADSTAR::WriteNetlist( const wxString& aOutFileName,
unsigned aNetlistOptions ) unsigned /* aNetlistOptions */ )
{ {
(void)aNetlistOptions; //unused
int ret = 0; int ret = 0;
FILE* f = nullptr; FILE* f = nullptr;

View File

@ -37,9 +37,8 @@
bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName, bool NETLIST_EXPORTER_ORCADPCB2::WriteNetlist( const wxString& aOutFileName,
unsigned aNetlistOptions ) unsigned /* aNetlistOptions */ )
{ {
(void)aNetlistOptions; //unused
FILE* f = nullptr; FILE* f = nullptr;
wxString field; wxString field;
wxString footprint; wxString footprint;

View File

@ -33,6 +33,7 @@
#include <gestfich.h> #include <gestfich.h>
#include <hierarch.h> #include <hierarch.h>
#include <dialogs/html_message_box.h> #include <dialogs/html_message_box.h>
#include <ignore.h>
#include <invoke_sch_dialog.h> #include <invoke_sch_dialog.h>
#include <string_utils.h> #include <string_utils.h>
#include <kiface_base.h> #include <kiface_base.h>
@ -755,7 +756,7 @@ void SCH_EDIT_FRAME::ResolveERCExclusions()
for( SCH_MARKER* marker : Schematic().ResolveERCExclusions() ) for( SCH_MARKER* marker : Schematic().ResolveERCExclusions() )
{ {
SCH_SHEET_PATH errorPath; SCH_SHEET_PATH errorPath;
(void) sheetList.GetItem( marker->GetRCItem()->GetMainItemID(), &errorPath ); ignore_unused( sheetList.GetItem( marker->GetRCItem()->GetMainItemID(), &errorPath ) );
if( errorPath.LastScreen() ) if( errorPath.LastScreen() )
errorPath.LastScreen()->Append( marker ); errorPath.LastScreen()->Append( marker );

View File

@ -31,6 +31,7 @@
#include <gerbview.h> #include <gerbview.h>
#include <gerber_file_image.h> #include <gerber_file_image.h>
#include <ignore.h>
#include <macros.h> #include <macros.h>
#include <X2_gerber_attributes.h> #include <X2_gerber_attributes.h>
#include <gbr_metadata.h> #include <gbr_metadata.h>
@ -897,7 +898,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
break; break;
} }
(void) seq_len; // quiet g++, or delete the unused variable. ignore_unused( seq_len );
ok = GetEndOfBlock( aBuff, aBuffSize, aText, m_Current_File ); ok = GetEndOfBlock( aBuff, aBuffSize, aText, m_Current_File );

24
include/ignore.h Normal file
View File

@ -0,0 +1,24 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2021 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
* or you may search the http://www.gnu.org website for the version 3 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
template<class T> void ignore_unused( const T& ) { }

View File

@ -27,6 +27,7 @@
#include <build_version.h> #include <build_version.h>
#include <board.h> #include <board.h>
#include <ignore.h>
#include <pad.h> #include <pad.h>
#include <pcb_group.h> #include <pcb_group.h>
#include <pcb_shape.h> #include <pcb_shape.h>
@ -294,7 +295,7 @@ void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootpri
{ {
wxTextDataObject data; wxTextDataObject data;
clipboard->GetData( data ); clipboard->GetData( data );
( void )data.GetText(); // Keep unused variable ignore_unused( data.GetText() );
} }
#endif #endif
} }
@ -373,7 +374,7 @@ void CLIPBOARD_IO::Save( const wxString& aFileName, BOARD* aBoard,
{ {
wxTextDataObject data; wxTextDataObject data;
clipboard->GetData( data ); clipboard->GetData( data );
( void )data.GetText(); // Keep unused variable ignore_unused( data.GetText() );
} }
} }

View File

@ -38,6 +38,7 @@ using namespace std::placeholders;
#include <footprint_tree_pane.h> #include <footprint_tree_pane.h>
#include <footprint_viewer_frame.h> #include <footprint_viewer_frame.h>
#include <fp_lib_table.h> #include <fp_lib_table.h>
#include <ignore.h>
#include <io_mgr.h> #include <io_mgr.h>
#include <string_utils.h> #include <string_utils.h>
#include <kiway.h> #include <kiway.h>
@ -201,8 +202,7 @@ wxString PCB_BASE_FRAME::SelectFootprintFromLibBrowser()
viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, this ); viewer = (FOOTPRINT_VIEWER_FRAME*) Kiway().Player( FRAME_FOOTPRINT_VIEWER_MODAL, true, this );
wxString fpid; wxString fpid;
int ret = viewer->ShowModal( &fpid, this ); ignore_unused( viewer->ShowModal( &fpid, this ) );
(void) ret; // make static analyser quiet
viewer->Destroy(); viewer->Destroy();

View File

@ -72,10 +72,8 @@ void PLUGIN::FootprintEnumerate( wxArrayString& aFootprintNames, const wxString&
} }
void PLUGIN::PrefetchLib( const wxString& aLibraryPath, const PROPERTIES* aProperties ) void PLUGIN::PrefetchLib( const wxString&, const PROPERTIES* )
{ {
(void) aLibraryPath;
(void) aProperties;
} }

View File

@ -43,6 +43,7 @@
#include <footprint.h> #include <footprint.h>
#include <geometry/shape_line_chain.h> #include <geometry/shape_line_chain.h>
#include <ignore.h>
#include <netclass.h> #include <netclass.h>
#include <pad.h> #include <pad.h>
#include <pcb_track.h> #include <pcb_track.h>
@ -5078,7 +5079,7 @@ ZONE* PCB_PARSER::parseZONE( BOARD_ITEM_CONTAINER* aParent )
break; break;
case T_arc_segments: case T_arc_segments:
static_cast<void>( parseInt( "arc segment count" ) ); ignore_unused( parseInt( "arc segment count" ) );
NeedRIGHT(); NeedRIGHT();
break; break;

View File

@ -74,6 +74,7 @@
#include <board.h> #include <board.h>
#include <board_design_settings.h> #include <board_design_settings.h>
#include <footprint.h> #include <footprint.h>
#include <ignore.h>
#include <pad.h> #include <pad.h>
#include <pcb_track.h> #include <pcb_track.h>
#include <pcb_text.h> #include <pcb_text.h>
@ -459,7 +460,7 @@ BOARD* LEGACY_PLUGIN::Load( const wxString& aFileName, BOARD* aAppendToMe,
loadAllSections( bool( aAppendToMe ) ); loadAllSections( bool( aAppendToMe ) );
(void)boardDeleter.release(); // give it up so we dont delete it on exit ignore_unused( boardDeleter.release() ); // give it up so we dont delete it on exit
m_progressReporter = nullptr; m_progressReporter = nullptr;
return m_board; return m_board;
} }
@ -1876,7 +1877,7 @@ void LEGACY_PLUGIN::loadPCB_LINE()
dseg->SetLayer( leg_layer2new( m_cu_count, layer ) ); dseg->SetLayer( leg_layer2new( m_cu_count, layer ) );
break; break;
case 1: case 1:
(void)intParse( data ); ignore_unused( intParse( data ) );
break; break;
case 2: case 2:
double angle; double angle;
@ -2397,7 +2398,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
else if( TESTLINE( "ZAux" ) ) // aux info found else if( TESTLINE( "ZAux" ) ) // aux info found
{ {
// e.g. "ZAux 7 E" // e.g. "ZAux 7 E"
int ignore = intParse( line + SZ( "ZAux" ), &data ); ignore_unused( intParse( line + SZ( "ZAux" ), &data ) );
char* hopt = strtok_r( (char*) data, delims, (char**) &data ); char* hopt = strtok_r( (char*) data, delims, (char**) &data );
if( !hopt ) if( !hopt )
@ -2418,8 +2419,6 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
THROW_IO_ERROR( m_error ); THROW_IO_ERROR( m_error );
} }
(void) ignore;
// Set hatch mode later, after reading corner outline data // Set hatch mode later, after reading corner outline data
} }
else if( TESTLINE( "ZSmoothing" ) ) else if( TESTLINE( "ZSmoothing" ) )
@ -2473,7 +2472,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
{ {
// e.g. "ZOptions 0 32 F 200 200" // e.g. "ZOptions 0 32 F 200 200"
int fillmode = intParse( line + SZ( "ZOptions" ), &data ); int fillmode = intParse( line + SZ( "ZOptions" ), &data );
static_cast<void>( intParse( data, &data ) ); // Ignored ignore_unused( intParse( data, &data ) );
char fillstate = data[1]; // here e.g. " F" char fillstate = data[1]; // here e.g. " F"
BIU thermalReliefGap = biuParse( data += 2 , &data ); // +=2 for " F" BIU thermalReliefGap = biuParse( data += 2 , &data ); // +=2 for " F"
BIU thermalReliefCopperBridge = biuParse( data ); BIU thermalReliefCopperBridge = biuParse( data );
@ -2686,7 +2685,7 @@ void LEGACY_PLUGIN::loadDIMENSION()
} }
else if( TESTLINE( "Sb" ) ) else if( TESTLINE( "Sb" ) )
{ {
int ignore = biuParse( line + SZ( "Sb" ), &data ); ignore_unused( biuParse( line + SZ( "Sb" ), &data ) );
BIU crossBarOx = biuParse( data, &data ); BIU crossBarOx = biuParse( data, &data );
BIU crossBarOy = biuParse( data, &data ); BIU crossBarOy = biuParse( data, &data );
BIU crossBarFx = biuParse( data, &data ); BIU crossBarFx = biuParse( data, &data );
@ -2696,74 +2695,60 @@ void LEGACY_PLUGIN::loadDIMENSION()
dim->SetLineThickness( width ); dim->SetLineThickness( width );
dim->UpdateHeight( wxPoint( crossBarFx, crossBarFy ), dim->UpdateHeight( wxPoint( crossBarFx, crossBarFy ),
wxPoint( crossBarOx, crossBarOy ) ); wxPoint( crossBarOx, crossBarOy ) );
(void) ignore;
} }
else if( TESTLINE( "Sd" ) ) else if( TESTLINE( "Sd" ) )
{ {
int ignore = intParse( line + SZ( "Sd" ), &data ); ignore_unused( intParse( line + SZ( "Sd" ), &data ) );
BIU featureLineDOx = biuParse( data, &data ); BIU featureLineDOx = biuParse( data, &data );
BIU featureLineDOy = biuParse( data, &data ); BIU featureLineDOy = biuParse( data, &data );
BIU featureLineDFx = biuParse( data, &data );
BIU featureLineDFy = biuParse( data ); ignore_unused( biuParse( data, &data ) );
ignore_unused( biuParse( data ) );
dim->SetStart( wxPoint( featureLineDOx, featureLineDOy ) ); dim->SetStart( wxPoint( featureLineDOx, featureLineDOy ) );
( void )ignore;
( void )featureLineDFx;
( void )featureLineDFy;
} }
else if( TESTLINE( "Sg" ) ) else if( TESTLINE( "Sg" ) )
{ {
int ignore = intParse( line + SZ( "Sg" ), &data ); ignore_unused( intParse( line + SZ( "Sg" ), &data ) );
BIU featureLineGOx = biuParse( data, &data ); BIU featureLineGOx = biuParse( data, &data );
BIU featureLineGOy = biuParse( data, &data ); BIU featureLineGOy = biuParse( data, &data );
BIU featureLineGFx = biuParse( data, &data );
BIU featureLineGFy = biuParse( data );
(void) ignore; ignore_unused( biuParse( data, &data ) );
ignore_unused( biuParse( data ) );
dim->SetEnd( wxPoint( featureLineGOx, featureLineGOy ) ); dim->SetEnd( wxPoint( featureLineGOx, featureLineGOy ) );
( void )ignore;
( void )featureLineGFx;
( void )featureLineGFy;
} }
else if( TESTLINE( "S1" ) ) // Arrow: no longer imported else if( TESTLINE( "S1" ) ) // Arrow: no longer imported
{ {
int ignore = intParse( line + SZ( "S1" ), &data ); ignore_unused( intParse( line + SZ( "S1" ), &data ) );
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); biuParse( data, &data );
biuParse( data ); biuParse( data );
(void) ignore;
} }
else if( TESTLINE( "S2" ) ) // Arrow: no longer imported else if( TESTLINE( "S2" ) ) // Arrow: no longer imported
{ {
int ignore = intParse( line + SZ( "S2" ), &data ); ignore_unused( intParse( line + SZ( "S2" ), &data ) );
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); biuParse( data, &data );
biuParse( data, &data ); biuParse( data, &data );
(void) ignore;
} }
else if( TESTLINE( "S3" ) ) // Arrow: no longer imported else if( TESTLINE( "S3" ) ) // Arrow: no longer imported
{ {
int ignore = intParse( line + SZ( "S3" ), &data ); ignore_unused( intParse( line + SZ( "S3" ), &data ) );
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); biuParse( data, &data );
biuParse( data, &data ); biuParse( data, &data );
(void) ignore;
} }
else if( TESTLINE( "S4" ) ) // Arrow: no longer imported else if( TESTLINE( "S4" ) ) // Arrow: no longer imported
{ {
int ignore = intParse( line + SZ( "S4" ), &data ); ignore_unused( intParse( line + SZ( "S4" ), &data ) );
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); // skipping excessive data biuParse( data, &data ); // skipping excessive data
biuParse( data, &data ); biuParse( data, &data );
biuParse( data, &data ); biuParse( data, &data );
(void) ignore;
} }
} }

View File

@ -40,6 +40,7 @@
#include <drc/drc_engine.h> #include <drc/drc_engine.h>
#include <drc/drc_item.h> #include <drc/drc_item.h>
#include <fp_lib_table.h> #include <fp_lib_table.h>
#include <ignore.h>
#include <io_mgr.h> #include <io_mgr.h>
#include <string_utils.h> #include <string_utils.h>
#include <macros.h> #include <macros.h>
@ -99,7 +100,7 @@ SETTINGS_MANAGER* GetSettingsManager()
else else
{ {
// Ensure wx system settings stuff is available // Ensure wx system settings stuff is available
static_cast<void>( wxTheApp ); ignore_unused( wxTheApp );
s_SettingsManager = new SETTINGS_MANAGER( true ); s_SettingsManager = new SETTINGS_MANAGER( true );
} }
} }

View File

@ -24,6 +24,7 @@
#include <qa_utils/wx_utils/unit_test_utils.h> #include <qa_utils/wx_utils/unit_test_utils.h>
#include <ignore.h>
#include <kiway.h> #include <kiway.h>
#include <sch_io_mgr.h> #include <sch_io_mgr.h>
@ -64,7 +65,7 @@ BOOST_AUTO_TEST_CASE( Load )
BOOST_TEST_MESSAGE( fn.GetFullPath() ); BOOST_TEST_MESSAGE( fn.GetFullPath() );
(void) pi; ignore_unused( pi );
// This doesn't work with a null KiWay. // This doesn't work with a null KiWay.
// const SCH_SHEET* sheet = pi->Load( fn.GetFullPath(), nullptr ); // const SCH_SHEET* sheet = pi->Load( fn.GetFullPath(), nullptr );
// BOOST_CHECK_NE( nullptr, sheet ); // BOOST_CHECK_NE( nullptr, sheet );

View File

@ -27,6 +27,7 @@
*/ */
#include <convert_to_biu.h> #include <convert_to_biu.h>
#include <ignore.h>
#include <sch_junction.h> #include <sch_junction.h>
#include <sch_no_connect.h> #include <sch_no_connect.h>
#include <qa_utils/wx_utils/unit_test_utils.h> #include <qa_utils/wx_utils/unit_test_utils.h>
@ -65,7 +66,7 @@ BOOST_AUTO_TEST_CASE( Default )
int count = 0; int count = 0;
for( auto item : m_tree ) for( auto item : m_tree )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -76,7 +77,7 @@ BOOST_AUTO_TEST_CASE( Default )
count = 0; count = 0;
for( auto item : m_tree.OfType( KICAD_T( type ) ) ) for( auto item : m_tree.OfType( KICAD_T( type ) ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -90,7 +91,7 @@ BOOST_AUTO_TEST_CASE( Default )
count = 0; count = 0;
for( auto item : m_tree.Overlapping( SCH_JUNCTION_T, bbox ) ) for( auto item : m_tree.Overlapping( SCH_JUNCTION_T, bbox ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -111,7 +112,7 @@ BOOST_AUTO_TEST_CASE( Junctions )
for( auto item : m_tree.OfType( SCH_JUNCTION_T ) ) for( auto item : m_tree.OfType( SCH_JUNCTION_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -120,7 +121,7 @@ BOOST_AUTO_TEST_CASE( Junctions )
count = 0; count = 0;
for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) ) for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -199,7 +200,7 @@ BOOST_AUTO_TEST_CASE( MixedElements )
for( auto item : m_tree.OfType( SCH_JUNCTION_T ) ) for( auto item : m_tree.OfType( SCH_JUNCTION_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -208,7 +209,7 @@ BOOST_AUTO_TEST_CASE( MixedElements )
count = 0; count = 0;
for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) ) for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -261,7 +262,7 @@ BOOST_AUTO_TEST_CASE( SingleElementTree )
for( auto item : m_tree.OfType( SCH_JUNCTION_T ) ) for( auto item : m_tree.OfType( SCH_JUNCTION_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }
@ -270,7 +271,7 @@ BOOST_AUTO_TEST_CASE( SingleElementTree )
count = 0; count = 0;
for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) ) for( auto item : m_tree.OfType( SCH_NO_CONNECT_T ) )
{ {
static_cast<void>( item ); ignore_unused( item );
count++; count++;
} }

View File

@ -32,6 +32,7 @@
#include <qa_utils/utility_registry.h> #include <qa_utils/utility_registry.h>
#include <board.h> #include <board.h>
#include <ignore.h>
#include <zone.h> #include <zone.h>
#include <profile.h> #include <profile.h>
@ -242,7 +243,7 @@ int polygon_triangulation_main( int argc, char *argv[] )
poly.CacheTriangulation(); poly.CacheTriangulation();
(void) poly; ignore_unused( poly );
#if 0 #if 0
PROF_COUNTER unfrac("unfrac"); PROF_COUNTER unfrac("unfrac");
poly.Unfracture( SHAPE_POLY_SET::PM_FAST ); poly.Unfracture( SHAPE_POLY_SET::PM_FAST );