Merge branch 'master' into jgrpp-beta

# Conflicts:
#	src/company_cmd.cpp
#	src/economy.cpp
#	src/lang/swedish.txt
#	src/network/network_command.cpp
#	src/news_gui.cpp
#	src/saveload/saveload.h
#	src/script/api/script_list.cpp
#	src/video/cocoa/cocoa_v.mm
#	src/video/sdl2_v.cpp
This commit is contained in:
Jonathan G Rennison
2021-11-01 18:54:43 +00:00
78 changed files with 539 additions and 389 deletions

View File

@@ -468,7 +468,7 @@ int64 ScriptList::Begin()
int64 ScriptList::Next()
{
if (this->initialized == false) {
if (!this->initialized) {
DEBUG(script, 0, "Next() is invalid as Begin() is never called");
return 0;
}
@@ -482,7 +482,7 @@ bool ScriptList::IsEmpty()
bool ScriptList::IsEnd()
{
if (this->initialized == false) {
if (!this->initialized) {
DEBUG(script, 0, "IsEnd() is invalid as Begin() is never called");
return true;
}

View File

@@ -109,7 +109,7 @@ SQInteger ScriptText::_SetParam(int parameter, HSQUIRRELVM vm)
sq_pop(vm, 3);
/* Get the 'real' instance of this class */
sq_getinstanceup(vm, -1, &real_instance, 0);
sq_getinstanceup(vm, -1, &real_instance, nullptr);
if (real_instance == nullptr) return SQ_ERROR;
ScriptText *value = static_cast<ScriptText *>(real_instance);

View File

@@ -273,7 +273,7 @@ void Squirrel::RunError(HSQUIRRELVM vm, const SQChar *error)
SQInteger Squirrel::_RunError(HSQUIRRELVM vm)
{
const SQChar *sErr = 0;
const SQChar *sErr = nullptr;
if (sq_gettop(vm) >= 1) {
if (SQ_SUCCEEDED(sq_getstring(vm, -1, &sErr))) {

View File

@@ -190,7 +190,7 @@ public:
* @note This will only work just after a function-call from within Squirrel
* to your C++ function.
*/
static bool GetRealInstance(HSQUIRRELVM vm, SQUserPointer *ptr) { return SQ_SUCCEEDED(sq_getinstanceup(vm, 1, ptr, 0)); }
static bool GetRealInstance(HSQUIRRELVM vm, SQUserPointer *ptr) { return SQ_SUCCEEDED(sq_getinstanceup(vm, 1, ptr, nullptr)); }
/**
* Get the Squirrel-instance pointer.

View File

@@ -754,9 +754,9 @@ namespace SQConvert {
sq_pop(vm, 3);
/* Get the 'real' instance of this class */
sq_getinstanceup(vm, 1, &real_instance, 0);
sq_getinstanceup(vm, 1, &real_instance, nullptr);
/* Get the real function pointer */
sq_getuserdata(vm, nparam, &ptr, 0);
sq_getuserdata(vm, nparam, &ptr, nullptr);
if (real_instance == nullptr) return sq_throwerror(vm, "couldn't detect real instance of class for non-static call");
/* Remove the userdata from the stack */
sq_pop(vm, 1);
@@ -796,9 +796,9 @@ namespace SQConvert {
sq_pop(vm, 3);
/* Get the 'real' instance of this class */
sq_getinstanceup(vm, 1, &real_instance, 0);
sq_getinstanceup(vm, 1, &real_instance, nullptr);
/* Get the real function pointer */
sq_getuserdata(vm, nparam, &ptr, 0);
sq_getuserdata(vm, nparam, &ptr, nullptr);
if (real_instance == nullptr) return sq_throwerror(vm, "couldn't detect real instance of class for non-static call");
/* Remove the userdata from the stack */
sq_pop(vm, 1);
@@ -820,7 +820,7 @@ namespace SQConvert {
SQUserPointer ptr = nullptr;
/* Get the real function pointer */
sq_getuserdata(vm, nparam, &ptr, 0);
sq_getuserdata(vm, nparam, &ptr, nullptr);
try {
/* Delegate it to a template that can handle this specific function */
@@ -844,7 +844,7 @@ namespace SQConvert {
SQUserPointer ptr = nullptr;
/* Get the real function pointer */
sq_getuserdata(vm, nparam, &ptr, 0);
sq_getuserdata(vm, nparam, &ptr, nullptr);
/* Remove the userdata from the stack */
sq_pop(vm, 1);