Commit 3918d3f0 authored by Mark Roszko's avatar Mark Roszko Committed by jean-pierre charras

Eeschema code cleanup and coverity fixes.

parent d1d1e2b5
...@@ -304,7 +304,7 @@ void EDA_3D_CANVAS::Draw3DGrid( double aGriSizeMM ) ...@@ -304,7 +304,7 @@ void EDA_3D_CANVAS::Draw3DGrid( double aGriSizeMM )
glEnd(); glEnd();
} }
if( delta > xsize / 2 ) if( delta > xsize / 2.0f )
break; break;
} }
......
...@@ -956,7 +956,7 @@ void CAIRO_GAL::blitCursor( wxBufferedDC& clientDC ) ...@@ -956,7 +956,7 @@ void CAIRO_GAL::blitCursor( wxBufferedDC& clientDC )
} }
// Store pixels that are going to be overpainted // Store pixels that are going to be overpainted
VECTOR2D cursorScreen = ToScreen( cursorPosition ) - cursorSize / 2; VECTOR2D cursorScreen = ToScreen( cursorPosition ) - cursorSize / 2.0f;
cursorSave.Blit( 0, 0, cursorSize, cursorSize, &clientDC, cursorScreen.x, cursorScreen.y ); cursorSave.Blit( 0, 0, cursorSize, cursorSize, &clientDC, cursorScreen.x, cursorScreen.y );
// Draw the cursor // Draw the cursor
......
...@@ -88,7 +88,6 @@ set( EESCHEMA_SRCS ...@@ -88,7 +88,6 @@ set( EESCHEMA_SRCS
edit_component_in_schematic.cpp edit_component_in_schematic.cpp
edit_bitmap.cpp edit_bitmap.cpp
edit_label.cpp edit_label.cpp
eelibs_read_libraryfiles.cpp
eeredraw.cpp eeredraw.cpp
eeschema.cpp eeschema.cpp
eeschema_config.cpp eeschema_config.cpp
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <confirm.h> #include <confirm.h>
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <netlist.h> #include <sch_reference_list.h>
#include <class_library.h> #include <class_library.h>
#include <sch_component.h> #include <sch_component.h>
#include <lib_pin.h> #include <lib_pin.h>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <general.h> #include <general.h>
#include <sch_sheet_path.h> #include <sch_sheet_path.h>
#include <sch_component.h> #include <sch_component.h>
#include <netlist.h> #include <sch_reference_list.h>
#include <dsnlexer.h> #include <dsnlexer.h>
#include <ptree.h> #include <ptree.h>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <fctsys.h> #include <fctsys.h>
#include <kicad_string.h> #include <kicad_string.h>
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <netlist.h> #include <sch_reference_list.h>
#include <sch_component.h> #include <sch_component.h>
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2014 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 2
* 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-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file eelibs_read_libraryfiles.cpp
* @brief Functions to handle reading component library files.
*/
#include <fctsys.h>
#include <kiway.h>
#include <confirm.h>
#include <macros.h>
#include <pgm_base.h>
#include <wxEeschemaStruct.h>
#include <general.h>
#include <class_library.h>
#include <wildcards_and_files_ext.h>
#include <html_messagebox.h>
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <wxEeschemaStruct.h> #include <wxEeschemaStruct.h>
#include <netlist.h> #include <netlist.h>
#include <sch_reference_list.h>
#include <class_netlist_object.h> #include <class_netlist_object.h>
#include <class_library.h> #include <class_library.h>
#include <lib_pin.h> #include <lib_pin.h>
......
This diff is collapsed.
This diff is collapsed.
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <class_sch_screen.h> #include <class_sch_screen.h>
#include <sch_item_struct.h> #include <sch_item_struct.h>
#include <netlist.h> #include <sch_reference_list.h>
#include <class_library.h> #include <class_library.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <sch_sheet_path.h> #include <sch_sheet_path.h>
......
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -558,7 +559,7 @@ bool SCH_TEXT::IsSelectStateChanged( const wxRect& aRect ) ...@@ -558,7 +559,7 @@ bool SCH_TEXT::IsSelectStateChanged( const wxRect& aRect )
if( aRect.Contains( m_Pos ) ) if( aRect.Contains( m_Pos ) )
SetFlags( SELECTED ); SetFlags( SELECTED );
else else
SetFlags( SELECTED ); ClearFlags( SELECTED );
return previousState != IsSelected(); return previousState != IsSelected();
} }
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <hotkeys.h> #include <hotkeys.h>
#include <eeschema_config.h> #include <eeschema_config.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <sch_sheet_path.h>
#include <invoke_sch_dialog.h> #include <invoke_sch_dialog.h>
#include <dialogs/dialog_schematic_find.h> #include <dialogs/dialog_schematic_find.h>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2009-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2009-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -280,14 +280,16 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize, ...@@ -280,14 +280,16 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
if( currTrack->Type() != PCB_VIA_T if( currTrack->Type() != PCB_VIA_T
|| ( currTrack->GetStart() != track->GetStart() && currTrack->GetStart() != track->GetEnd() )) || ( currTrack->GetStart() != track->GetStart() && currTrack->GetStart() != track->GetEnd() ))
{ {
if( distStart <= currTrack->GetWidth()/2 ) double max_dist = currTrack->GetWidth() / 2.0f;
if( distStart <= max_dist )
{ {
// D(printf("nearest end is start\n");) // D(printf("nearest end is start\n");)
*curpos = track->GetStart(); *curpos = track->GetStart();
return true; return true;
} }
if( distEnd <= currTrack->GetWidth()/2 ) if( distEnd <= max_dist )
{ {
// D(printf("nearest end is end\n");) // D(printf("nearest end is end\n");)
*curpos = track->GetEnd(); *curpos = track->GetEnd();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment