diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk --- a/src/ai/api/squirrel_export.awk +++ b/src/ai/api/squirrel_export.awk @@ -13,7 +13,8 @@ # # Simple insertion sort. -function array_sort(ARRAY, ELEMENTS, temp, i, j) { +function array_sort(ARRAY, ELEMENTS, temp, i, j) +{ for (i = 2; i <= ELEMENTS; i++) for (j = i; ARRAY[j - 1] > ARRAY[j]; --j) { temp = ARRAY[j] @@ -23,7 +24,8 @@ function array_sort(ARRAY, ELEMENTS, tem return } -function dump_class_templates(name) { +function dump_class_templates(name) +{ print " template <> " name " *GetParam(ForceType<" name " *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (" name " *)instance; }" print " template <> " name " &GetParam(ForceType<" name " &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(" name " *)instance; }" print " template <> const " name " *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (" name " *)instance; }"