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:

committed by
Patric Stout

parent
665e3c1f45
commit
7713c3e3cc
@@ -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);
|
||||
|
Reference in New Issue
Block a user