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
4def0958
Commit
4def0958
authored
Apr 03, 2015
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some coverity warnings. Fix typo and errors in comments. Very minor other fixes.
parent
be785d55
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
52 additions
and
41 deletions
+52
-41
lib_pin.cpp
eeschema/lib_pin.cpp
+26
-23
lib_pin.h
eeschema/lib_pin.h
+2
-2
kiway.h
include/kiway.h
+2
-2
coroutine.h
include/tool/coroutine.h
+3
-0
pl_editor_frame.cpp
pagelayout_editor/pl_editor_frame.cpp
+3
-1
class_netclass.h
pcbnew/class_netclass.h
+1
-1
class_track.cpp
pcbnew/class_track.cpp
+5
-2
collectors.cpp
pcbnew/collectors.cpp
+2
-2
collectors.h
pcbnew/collectors.h
+1
-1
connect.h
pcbnew/connect.h
+1
-1
pcbnew_control.h
pcbnew/tools/pcbnew_control.h
+1
-1
selection_tool.h
pcbnew/tools/selection_tool.h
+5
-5
No files found.
eeschema/lib_pin.cpp
View file @
4def0958
...
...
@@ -48,7 +48,7 @@
#include <sch_component.h>
static
const
int
pin_orientation_codes
[]
=
static
const
int
pin_orientation_codes
[]
=
{
PIN_RIGHT
,
PIN_LEFT
,
...
...
@@ -61,7 +61,7 @@ static const int pin_orientation_codes[] =
// bitmaps to show pins orientations in dialog editor
// must have same order than pin_orientation_names
static
const
BITMAP_DEF
s_icons_Pins_
Orientations
[]
=
static
const
BITMAP_DEF
iconsPins
Orientations
[]
=
{
pinorient_right_xpm
,
pinorient_left_xpm
,
...
...
@@ -72,7 +72,7 @@ static const BITMAP_DEF s_icons_Pins_Orientations[] =
// bitmaps to show pins shapes in dialog editor
// must have same order than pin_style_names
static
BITMAP_DEF
s_icons_Pins_
Shapes
[]
=
static
BITMAP_DEF
iconsPins
Shapes
[]
=
{
pinshape_normal_xpm
,
pinshape_invert_xpm
,
...
...
@@ -122,7 +122,7 @@ static const BITMAP_DEF iconsPinsElectricalType[] =
#define PIN_ELECTRICAL_TYPE_CNT DIM( iconsPinsElectricalType )
const
wxString
LIB_PIN
::
GetCanonicalElectricalTypeName
(
unsigned
aType
)
const
wxString
LIB_PIN
::
GetCanonicalElectricalTypeName
(
int
aType
)
{
// These strings are the canonical name of the electrictal type
// Not translated, no space in name, only ASCII chars.
...
...
@@ -144,7 +144,7 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType )
wxT
(
"???"
)
};
if
(
aType
>=
PIN_NMAX
)
if
(
aType
<
0
||
aType
>
int
(
PIN_NMAX
)
)
aType
=
PIN_NMAX
;
return
msgPinElectricType
[
aType
];
...
...
@@ -155,7 +155,7 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType )
// Note: the strings are *not* static because they are translated and must be built
// on the fly, to be properly translated
static
const
wxString
getPinOrientationName
(
unsigned
aPinOrientationCode
)
static
const
wxString
getPinOrientationName
(
int
aPinOrientationCode
)
{
/* Note: The following name lists are sentence capitalized per the GNOME UI
* standards for list controls. Please do not change the capitalization
...
...
@@ -166,16 +166,17 @@ static const wxString getPinOrientationName( unsigned aPinOrientationCode )
_
(
"Right"
),
_
(
"Left"
),
_
(
"Up"
),
_
(
"Down"
)
_
(
"Down"
),
wxT
(
"???"
)
};
if
(
aPinOrientationCode
<
PIN_ORIENTATION_CNT
)
return
pin_orientation_names
[
aPinOrientationCode
]
;
else
return
wxT
(
"??"
)
;
if
(
aPinOrientationCode
<
0
||
aPinOrientationCode
>
int
(
PIN_ORIENTATION_CNT
)
)
aPinOrientationCode
=
PIN_ORIENTATION_CNT
;
return
pin_orientation_names
[
aPinOrientationCode
]
;
}
const
wxString
LIB_PIN
::
GetElectricalTypeName
(
unsigned
aPinsElectricalType
)
const
wxString
LIB_PIN
::
GetElectricalTypeName
(
int
aPinsElectricalType
)
{
const
wxString
pin_electrical_type_names
[]
=
{
// Keep these translated strings not static
...
...
@@ -189,16 +190,17 @@ const wxString LIB_PIN::GetElectricalTypeName( unsigned aPinsElectricalType )
_
(
"Power output"
),
_
(
"Open collector"
),
_
(
"Open emitter"
),
_
(
"Not connected"
)
_
(
"Not connected"
),
wxT
(
"???"
)
};
if
(
aPinsElectricalType
<
PIN_ELECTRICAL_TYPE_CNT
)
return
pin_electrical_type_names
[
aPinsElectricalType
]
;
if
(
aPinsElectricalType
<
0
||
aPinsElectricalType
>
int
(
PIN_ELECTRICAL_TYPE_CNT
)
)
aPinsElectricalType
=
PIN_ELECTRICAL_TYPE_CNT
;
return
wxT
(
"??"
)
;
return
pin_electrical_type_names
[
aPinsElectricalType
]
;
}
const
wxString
getPinStyleName
(
unsigned
aPinsStyle
)
static
const
wxString
getPinStyleName
(
int
aPinsStyle
)
{
const
wxString
pin_style_names
[]
=
{
// Keep these translated strings not static
...
...
@@ -210,13 +212,14 @@ const wxString getPinStyleName( unsigned aPinsStyle )
_
(
"Clock low"
),
_
(
"Output low"
),
_
(
"Falling edge clock"
),
_
(
"NonLogic"
)
_
(
"NonLogic"
),
wxT
(
"???"
)
};
if
(
aPinsStyle
<
PIN_STYLE_CNT
)
return
pin_style_names
[
aPinsStyle
]
;
if
(
aPinsStyle
<
0
||
aPinsStyle
>
int
(
PIN_STYLE_CNT
)
)
aPinsStyle
=
PIN_STYLE_CNT
;
return
wxT
(
"??"
)
;
return
pin_style_names
[
aPinsStyle
]
;
}
...
...
@@ -2227,13 +2230,13 @@ const BITMAP_DEF* LIB_PIN::GetElectricalTypeSymbols()
const
BITMAP_DEF
*
LIB_PIN
::
GetOrientationSymbols
()
{
return
s_icons_Pins_
Orientations
;
return
iconsPins
Orientations
;
}
const
BITMAP_DEF
*
LIB_PIN
::
GetStyleSymbols
()
{
return
s_icons_Pins_
Shapes
;
return
iconsPins
Shapes
;
}
...
...
eeschema/lib_pin.h
View file @
4def0958
...
...
@@ -272,7 +272,7 @@ public:
* @param aType is the electrical type (see enum ElectricPinType )
* @return The electrical name for a pin type (see enun MsgPinElectricType for names).
*/
static
const
wxString
GetCanonicalElectricalTypeName
(
unsigned
aType
);
static
const
wxString
GetCanonicalElectricalTypeName
(
int
aType
);
/**
* return a string giving the electrical type of the pin.
...
...
@@ -289,7 +289,7 @@ public:
* @param aType is the electrical type (see enum ElectricPinType )
* @return The electrical name of the pin (see enun MsgPinElectricType for names).
*/
static
const
wxString
GetElectricalTypeName
(
unsigned
aType
);
static
const
wxString
GetElectricalTypeName
(
int
aType
);
/**
* return a translated string for messages giving the electrical type of the pin.
...
...
include/kiway.h
View file @
4def0958
...
...
@@ -198,7 +198,7 @@ struct KIFACE
* @param aCtlBits consists of bit flags from the set of KFCTL_* \#defines above.
*
* @return wxWindow* - and if not NULL, should be cast into the known type using
* and old school cast. dynamic_cast is problem
en
atic since it needs typeinfo probably
* and old school cast. dynamic_cast is problematic since it needs typeinfo probably
* not contained in the caller's link image.
*/
VTBL_ENTRY
wxWindow
*
CreateWindow
(
wxWindow
*
aParent
,
int
aClassId
,
...
...
@@ -228,7 +228,7 @@ struct KIFACE
* having to link to the top process module which houses the KIWAY(s). More importantly
* it makes it possible to send custom wxEvents between DSOs and from the top
* process module down into the DSOs. The latter capability is thought useful
* for driving the lower DSOs from a python test rig or for demo (automaton) purposes.
* for driving the lower DSOs from a python test rig or for demo (automat
i
on) purposes.
* <p>
* Most all calls are via virtual functions, which means C++ vtables
* are used to hold function pointers and eliminate the need to link to specific
...
...
include/tool/coroutine.h
View file @
4def0958
...
...
@@ -82,6 +82,9 @@ public:
m_func
(
aEntry
),
m_saved
(
NULL
),
m_self
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
),
m_running
(
false
)
{
// Avoid not initialized members, and make static analysers quiet
m_args
=
0
;
m_retVal
=
0
;
}
~
COROUTINE
()
...
...
pagelayout_editor/pl_editor_frame.cpp
View file @
4def0958
...
...
@@ -697,7 +697,9 @@ WORKSHEET_DATAITEM* PL_EDITOR_FRAME::Locate( const wxPoint& aPosition )
drawList
.
SetSheetNumber
(
screen
->
m_ScreenNumber
);
drawList
.
SetSheetCount
(
screen
->
m_NumberOfScreens
);
drawList
.
SetFileName
(
GetCurrFileName
()
);
drawList
.
SetSheetName
(
GetScreenDesc
()
);
// GetScreenDesc() returns a temporary string. Store it to avoid issues.
wxString
descr
=
GetScreenDesc
();
drawList
.
SetSheetName
(
descr
);
drawList
.
BuildWorkSheetGraphicList
(
pageInfo
,
t_block
,
color
,
color
);
...
...
pcbnew/class_netclass.h
View file @
4def0958
...
...
@@ -125,7 +125,7 @@ public:
}
/**
* Function Add
Member
* Function Add
* adds \a aNetname to this NETCLASS if it is not already in this NETCLASS.
* It is harmless to try and add a second identical name.
*/
...
...
pcbnew/class_track.cpp
View file @
4def0958
...
...
@@ -531,6 +531,9 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
void
TRACK
::
DrawShortNetname
(
EDA_DRAW_PANEL
*
panel
,
wxDC
*
aDC
,
GR_DRAWMODE
aDrawMode
,
EDA_COLOR_T
aBgColor
)
{
if
(
!
panel
)
return
;
/* we must filter tracks, to avoid a lot of texts.
* - only tracks with a length > 10 * thickness are eligible
* and, of course, if we are not printing the board
...
...
@@ -594,6 +597,7 @@ void TRACK::DrawShortNetname( EDA_DRAW_PANEL* panel,
}
LAYER_ID
curr_layer
=
(
(
PCB_SCREEN
*
)
panel
->
GetScreen
()
)
->
m_Active_Layer
;
if
(
(
aDC
->
LogicalToDeviceXRel
(
tsize
)
>=
MIN_TEXT_SIZE
)
&&
(
!
(
!
IsOnLayer
(
curr_layer
)
&&
displ_opts
->
m_ContrastModeDisplay
)
)
)
{
...
...
@@ -601,8 +605,7 @@ void TRACK::DrawShortNetname( EDA_DRAW_PANEL* panel,
GRSetDrawMode
(
aDC
,
GR_COPY
);
tsize
=
(
tsize
*
7
)
/
10
;
// small reduction to give a better look
EDA_RECT
*
clipbox
=
panel
?
panel
->
GetClipBox
()
:
NULL
;
DrawGraphicHaloText
(
clipbox
,
aDC
,
tpos
,
DrawGraphicHaloText
(
panel
->
GetClipBox
(),
aDC
,
tpos
,
aBgColor
,
BLACK
,
WHITE
,
net
->
GetShortNetname
(),
angle
,
wxSize
(
tsize
,
tsize
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
...
...
pcbnew/collectors.cpp
View file @
4def0958
...
...
@@ -421,7 +421,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
* follows layer visibility controls (but that was already
* checked) */
if
(
via
||
module
||
pad
||
m_Guide
->
IsLayerVisible
(
layer
)
if
(
via
||
module
||
pad
||
m_Guide
->
IsLayerVisible
(
layer
)
||
!
m_Guide
->
IgnoreNonVisibleLayers
()
)
{
if
(
!
m_Guide
->
IsLayerLocked
(
layer
)
||
!
m_Guide
->
IgnoreLockedLayers
()
)
...
...
@@ -466,7 +466,7 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
SetTimeNow
();
// when snapshot was taken
// record the length of the primary list before concat
o
nating on to it.
// record the length of the primary list before concat
e
nating on to it.
m_PrimaryLength
=
m_List
.
size
();
// append 2nd list onto end of the first list
...
...
pcbnew/collectors.h
View file @
4def0958
...
...
@@ -228,7 +228,7 @@ protected:
/**
* The number of items that were originally in the primary list before the
* m_List2nd was concat
o
nated onto the end of it.
* m_List2nd was concat
e
nated onto the end of it.
*/
int
m_PrimaryLength
;
...
...
pcbnew/connect.h
View file @
4def0958
...
...
@@ -107,7 +107,7 @@ public:
/**
* Function BuildPadsList
* Fills m_sortedPads with all pads that be connected to tracks
* pads are sorted by
>
then Y coordinates to allow fast binary search in list
* pads are sorted by
X
then Y coordinates to allow fast binary search in list
* @param aNetcode = net code to use to filter pads
* if aNetcode < 0, all pads will be put in list (default)
*/
...
...
pcbnew/tools/pcbnew_control.h
View file @
4def0958
...
...
@@ -86,7 +86,7 @@ private:
///> Sets up handlers for various events.
void
setTransitions
();
///> Pointerto the currently used edit frame.
///> Pointer
to the currently used edit frame.
PCB_BASE_FRAME
*
m_frame
;
};
...
...
pcbnew/tools/selection_tool.h
View file @
4def0958
...
...
@@ -225,7 +225,7 @@ private:
void
setTransitions
();
/**
* Function
C
learSelection()
* Function
c
learSelection()
* Clears the current selection.
*/
void
clearSelection
();
...
...
@@ -264,7 +264,7 @@ private:
bool
selectable
(
const
BOARD_ITEM
*
aItem
)
const
;
/**
* Function select
Item
()
* Function select()
* Takes necessary action mark an item as selected.
*
* @param aItem is an item to be selected.
...
...
@@ -272,7 +272,7 @@ private:
void
select
(
BOARD_ITEM
*
aItem
);
/**
* Function unselect
Item
()
* Function unselect()
* Takes necessary action mark an item as unselected.
*
* @param aItem is an item to be unselected.
...
...
@@ -280,7 +280,7 @@ private:
void
unselect
(
BOARD_ITEM
*
aItem
);
/**
* Function
un
selectVisually()
* Function selectVisually()
* Marks item as selected, but does not add it to the ITEMS_PICKED_LIST.
* @param aItem is an item to be be marked.
*/
...
...
@@ -294,7 +294,7 @@ private:
void
unselectVisually
(
BOARD_ITEM
*
aItem
)
const
;
/**
* Function
containsSelected
()
* Function
selectionContains
()
* Checks if the given point is placed within any of selected items' bounding box.
*
* @return True if the given point is contained in any of selected items' bouding box.
...
...
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