Index: ppapi/generators/idl_c_proto.py |
diff --git a/ppapi/generators/idl_c_proto.py b/ppapi/generators/idl_c_proto.py |
index a6179a8f4b677fde965621e9721bb05a767b8435..d029f93d04d795d32aad8b7fe4d71add1eb2266c 100755 |
--- a/ppapi/generators/idl_c_proto.py |
+++ b/ppapi/generators/idl_c_proto.py |
@@ -384,6 +384,13 @@ class CGen(object): |
# Generate passing type by modifying root type |
rtype = self.GetTypeByMode(node, release, mode) |
+ # If this is an array output, change it from type* foo[] to type** foo. |
+ # type* foo[] means an array of pointers to type, which is confusing. |
Justin Chuang
2014/08/19 17:31:13
nit: optionally elaborate more like this:
Functio
dmichael (off chromium)
2014/08/19 21:43:21
I don't mean to come off as harsh, but I'm not sur
|
+ arrayspec = [self.GetArraySpec(array) for array in node.GetListOf('Array')] |
+ if mode == 'out' and len(arrayspec) == 1 and arrayspec[0] == '[]': |
+ rtype += '*' |
+ del arrayspec[0] |
+ |
if node.IsA('Enum', 'Interface', 'Struct'): |
rname = node.GetName() |
else: |
@@ -394,7 +401,6 @@ class CGen(object): |
if '%' in rtype: |
rtype = rtype % rname |
name = node.GetName() |
- arrayspec = [self.GetArraySpec(array) for array in node.GetListOf('Array')] |
callnode = node.GetOneOf('Callspec') |
if callnode: |
callspec = [] |