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

@@ -157,7 +157,7 @@ SQInteger ScriptText::_set(HSQUIRRELVM vm)
if (sq_gettype(vm, 2) == OT_STRING) {
const SQChar *key_string;
sq_getstring(vm, 2, &key_string);
StrMakeValidInPlace(key_string);
StrMakeValidInPlace(const_cast<char *>(key_string));
if (strncmp(key_string, "param_", 6) != 0 || strlen(key_string) > 8) return SQ_ERROR;
k = atoi(key_string + 6);