# determine the array length which must be passed to writeArray() up front
count = '_c' + array.keyType.tag
# determine the array length which must be passed to writeArray() up front
count = '_c' + array.keyType.tag
print ' int %s;' % count
print ' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
% {'c': count, 'array': instance, 'terminator': array.terminator}
if array.hasKeysWithoutValues:
print ' int %s;' % count
print ' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \
% {'c': count, 'array': instance, 'terminator': array.terminator}
if array.hasKeysWithoutValues:
# write generic value the usual way
for key, valueType in array.valueTypes:
if valueType is not None:
# write generic value the usual way
for key, valueType in array.valueTypes:
if valueType is not None:
print ' default:'
print ' trace::localWriter.beginElement();'
print ' os::log("apitrace: warning: %s: unknown key 0x%04X, interpreting value as int\\n", ' + \
print ' default:'
print ' trace::localWriter.beginElement();'
print ' os::log("apitrace: warning: %s: unknown key 0x%04X, interpreting value as int\\n", ' + \
print ' trace::localWriter.writeSInt(%(array)s[%(i)s]);' % {'array': instance, 'i': index}
print ' trace::localWriter.endElement();'
print ' break;'
print ' }'
print ' }'
print ' trace::localWriter.endArray();'
print ' trace::localWriter.writeSInt(%(array)s[%(i)s]);' % {'array': instance, 'i': index}
print ' trace::localWriter.endElement();'
print ' break;'
print ' }'
print ' }'
print ' trace::localWriter.endArray();'