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
b7db108c
Commit
b7db108c
authored
Dec 28, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fix potential bug in connections calculations (see Bug #909298 ).
parent
1cb1e88e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
class_board.cpp
pcbnew/class_board.cpp
+4
-4
connect.cpp
pcbnew/connect.cpp
+8
-8
No files found.
pcbnew/class_board.cpp
View file @
b7db108c
...
...
@@ -1583,12 +1583,12 @@ D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, i
int
idxmax
=
aPadList
.
size
()
-
1
;
int
delta
=
aPadList
.
size
();
if
(
delta
&
1
&&
delta
>
1
)
delta
+=
1
;
delta
/=
2
;
int
idx
=
delta
;
// Starting index is the middle of list
int
idx
=
0
;
// Starting index is the beginning of list
while
(
delta
)
{
// Calculate half size of remaining interval to test.
// Ensure the computed value is not truncated (too small)
if
(
(
delta
&
1
)
&&
(
delta
>
1
)
)
delta
++
;
delta
/=
2
;
...
...
pcbnew/connect.cpp
View file @
b7db108c
...
...
@@ -342,12 +342,12 @@ void CONNECTIONS::CollectItemsNearTo( std::vector<CONNECTED_POINT*>& aList,
int
idxmax
=
m_candidates
.
size
()
-
1
;
int
delta
=
m_candidates
.
size
();
if
(
delta
&
1
&&
delta
>
1
)
delta
+=
1
;
delta
/=
2
;
int
idx
=
delta
;
// Starting index is the middle of list
int
idx
=
0
;
// Starting index is the beginning of list
while
(
delta
)
{
// Calculate half size of remaining interval to test.
// Ensure the computed value is not truncated (too small)
if
(
(
delta
&
1
)
&&
(
delta
>
1
)
)
delta
++
;
delta
/=
2
;
...
...
@@ -530,12 +530,12 @@ int CONNECTIONS::searchEntryPointInCandidatesList( const wxPoint & aPoint)
int
idxmax
=
m_candidates
.
size
()
-
1
;
int
delta
=
m_candidates
.
size
();
if
(
delta
&
1
&&
delta
>
1
)
delta
+=
1
;
delta
/=
2
;
int
idx
=
delta
;
// Starting index is the middle of list
int
idx
=
0
;
// Starting index is the beginning of list
while
(
delta
)
{
// Calculate half size of remaining interval to test.
// Ensure the computed value is not truncated (too small)
if
(
(
delta
&
1
)
&&
(
delta
>
1
)
)
delta
++
;
delta
/=
2
;
...
...
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