print
print 'static inline struct buffer_mapping *'
print 'get_buffer_mapping(GLenum target) {'
- print ' switch(target) {'
+ print ' switch (target) {'
for target in self.buffer_targets:
print ' case GL_%s:' % target
print ' return & __%s_mapping;' % target.lower()
# refers to a symbolic value or not
print 'static bool'
print 'is_symbolic_pname(GLenum pname) {'
- print ' switch(pname) {'
+ print ' switch (pname) {'
for function, type, count, name in glparams.parameters:
if type is glapi.GLenum:
print ' case %s:' % name
# Generate a helper function to know how many elements a parameter has
print 'static size_t'
print '__gl_param_size(GLenum pname) {'
- print ' switch(pname) {'
+ print ' switch (pname) {'
for function, type, count, name in glparams.parameters:
if type is not None:
print ' case %s: return %u;' % (name, count)
binding_name = 'GL_%s_ARRAY_BUFFER_BINDING' % uppercase_name
function = api.get_function_by_name(function_name)
- print ' // %s' % function.name
+ print ' // %s' % function.prototype()
self.array_trace_prolog(api, uppercase_name)
self.array_prolog(api, uppercase_name)
print ' if (__glIsEnabled(%s)) {' % enable_name
else:
SUFFIX = suffix
function_name = 'glVertexAttribPointer' + suffix
- print ' // %s' % function_name
+ function = api.get_function_by_name(function_name)
+
+ print ' // %s' % function.prototype()
print ' if (__vertex_attrib == VERTEX_ATTRIB%s) {' % SUFFIX
if suffix == 'NV':
print ' GLint __max_vertex_attribs = 16;'
print ' __glGetVertexAttribiv%s(index, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING%s, &__binding);' % (suffix, SUFFIX)
print ' if (!__binding) {'
- function = api.get_function_by_name(function_name)
-
# Get the arguments via glGet*
for arg in function.args[1:]:
if suffix == 'NV':
def visit_struct(self, struct):
for type, name in struct.members:
self.visit(type)
- print 'static void __traceStruct%s(const %s &value) {' % (struct.tag, struct.expr)
+ print 'static void _write__%s(const %s &value) {' % (struct.tag, struct.expr)
print ' static const char * members[%u] = {' % (len(struct.members),)
for type, name, in struct.members:
print ' "%s",' % (name,)
__enum_id = 0
def visit_enum(self, enum):
- print 'static void __traceEnum%s(const %s value) {' % (enum.tag, enum.expr)
+ print 'static void _write__%s(const %s value) {' % (enum.tag, enum.expr)
n = len(enum.values)
for i in range(n):
value = enum.values[i]
print ' static const Trace::EnumSig sig%u = {%u, "%s", %s};' % (i, DumpDeclarator.__enum_id, value, value)
DumpDeclarator.__enum_id += 1
print ' const Trace::EnumSig *sig;'
- print ' switch(value) {'
+ print ' switch (value) {'
for i in range(n):
value = enum.values[i]
print ' case %s:' % value
print
def visit_polymorphic(self, polymorphic):
- print 'static void __tracePolymorphic%s(int selector, const %s & value) {' % (polymorphic.tag, polymorphic.expr)
+ print 'static void _write__%s(int selector, const %s & value) {' % (polymorphic.tag, polymorphic.expr)
print ' switch (selector) {'
for cases, type in polymorphic.iterswitch():
for case in cases:
self.visit(const.type, instance)
def visit_struct(self, struct, instance):
- print ' __traceStruct%s(%s);' % (struct.tag, instance)
+ print ' _write__%s(%s);' % (struct.tag, instance)
def visit_array(self, array, instance):
length = '__c' + array.type.tag
print ' Trace::localWriter.writeBlob(%s, %s);' % (instance, blob.size)
def visit_enum(self, enum, instance):
- print ' __traceEnum%s(%s);' % (enum.tag, instance)
+ print ' _write__%s(%s);' % (enum.tag, instance)
def visit_bitmask(self, bitmask, instance):
print ' Trace::localWriter.writeBitmask(&__bitmask%s_sig, %s);' % (bitmask.tag, instance)
print ' Trace::localWriter.writeOpaque((const void *)&%s);' % instance
def visit_polymorphic(self, polymorphic, instance):
- print ' __tracePolymorphic%s(%s, %s);' % (polymorphic.tag, polymorphic.switch_expr, instance)
+ print ' _write__%s(%s, %s);' % (polymorphic.tag, polymorphic.switch_expr, instance)
dump_instance = DumpImplementer().visit