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
87aa22f1
Commit
87aa22f1
authored
Mar 19, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quiet warnings, add Clamp()
parent
b5cac30a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
11 deletions
+29
-11
fctsys.h
include/fctsys.h
+22
-3
files-io.cpp
kicad/files-io.cpp
+1
-1
dialog_pad_properties.cpp
pcbnew/dialogs/dialog_pad_properties.cpp
+6
-7
No files found.
include/fctsys.h
View file @
87aa22f1
/********************/
/* System includes. */
/********************/
#ifndef FCTSYS_H
#define FCTSYS_H
#ifndef FCTSYS_H
_
#define FCTSYS_H
_
// For compilers that support precompilation, includes "wx.h".
#include <wx/wxprec.h>
...
...
@@ -46,6 +46,25 @@
#define D(x) // nothing
#endif
/**
* Function Clamp
* limits @a value within the range @a lower <= @a value <= @a upper. It will work
* on temporary expressions, since they are evaluated only once, and it should work
* on most if not all numeric types. The arguments are accepted in this order so you
* can remember the expression as a memory aid:
* <p>
* result is: lower <= value <= upper
*/
template
<
typename
T
>
inline
const
T
&
Clamp
(
const
T
&
lower
,
const
T
&
value
,
const
T
&
upper
)
{
wxASSERT
(
lower
<=
upper
);
if
(
value
<
lower
)
return
lower
;
else
if
(
value
>
upper
)
return
upper
;
return
value
;
}
#define UNIX_STRING_DIR_SEP wxT( "/" )
#define WIN_STRING_DIR_SEP wxT( "\\" )
...
...
@@ -64,4 +83,4 @@
#include <config.h>
#endif
/
* FCTSYS_H */
#endif /
/ FCTSYS_H__
kicad/files-io.cpp
View file @
87aa22f1
...
...
@@ -171,7 +171,7 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event )
infile
->
GetStream
()
->
GetSize
(),
zippedsize
);
PrintMsg
(
msg
);
delete
infile
;
}
}
else
{
PrintMsg
(
_
(
" >>Error
\n
"
)
);
...
...
pcbnew/dialogs/dialog_pad_properties.cpp
View file @
87aa22f1
...
...
@@ -438,7 +438,7 @@ void DIALOG_PAD_PROPERTIES::initValues()
// Type of pad selection
m_PadType
->
SetSelection
(
0
);
for
(
int
ii
=
0
;
ii
<
NBTYPES
;
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
NBTYPES
;
ii
++
)
{
if
(
CodeType
[
ii
]
==
m_dummyPad
->
GetAttribute
()
)
{
...
...
@@ -573,11 +573,10 @@ void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event )
void
DIALOG_PAD_PROPERTIES
::
PadTypeSelected
(
wxCommandEvent
&
event
)
{
long
layer_mask
;
int
ii
;
long
layer_mask
;
unsigned
ii
=
m_PadType
->
GetSelection
()
;
ii
=
m_PadType
->
GetSelection
();
if
(
ii
<
0
||
ii
>=
NBTYPES
)
if
(
ii
>=
NBTYPES
)
// catches < 0 also
ii
=
0
;
layer_mask
=
Std_Pad_Layers
[
ii
];
...
...
@@ -603,11 +602,11 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event )
void
DIALOG_PAD_PROPERTIES
::
SetPadLayersList
(
long
layer_mask
)
{
if
(
(
layer_mask
&
ALL_CU_LAYERS
)
==
LAYER_FRONT
)
if
(
(
layer_mask
&
ALL_CU_LAYERS
)
==
LAYER_FRONT
)
m_rbCopperLayersSel
->
SetSelection
(
0
);
else
if
(
(
layer_mask
&
ALL_CU_LAYERS
)
==
LAYER_BACK
)
m_rbCopperLayersSel
->
SetSelection
(
1
);
else
if
(
(
layer_mask
&
ALL_CU_LAYERS
)
!=
0
)
else
if
(
(
layer_mask
&
ALL_CU_LAYERS
)
!=
0
)
m_rbCopperLayersSel
->
SetSelection
(
2
);
else
m_rbCopperLayersSel
->
SetSelection
(
3
);
...
...
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