Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: ppapi/generators/idl_c_proto.py

Issue 9338006: PPAPI IDL -> C Generator: inout parameter should not be a pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ Generator for C style prototypes and definitions """ 6 """ Generator for C style prototypes and definitions """
7 7
8 import glob 8 import glob
9 import os 9 import os
10 import sys 10 import sys
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 class CGen(object): 69 class CGen(object):
70 # TypeMap 70 # TypeMap
71 # 71 #
72 # TypeMap modifies how an object is stored or passed, for example pointers 72 # TypeMap modifies how an object is stored or passed, for example pointers
73 # are passed as 'const' if they are 'in' parameters, and structures are 73 # are passed as 'const' if they are 'in' parameters, and structures are
74 # preceeded by the keyword 'struct' as well as using a pointer. 74 # preceeded by the keyword 'struct' as well as using a pointer.
75 # 75 #
76 TypeMap = { 76 TypeMap = {
77 'Array': { 77 'Array': {
78 'in': 'const %s', 78 'in': 'const %s',
79 'inout': '%s*', 79 'inout': '%s',
80 'out': '%s*', 80 'out': '%s*',
81 'store': '%s', 81 'store': '%s',
82 'return': '%s' 82 'return': '%s'
83 }, 83 },
84 'Callspec': { 84 'Callspec': {
85 'in': '%s', 85 'in': '%s',
86 'inout': '%s', 86 'inout': '%s',
87 'out': '%s', 87 'out': '%s',
88 'store': '%s', 88 'store': '%s',
89 'return': '%s' 89 'return': '%s'
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 print 'Skipping %s' % f.GetName() 651 print 'Skipping %s' % f.GetName()
652 continue 652 continue
653 print DefineDepends(node) 653 print DefineDepends(node)
654 for node in f.GetChildren()[2:]: 654 for node in f.GetChildren()[2:]:
655 print Define(node, comment=True, prefix='tst_') 655 print Define(node, comment=True, prefix='tst_')
656 656
657 657
658 if __name__ == '__main__': 658 if __name__ == '__main__':
659 sys.exit(Main(sys.argv[1:])) 659 sys.exit(Main(sys.argv[1:]))
660 660
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698