mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1223142 - make XPIDL set default nullptrs for optional out parameters, r=bz
This commit is contained in:
parent
8300e7517f
commit
bd81dcbb9c
@ -111,6 +111,19 @@ def paramlistAsNative(m, empty='void'):
|
||||
location=None,
|
||||
realtype=m.realtype)))
|
||||
|
||||
# Set any optional out params to default to nullptr. Skip if we just added
|
||||
# extra non-optional args to l.
|
||||
if len(l) == len(m.params):
|
||||
paramIter = len(m.params) - 1
|
||||
while (paramIter >= 0 and m.params[paramIter].optional and
|
||||
m.params[paramIter].paramtype == "out"):
|
||||
t = m.params[paramIter].type
|
||||
# Strings can't be optional, so this shouldn't happen, but let's make sure:
|
||||
if t == "AString" or t == "ACString" or t == "DOMString" or t == "AUTF8String":
|
||||
break
|
||||
l[paramIter] += " = nullptr"
|
||||
paramIter -= 1
|
||||
|
||||
if len(l) == 0:
|
||||
return empty
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user