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
5f806cfa
Commit
5f806cfa
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes to the Tool Framework.
parent
f7ecc749
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
16 deletions
+15
-16
tool_manager.cpp
common/tool/tool_manager.cpp
+0
-2
coroutine.h
include/tool/coroutine.h
+15
-7
tool_event.h
include/tool/tool_event.h
+0
-4
tool_manager.h
include/tool/tool_manager.h
+0
-3
No files found.
common/tool/tool_manager.cpp
View file @
5f806cfa
...
...
@@ -470,8 +470,6 @@ void TOOL_MANAGER::finishTool( TOOL_STATE* aState )
bool
TOOL_MANAGER
::
ProcessEvent
(
TOOL_EVENT
&
aEvent
)
{
// wxLogDebug( "event: %s", aEvent.Format().c_str() );
// Early dispatch of events destined for the TOOL_MANAGER
if
(
!
dispatchStandardEvents
(
aEvent
)
)
return
false
;
...
...
include/tool/coroutine.h
View file @
5f806cfa
...
...
@@ -56,11 +56,10 @@ template <class ReturnType, class ArgType>
class
COROUTINE
{
public
:
COROUTINE
()
COROUTINE
()
:
m_saved
(
NULL
),
m_self
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
),
m_running
(
false
)
{
m_stackSize
=
c_defaultStackSize
;
m_stack
=
NULL
;
m_saved
=
NULL
;
}
/**
...
...
@@ -69,7 +68,8 @@ public:
*/
template
<
class
T
>
COROUTINE
(
T
*
object
,
ReturnType
(
T
::*
ptr
)(
ArgType
)
)
:
m_func
(
object
,
ptr
),
m_saved
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
)
m_func
(
object
,
ptr
),
m_self
(
NULL
),
m_saved
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
),
m_running
(
false
)
{
}
...
...
@@ -78,8 +78,10 @@ public:
* Creates a coroutine from a delegate object
*/
COROUTINE
(
DELEGATE
<
ReturnType
,
ArgType
>
aEntry
)
:
m_func
(
aEntry
),
m_saved
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
)
{};
m_func
(
aEntry
),
m_saved
(
NULL
),
m_self
(
NULL
),
m_stack
(
NULL
),
m_stackSize
(
c_defaultStackSize
),
m_running
(
false
)
{
}
~
COROUTINE
()
{
...
...
@@ -138,6 +140,12 @@ public:
// align to 16 bytes
void
*
sp
=
(
void
*
)
(
(
(
(
ptrdiff_t
)
m_stack
)
+
m_stackSize
-
0xf
)
&
(
~
0x0f
)
);
// correct the stack size
m_stackSize
-=
(
(
size_t
)
m_stack
+
m_stackSize
-
(
size_t
)
sp
);
assert
(
m_self
==
NULL
);
assert
(
m_saved
==
NULL
);
m_args
=
&
aArgs
;
m_self
=
boost
::
context
::
make_fcontext
(
sp
,
m_stackSize
,
callerStub
);
m_saved
=
new
boost
::
context
::
fcontext_t
();
...
...
include/tool/tool_event.h
View file @
5f806cfa
...
...
@@ -318,9 +318,6 @@ public:
if
(
m_commandId
&&
aEvent
.
m_commandId
)
return
*
m_commandId
==
*
aEvent
.
m_commandId
;
// Command-type event has to contain either id or string
assert
(
false
);
}
return
true
;
...
...
@@ -496,7 +493,6 @@ inline const TOOL_EVENT_LIST operator||( const TOOL_EVENT& aEventA, const TOOL_E
return
l
;
}
inline
const
TOOL_EVENT_LIST
operator
||
(
const
TOOL_EVENT
&
aEvent
,
const
TOOL_EVENT_LIST
&
aEventList
)
{
...
...
include/tool/tool_manager.h
View file @
5f806cfa
...
...
@@ -384,9 +384,6 @@ private:
/// Flag saying if the currently processed event should be passed to other tools.
bool
m_passEvent
;
/// Pointer to the tool on the top of the active tools stack.
TOOL_STATE
*
m_currentTool
;
};
#endif
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