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
7de4bfe6
Commit
7de4bfe6
authored
Dec 02, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes
parent
bcbcdebf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
4 deletions
+44
-4
dlist.cpp
common/dlist.cpp
+40
-3
dlist.h
include/dlist.h
+4
-1
No files found.
common/dlist.cpp
View file @
7de4bfe6
...
@@ -135,7 +135,7 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
...
@@ -135,7 +135,7 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
{
{
aElement
->
Next
()
->
SetBack
(
aElement
->
Back
()
);
aElement
->
Next
()
->
SetBack
(
aElement
->
Back
()
);
}
}
else
else
// element being removed is last
{
{
wxASSERT
(
last
==
aElement
);
wxASSERT
(
last
==
aElement
);
last
=
aElement
->
Back
();
last
=
aElement
->
Back
();
...
@@ -143,9 +143,9 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
...
@@ -143,9 +143,9 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
if
(
aElement
->
Back
()
)
if
(
aElement
->
Back
()
)
{
{
aElement
->
Back
()
->
SetNext
(
aElement
->
Back
()
);
aElement
->
Back
()
->
SetNext
(
aElement
->
Next
()
);
}
}
else
else
// element being removed is first
{
{
wxASSERT
(
first
==
aElement
);
wxASSERT
(
first
==
aElement
);
first
=
aElement
->
Next
();
first
=
aElement
->
Next
();
...
@@ -156,5 +156,42 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
...
@@ -156,5 +156,42 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
aElement
->
SetList
(
0
);
aElement
->
SetList
(
0
);
--
count
;
--
count
;
D
(
VerifyListIntegrity
();
);
}
}
#if defined(DEBUG)
void
DHEAD
::
VerifyListIntegrity
()
{
EDA_BaseStruct
*
item
;
unsigned
i
=
0
;
for
(
item
=
first
;
item
&&
i
<
count
;
++
i
,
item
=
item
->
Next
()
)
{
if
(
i
<
count
-
1
)
{
wxASSERT
(
item
->
Next
()
);
}
wxASSERT
(
item
->
GetList
()
==
this
);
}
wxASSERT
(
item
==
NULL
);
wxASSERT
(
i
==
count
);
i
=
0
;
for
(
item
=
last
;
item
&&
i
<
count
;
++
i
,
item
=
item
->
Back
()
)
{
if
(
i
<
count
-
1
)
{
wxASSERT
(
item
->
Back
()
);
}
}
wxASSERT
(
item
==
NULL
);
wxASSERT
(
i
==
count
);
}
#endif
include/dlist.h
View file @
7de4bfe6
...
@@ -108,6 +108,10 @@ public:
...
@@ -108,6 +108,10 @@ public:
* returns the number of elements in the list.
* returns the number of elements in the list.
*/
*/
unsigned
GetCount
()
{
return
count
;
}
unsigned
GetCount
()
{
return
count
;
}
#if defined(DEBUG)
void
VerifyListIntegrity
();
#endif
};
};
...
@@ -179,7 +183,6 @@ public:
...
@@ -179,7 +183,6 @@ public:
return
aElement
;
return
aElement
;
}
}
//-----< STL like functions >---------------------------------------
//-----< STL like functions >---------------------------------------
T
*
begin
()
const
{
return
GetFirst
();
}
T
*
begin
()
const
{
return
GetFirst
();
}
T
*
end
()
const
{
return
NULL
;
}
T
*
end
()
const
{
return
NULL
;
}
...
...
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