зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1323468, part 4 - inline |from| in Transition. r=kanru
MozReview-Commit-ID: LwcpNikbe2b --HG-- extra : rebase_source : 25ace3d2f3e408ca48c72f6e8ea11217990a6f12
This commit is contained in:
Родитель
d0dc5ef0a4
Коммит
f27d72c33d
|
@ -1665,7 +1665,6 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
|||
|
||||
# bool Transition(MessageType msg, State* next)
|
||||
# The state we are transitioning from is stored in *next.
|
||||
fromvar = ExprVar('from')
|
||||
msgtypevar = ExprVar('msg')
|
||||
nextvar = ExprVar('next')
|
||||
|
||||
|
@ -1675,7 +1674,7 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
|||
Decl(Type('State', ptr=1), nextvar.name) ],
|
||||
ret=Type.VOID))
|
||||
|
||||
fromswitch = StmtSwitch(fromvar)
|
||||
fromswitch = StmtSwitch(ExprDeref(nextvar))
|
||||
|
||||
# special case for Null
|
||||
nullerrorblock = Block()
|
||||
|
@ -1714,8 +1713,6 @@ class _GenerateProtocolCode(ipdl.ast.Visitor):
|
|||
StmtBreak() ])
|
||||
fromswitch.addcase(DefaultLabel(), unreachedblock)
|
||||
|
||||
transitionfunc.addstmt(StmtDecl(Decl(Type('State'), fromvar.name),
|
||||
init=ExprDeref(nextvar)))
|
||||
transitionfunc.addstmt(fromswitch)
|
||||
|
||||
return transitionfunc
|
||||
|
|
Загрузка…
Ссылка в новой задаче