X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Ftrace.py;h=aab99d793c1ce433bf6ad19d97d7afd89bfbac15;hb=1242ab5cbdc409e2fc2d787edc28c6ac2a8439d1;hp=c838dc78a83df0e8e61190b1f30ef774b20e5ba8;hpb=ba2f08cfdfbc4e48960ac7b1709928fff1e344ae;p=apitrace diff --git a/wrappers/trace.py b/wrappers/trace.py index c838dc7..aab99d7 100644 --- a/wrappers/trace.py +++ b/wrappers/trace.py @@ -187,7 +187,7 @@ class ValueSerializer(stdapi.Visitor): length = '_c' + array.type.tag index = '_i' + array.type.tag print ' if (%s) {' % instance - print ' size_t %s = %s;' % (length, array.length) + print ' size_t %s = %s > 0 ? %s : 0;' % (length, array.length, array.length) print ' trace::localWriter.beginArray(%s);' % length print ' for (size_t %s = 0; %s < %s; ++%s) {' % (index, index, length, index) print ' trace::localWriter.beginElement();' @@ -422,6 +422,14 @@ class Tracer: print function.prototype() + ' {' if function.type is not stdapi.Void: print ' %s _result;' % function.type + print ' if (!os::apitrace_enabled()) {' + Tracer.invokeFunction(self, function) + if function.type is not stdapi.Void: + print ' return _result;' + else: + print ' return;' + print ' }' + print self.traceFunctionImplBody(function) if function.type is not stdapi.Void: print ' return _result;'