1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 17:32:45 +01:00

Codechange: move casting a "const char *" to "char *" to the caller

It is not nice to have your definition say you won't change a value
while in fact the whole reason for your existance is to change it.
This commit is contained in:
Patric Stout
2021-05-29 15:18:51 +02:00
committed by Patric Stout
parent 665e3c1f45
commit 7713c3e3cc
5 changed files with 9 additions and 9 deletions

View File

@@ -448,7 +448,7 @@ bool Squirrel::CallStringMethodStrdup(HSQOBJECT instance, const char *method_nam
if (!this->CallMethod(instance, method_name, &ret, suspend)) return false;
if (ret._type != OT_STRING) return false;
*res = stredup(ObjectToString(&ret));
StrMakeValidInPlace(*res);
StrMakeValidInPlace(const_cast<char *>(*res));
return true;
}