From fb3d1bdb5985ecd39a9b9ee3afa817784fa19aee Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 12 Jun 2019 22:16:54 -0700 Subject: [PATCH] Clear some compile warnings --- eeschema/dialogs/dialog_spice_model.cpp | 4 +++- pcbnew/load_select_footprint.cpp | 2 -- polygon/clipper.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_spice_model.cpp b/eeschema/dialogs/dialog_spice_model.cpp index b265e23631..eb1187d869 100644 --- a/eeschema/dialogs/dialog_spice_model.cpp +++ b/eeschema/dialogs/dialog_spice_model.cpp @@ -804,9 +804,11 @@ bool DIALOG_SPICE_MODEL::addPwlValue( const wxString& aTime, const wxString& aVa float timeF; m_pwlTime->GetValue().ToDouble( &timeD ); timeF = timeD; + long data; + std::memcpy( &data, &timeF, sizeof( timeF ) ); // Store the time value, so the entries can be sorted - m_pwlValList->SetItemData( idx, *reinterpret_cast( &timeF ) ); + m_pwlValList->SetItemData( idx, data ); // Sort items by timestamp m_pwlValList->SortItems( comparePwlValues, -1 ); diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 28dce42892..908d1aa009 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -496,8 +496,6 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, bool aRecreateRatsnest ) s_PickedList.ClearItemsList(); } - auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions(); - aModule->SetPosition( (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition() ); aModule->ClearFlags(); diff --git a/polygon/clipper.cpp b/polygon/clipper.cpp index 448aff4856..964575e28e 100644 --- a/polygon/clipper.cpp +++ b/polygon/clipper.cpp @@ -889,7 +889,8 @@ void DisposeOutPts( OutPt*& pp ) inline void InitEdge( TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt ) { - std::memset( e, 0, sizeof(TEdge) ); + // This clears the C++ way + *e = TEdge( { 0 } ); e->Next = eNext; e->Prev = ePrev;