1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

Move to Qt5 and Qt5Multimedia

This commit is contained in:
Bertrand Songis 2015-08-09 22:32:17 +02:00
parent d7a9710a9c
commit aec2170e7e
98 changed files with 355 additions and 438 deletions

View file

@ -1,5 +1,7 @@
#!/usr/bin/env python
from __future__ import print_function
import sys
import clang.cindex
@ -7,21 +9,21 @@ structs = []
def build_struct(cursor):
structs.append(cursor.spelling)
print "template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % cursor.spelling
print("template <class A, class B>\nvoid copy%s(A * dest, B * src)\n{" % cursor.spelling)
for c in cursor.get_children():
if c.kind == clang.cindex.CursorKind.FIELD_DECL:
if c.type.get_array_size() > 0:
if c.type.get_array_element_type().spelling in structs:
print " for (int i=0; i<%d; i++) {" % c.type.get_array_size()
print " copy%s(&dest->%s[i], &src->%s[i]);" % (c.type.get_array_element_type().spelling, c.spelling, c.spelling)
print " }"
print(" for (int i=0; i<%d; i++) {" % c.type.get_array_size())
print(" copy%s(&dest->%s[i], &src->%s[i]);" % (c.type.get_array_element_type().spelling, c.spelling, c.spelling))
print(" }")
else:
print " memcpy(&dest->%s, &src->%s, sizeof(dest->%s));" % (c.spelling, c.spelling, c.spelling)
print(" memcpy(&dest->%s, &src->%s, sizeof(dest->%s));" % (c.spelling, c.spelling, c.spelling))
elif c.type.get_declaration().spelling in structs:
print " copy%s(&dest->%s, &src->%s);" % (c.type.get_declaration().spelling, c.spelling, c.spelling)
print(" copy%s(&dest->%s, &src->%s);" % (c.type.get_declaration().spelling, c.spelling, c.spelling))
else:
print " dest->%s = src->%s;" % (c.spelling, c.spelling)
print "}\n"
print(" dest->%s = src->%s;" % (c.spelling, c.spelling))
print("}\n")
def build(cursor):
result = []