summaryrefslogtreecommitdiff
path: root/src/script/api/squirrel_export.awk
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/squirrel_export.awk')
-rw-r--r--src/script/api/squirrel_export.awk6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/squirrel_export.awk b/src/script/api/squirrel_export.awk
index ef0a74c8d..a2782721c 100644
--- a/src/script/api/squirrel_export.awk
+++ b/src/script/api/squirrel_export.awk
@@ -34,7 +34,7 @@ function dump_class_templates(name)
print " template <> inline const " name " *GetParam(ForceType<const " name " *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (" name " *)instance; }" CR
print " template <> inline const " name " &GetParam(ForceType<const " name " &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(" name " *)instance; }" CR
if (name == "ScriptEvent") {
- print " template <> inline int Return<" name " *>(HSQUIRRELVM vm, " name " *res) { if (res == NULL) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"" realname "\", res, NULL, DefSQDestructorCallback<" name ">, true); return 1; }" CR
+ print " template <> inline int Return<" name " *>(HSQUIRRELVM vm, " name " *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, \"" realname "\", res, nullptr, DefSQDestructorCallback<" name ">, true); return 1; }" CR
} else if (name == "ScriptText") {
print "" CR
print " template <> inline Text *GetParam(ForceType<Text *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) {" CR
@@ -44,10 +44,10 @@ function dump_class_templates(name)
print " if (sq_gettype(vm, index) == OT_STRING) {" CR
print " return new RawText(GetParam(ForceType<const char *>(), vm, index, ptr));" CR
print " }" CR
- print " return NULL;" CR
+ print " return nullptr;" CR
print " }" CR
} else {
- print " template <> inline int Return<" name " *>(HSQUIRRELVM vm, " name " *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"" realname "\", res, NULL, DefSQDestructorCallback<" name ">, true); return 1; }" CR
+ print " template <> inline int Return<" name " *>(HSQUIRRELVM vm, " name " *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, \"" realname "\", res, nullptr, DefSQDestructorCallback<" name ">, true); return 1; }" CR
}
}