diff options
author | peter1138 <peter1138@openttd.org> | 2019-04-11 22:08:56 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-04-11 22:42:11 +0100 |
commit | 5bd2b15e863eaf54bfee4dfebb280d6884169354 (patch) | |
tree | bfbc83ead970d236ef828f1fedb24ea0578a05e7 /src/script/api/template/template_tilelist.hpp.sq | |
parent | c0836bccefb7fbc6ebc8c5fa28886602067070f8 (diff) | |
download | openttd-5bd2b15e863eaf54bfee4dfebb280d6884169354.tar.xz |
Codechange: Replace NULL with nullptr in squirrel interface.
Diffstat (limited to 'src/script/api/template/template_tilelist.hpp.sq')
-rw-r--r-- | src/script/api/template/template_tilelist.hpp.sq | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/api/template/template_tilelist.hpp.sq b/src/script/api/template/template_tilelist.hpp.sq index e3d73a7c8..989e6749e 100644 --- a/src/script/api/template/template_tilelist.hpp.sq +++ b/src/script/api/template/template_tilelist.hpp.sq @@ -17,7 +17,7 @@ namespace SQConvert { template <> inline ScriptTileList &GetParam(ForceType<ScriptTileList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList *)instance; } template <> inline const ScriptTileList *GetParam(ForceType<const ScriptTileList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTileList *)instance; } template <> inline const ScriptTileList &GetParam(ForceType<const ScriptTileList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList *)instance; } - template <> inline int Return<ScriptTileList *>(HSQUIRRELVM vm, ScriptTileList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList", res, NULL, DefSQDestructorCallback<ScriptTileList>, true); return 1; } + template <> inline int Return<ScriptTileList *>(HSQUIRRELVM vm, ScriptTileList *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList", res, nullptr, DefSQDestructorCallback<ScriptTileList>, true); return 1; } } // namespace SQConvert namespace SQConvert { @@ -26,7 +26,7 @@ namespace SQConvert { template <> inline ScriptTileList_IndustryAccepting &GetParam(ForceType<ScriptTileList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_IndustryAccepting *)instance; } template <> inline const ScriptTileList_IndustryAccepting *GetParam(ForceType<const ScriptTileList_IndustryAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTileList_IndustryAccepting *)instance; } template <> inline const ScriptTileList_IndustryAccepting &GetParam(ForceType<const ScriptTileList_IndustryAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_IndustryAccepting *)instance; } - template <> inline int Return<ScriptTileList_IndustryAccepting *>(HSQUIRRELVM vm, ScriptTileList_IndustryAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_IndustryAccepting", res, NULL, DefSQDestructorCallback<ScriptTileList_IndustryAccepting>, true); return 1; } + template <> inline int Return<ScriptTileList_IndustryAccepting *>(HSQUIRRELVM vm, ScriptTileList_IndustryAccepting *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_IndustryAccepting", res, nullptr, DefSQDestructorCallback<ScriptTileList_IndustryAccepting>, true); return 1; } } // namespace SQConvert namespace SQConvert { @@ -35,7 +35,7 @@ namespace SQConvert { template <> inline ScriptTileList_IndustryProducing &GetParam(ForceType<ScriptTileList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_IndustryProducing *)instance; } template <> inline const ScriptTileList_IndustryProducing *GetParam(ForceType<const ScriptTileList_IndustryProducing *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTileList_IndustryProducing *)instance; } template <> inline const ScriptTileList_IndustryProducing &GetParam(ForceType<const ScriptTileList_IndustryProducing &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_IndustryProducing *)instance; } - template <> inline int Return<ScriptTileList_IndustryProducing *>(HSQUIRRELVM vm, ScriptTileList_IndustryProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_IndustryProducing", res, NULL, DefSQDestructorCallback<ScriptTileList_IndustryProducing>, true); return 1; } + template <> inline int Return<ScriptTileList_IndustryProducing *>(HSQUIRRELVM vm, ScriptTileList_IndustryProducing *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_IndustryProducing", res, nullptr, DefSQDestructorCallback<ScriptTileList_IndustryProducing>, true); return 1; } } // namespace SQConvert namespace SQConvert { @@ -44,5 +44,5 @@ namespace SQConvert { template <> inline ScriptTileList_StationType &GetParam(ForceType<ScriptTileList_StationType &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_StationType *)instance; } template <> inline const ScriptTileList_StationType *GetParam(ForceType<const ScriptTileList_StationType *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptTileList_StationType *)instance; } template <> inline const ScriptTileList_StationType &GetParam(ForceType<const ScriptTileList_StationType &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptTileList_StationType *)instance; } - template <> inline int Return<ScriptTileList_StationType *>(HSQUIRRELVM vm, ScriptTileList_StationType *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_StationType", res, NULL, DefSQDestructorCallback<ScriptTileList_StationType>, true); return 1; } + template <> inline int Return<ScriptTileList_StationType *>(HSQUIRRELVM vm, ScriptTileList_StationType *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "TileList_StationType", res, nullptr, DefSQDestructorCallback<ScriptTileList_StationType>, true); return 1; } } // namespace SQConvert |