add GetChars() accessors to many FString uses where const char* is wanted.

By no means complete, it's just a start to get rid of that automatic type conversion operator.
This commit is contained in:
Christoph Oelckers 2023-10-03 14:27:13 +02:00
commit 1717ff47b2
28 changed files with 92 additions and 97 deletions

View file

@ -1394,7 +1394,7 @@ FxExpression *FxColorCast::Resolve(FCompileContext &ctx)
}
else
{
FxExpression *x = new FxConstant(V_GetColor(constval.GetString(), &ScriptPosition), ScriptPosition);
FxExpression *x = new FxConstant(V_GetColor(constval.GetString().GetChars(), &ScriptPosition), ScriptPosition);
delete this;
return x;
}
@ -1474,7 +1474,7 @@ FxExpression *FxSoundCast::Resolve(FCompileContext &ctx)
if (basex->isConstant())
{
ExpVal constval = static_cast<FxConstant *>(basex)->GetValue();
FxExpression *x = new FxConstant(S_FindSound(constval.GetString()), ScriptPosition);
FxExpression *x = new FxConstant(S_FindSound(constval.GetString().GetChars()), ScriptPosition);
delete this;
return x;
}
@ -1552,7 +1552,7 @@ FxExpression *FxFontCast::Resolve(FCompileContext &ctx)
else if ((basex->ValueType == TypeString || basex->ValueType == TypeName) && basex->isConstant())
{
ExpVal constval = static_cast<FxConstant *>(basex)->GetValue();
FFont *font = V_GetFont(constval.GetString());
FFont *font = V_GetFont(constval.GetString().GetChars());
// Font must exist. Most internal functions working with fonts do not like null pointers.
// If checking is needed scripts will have to call Font.GetFont themselves.
if (font == nullptr)