Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d6c6b4de
Commit
d6c6b4de
authored
Feb 27, 2015
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some coverity warnings (mainly not initialized vars).
parent
30acc07e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
36 additions
and
65 deletions
+36
-65
common_plotPDF_functions.cpp
common/common_plotPDF_functions.cpp
+3
-2
viewlibs.cpp
eeschema/viewlibs.cpp
+2
-4
rect_placement.h
pcbnew/autorouter/rect_placement/rect_placement.h
+2
-2
block_module_editor.cpp
pcbnew/block_module_editor.cpp
+8
-8
class_board.cpp
pcbnew/class_board.cpp
+2
-3
class_dimension.cpp
pcbnew/class_dimension.cpp
+1
-0
class_module.cpp
pcbnew/class_module.cpp
+2
-7
drc.cpp
pcbnew/drc.cpp
+3
-0
gpcb_plugin.cpp
pcbnew/gpcb_plugin.cpp
+1
-0
dialog_dxf_import.cpp
pcbnew/import_dxf/dialog_dxf_import.cpp
+3
-1
move_or_drag_track.cpp
pcbnew/move_or_drag_track.cpp
+8
-38
PolyLine.cpp
polygon/PolyLine.cpp
+1
-0
No files found.
common/common_plotPDF_functions.cpp
View file @
d6c6b4de
...
...
@@ -452,7 +452,8 @@ void PDF_PLOTTER::closePdfStream()
{
wxASSERT
(
workFile
);
int
stream_len
=
ftell
(
workFile
);
long
stream_len
=
ftell
(
workFile
);
wxASSERT
(
stream_len
>=
0
);
// Rewind the file, read in the page stream and DEFLATE it
fseek
(
workFile
,
0
,
SEEK_SET
);
...
...
@@ -468,7 +469,7 @@ void PDF_PLOTTER::closePdfStream()
::
wxRemoveFile
(
workFilename
);
// NULL means memos owns the memory, but provide a hint on optimum size needed.
wxMemoryOutputStream
memos
(
NULL
,
std
::
max
(
2000
,
stream_len
)
)
;
wxMemoryOutputStream
memos
(
NULL
,
std
::
max
(
2000
l
,
stream_len
)
)
;
{
/* Somewhat standard parameters to compress in DEFLATE. The PDF spec is
...
...
eeschema/viewlibs.cpp
View file @
d6c6b4de
...
...
@@ -208,8 +208,6 @@ void LIB_VIEW_FRAME::SelectAndViewLibraryPart( int option )
void
LIB_VIEW_FRAME
::
ViewOneLibraryContent
(
PART_LIB
*
Lib
,
int
Flag
)
{
int
NumOfParts
=
0
;
LIB_ALIAS
*
entry
;
wxString
CmpName
;
if
(
Lib
)
NumOfParts
=
Lib
->
GetCount
();
...
...
@@ -220,8 +218,8 @@ void LIB_VIEW_FRAME::ViewOneLibraryContent( PART_LIB* Lib, int Flag )
return
;
}
if
(
Lib
==
NULL
)
return
;
LIB_ALIAS
*
entry
;
wxString
CmpName
;
if
(
Flag
==
NEW_PART
)
DisplayListComponentsInLib
(
Lib
,
CmpName
,
m_entryName
);
...
...
pcbnew/autorouter/rect_placement/rect_placement.h
View file @
d6c6b4de
...
...
@@ -26,7 +26,7 @@ public:
{
int
x
,
y
;
TPos
()
{
}
TPos
()
:
x
(
0
),
y
(
0
)
{
}
TPos
(
int
_x
,
int
_y
)
:
x
(
_x
),
y
(
_y
)
{
}
bool
operator
==
(
const
TPos
&
p
)
const
{
return
x
==
p
.
x
&&
y
==
p
.
y
;
}
...
...
@@ -36,7 +36,7 @@ public:
{
int
w
,
h
;
TRect
()
{
}
TRect
()
:
w
(
0
),
h
(
0
)
{
}
TRect
(
int
_x
,
int
_y
,
int
_w
,
int
_h
)
:
TPos
(
_x
,
_y
),
w
(
_w
>
0
?
_w
:
0
),
h
(
_h
>
0
?
_h
:
0
)
{
}
...
...
pcbnew/block_module_editor.cpp
View file @
d6c6b4de
...
...
@@ -662,12 +662,12 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
if
(
!
pad
->
IsSelected
()
&&
!
force_all
)
continue
;
wxPoint
pos
=
pad
->
GetPos
ition
();
wxPoint
pos
=
pad
->
GetPos
0
();
ROTATE
(
pos
);
pad
->
SetPosition
(
pos
);
pad
->
SetPos0
(
pad
->
GetPosition
()
);
pad
->
SetPos0
(
pos
);
pad
->
SetOrientation
(
pad
->
GetOrientation
()
+
900
);
pad
->
SetDrawCoord
();
}
for
(
EDA_ITEM
*
item
=
module
->
GraphicalItems
();
item
;
item
=
item
->
Next
()
)
...
...
@@ -681,15 +681,15 @@ void RotateMarkedItems( MODULE* module, wxPoint offset, bool force_all )
{
EDGE_MODULE
*
em
=
(
EDGE_MODULE
*
)
item
;
wxPoint
tmp
=
em
->
GetStart
();
wxPoint
tmp
=
em
->
GetStart
0
();
ROTATE
(
tmp
);
em
->
SetStart
(
tmp
);
em
->
SetStart0
(
tmp
);
tmp
=
em
->
GetEnd
();
tmp
=
em
->
GetEnd
0
();
ROTATE
(
tmp
);
em
->
SetEnd
(
tmp
);
em
->
SetEnd0
(
tmp
);
em
->
SetDrawCoord
();
}
break
;
...
...
pcbnew/class_board.cpp
View file @
d6c6b4de
...
...
@@ -233,7 +233,8 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, LSET aLayerMask, TRACK_PTRS*
* if > 1 segment:
* end of track (more than 2 segment connected at this location)
*/
segment
=
m_Track
;
candidate
=
NULL
;
segment
=
m_Track
;
candidate
=
NULL
;
NbSegm
=
0
;
while
(
(
segment
=
::
GetTrack
(
segment
,
NULL
,
aPosition
,
aLayerMask
)
)
!=
NULL
)
...
...
@@ -280,8 +281,6 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, LSET aLayerMask, TRACK_PTRS*
aPosition
=
candidate
->
GetStart
();
}
segment
=
m_Track
;
/* restart list of tracks to analyze */
/* flag this item an push it in list of selected items */
aList
->
push_back
(
candidate
);
candidate
->
SetState
(
BUSY
,
true
);
...
...
pcbnew/class_dimension.cpp
View file @
d6c6b4de
...
...
@@ -49,6 +49,7 @@ DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
m_Width
(
Millimeter2iu
(
0.2
)
),
m_Unit
(
INCHES
),
m_Value
(
0
),
m_Height
(
0
),
m_Text
(
this
)
{
m_Layer
=
Dwgs_User
;
m_Shape
=
0
;
}
...
...
pcbnew/class_module.cpp
View file @
d6c6b4de
...
...
@@ -1055,7 +1055,7 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector )
for
(
D_PAD
*
pad
=
Pads
();
pad
;
pad
=
pad
->
Next
()
)
{
pad
->
SetPos0
(
pad
->
GetPos0
()
+
moveVector
);
pad
->
Set
Position
(
pad
->
GetPos0
()
+
footprintPos
);
pad
->
Set
DrawCoord
(
);
}
// Update the draw element coordinates.
...
...
@@ -1100,13 +1100,8 @@ void MODULE::SetOrientation( double newangle )
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
pt
=
pad
->
GetPos0
();
pad
->
SetOrientation
(
pad
->
GetOrientation
()
+
angleChange
);
RotatePoint
(
&
pt
,
m_Orient
);
pad
->
SetPosition
(
GetPosition
()
+
pt
);
pad
->
SetDrawCoord
();
}
// Update of the reference and value.
...
...
pcbnew/drc.cpp
View file @
d6c6b4de
...
...
@@ -103,6 +103,9 @@ DRC::DRC( PCB_EDIT_FRAME* aPcbWindow )
m_doPad2PadTest
=
true
;
// enable pad to pad clearance tests
m_doUnconnectedTest
=
true
;
// enable unconnected tests
m_doZonesTest
=
true
;
// enable zone to items clearance tests
m_doKeepoutTest
=
true
;
// enable keepout areas to items clearance tests
m_abortDRC
=
false
;
m_drcInProgress
=
false
;
m_doCreateRptFile
=
false
;
...
...
pcbnew/gpcb_plugin.cpp
View file @
d6c6b4de
...
...
@@ -132,6 +132,7 @@ GPCB_FPL_CACHE_ITEM::GPCB_FPL_CACHE_ITEM( MODULE* aModule, const wxFileName& aFi
m_module
(
aModule
)
{
m_file_name
=
aFileName
;
m_writable
=
true
;
// temporary init
if
(
m_file_name
.
FileExists
()
)
m_mod_time
=
m_file_name
.
GetModificationTime
();
...
...
pcbnew/import_dxf/dialog_dxf_import.cpp
View file @
d6c6b4de
...
...
@@ -116,7 +116,9 @@ void DIALOG_DXF_IMPORT::OnBrowseDxfFiles( wxCommandEvent& event )
path
,
filename
,
wxT
(
"dxf Files (*.dxf)|*.dxf"
),
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
dlg
.
ShowModal
();
if
(
dlg
.
ShowModal
()
!=
wxID_OK
)
return
;
wxString
fileName
=
dlg
.
GetPath
();
...
...
pcbnew/move_or_drag_track.cpp
View file @
d6c6b4de
...
...
@@ -271,9 +271,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC
// only the intercept will change, segment slopes does not change
// because we are moving parallel with is initial state
if
(
!
s_MovingSegmentVertical
)
{
s_MovingSegment_Yorg
=
ty1
-
(
s_MovingSegmentSlope
*
tx1
);
}
if
(
(
!
s_EndPointVertical
)
&&
(
!
s_MovingSegmentVertical
)
)
{
...
...
@@ -283,43 +281,29 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC
else
{
if
(
!
s_EndPointVertical
)
{
xi2
=
tx2
;
}
else
{
//P1=P2
if
(
!
s_EndPointHorizontal
)
{
xi2
=
tx2
-
dx
;
}
else
{
update
=
false
;
}
}
}
if
(
!
s_MovingSegmentVertical
)
{
yi2
=
s_MovingSegmentSlope
*
(
xi2
)
+
s_MovingSegment_Yorg
;
}
yi2
=
(
s_MovingSegmentSlope
*
xi2
)
+
s_MovingSegment_Yorg
;
else
{
if
(
!
s_EndPointVertical
)
{
yi2
=
s_EndSegmentSlope
*
(
xi2
)
+
s_EndSegment_Yorg
;
}
yi2
=
(
s_EndSegmentSlope
*
xi2
)
+
s_EndSegment_Yorg
;
else
{
if
(
!
s_EndPointHorizontal
)
{
update
=
false
;
}
else
{
yi2
=
s_MovingSegmentSlope
*
(
xi2
)
+
s_MovingSegment_Yorg
;
}
else
yi2
=
(
s_MovingSegmentSlope
*
xi2
)
+
s_MovingSegment_Yorg
;
}
}
...
...
@@ -331,46 +315,32 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( EDA_DRAW_PANEL* aPanel, wxDC
else
{
if
(
!
s_StartPointVertical
)
{
xi1
=
tx1
;
}
else
{
//P1=P2
if
(
!
s_StartPointHorizontal
)
{
xi1
=
tx1
-
dx
;
}
else
{
if
(
!
s_StartPointHorizontal
)
{
update
=
false
;
}
}
}
}
if
(
!
s_MovingSegmentVertical
)
{
yi1
=
s_MovingSegmentSlope
*
(
xi1
)
+
s_MovingSegment_Yorg
;
}
yi1
=
(
s_MovingSegmentSlope
*
xi1
)
+
s_MovingSegment_Yorg
;
else
{
if
(
!
s_StartPointVertical
)
{
yi1
=
s_StartSegmentSlope
*
(
xi1
)
+
s_StartSegment_Yorg
;
}
yi1
=
(
s_StartSegmentSlope
*
xi1
)
+
s_StartSegment_Yorg
;
else
{
if
(
!
s_StartPointHorizontal
)
{
update
=
false
;
}
else
{
yi2
=
s_MovingSegmentSlope
*
(
xi1
)
+
s_MovingSegment_Yorg
;
}
yi2
=
(
s_MovingSegmentSlope
*
xi1
)
+
s_MovingSegment_Yorg
;
}
}
...
...
@@ -703,7 +673,7 @@ void PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
if
(
!
track
)
return
;
// TODO: Use clenup functions to merge collinear segments if track
// TODO: Use cle
a
nup functions to merge collinear segments if track
// is connected to a collinear segment.
s_StartSegmentPresent
=
s_EndSegmentPresent
=
true
;
...
...
polygon/PolyLine.cpp
View file @
d6c6b4de
...
...
@@ -985,6 +985,7 @@ void CPolyLine::Copy( const CPolyLine* src )
m_layer
=
src
->
m_layer
;
m_hatchStyle
=
src
->
m_hatchStyle
;
m_hatchPitch
=
src
->
m_hatchPitch
;
m_flags
=
src
->
m_flags
;
m_CornersList
.
RemoveAllContours
();
m_CornersList
.
Append
(
src
->
m_CornersList
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment