diff options
author | Einar Johan Trøan Sømåen | 2012-05-11 14:16:50 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 12:59:09 +0200 |
commit | 61945782d6a73967d122f38a4f97f9b7377abdea (patch) | |
tree | 1d3dfb3542cbcb3f035aebe739783a77ddd5d866 /engines/wintermute/scriptables/SXFile.cpp | |
parent | 7bd6151127e072f4f270a62654398db74dc7085c (diff) | |
download | scummvm-rg350-61945782d6a73967d122f38a4f97f9b7377abdea.tar.gz scummvm-rg350-61945782d6a73967d122f38a4f97f9b7377abdea.tar.bz2 scummvm-rg350-61945782d6a73967d122f38a4f97f9b7377abdea.zip |
WINTERMUTE: Add const to almost all char *Filename instances.
Although done semi-automatically, almost all of these accesses don't need write-access
to the string, this simplifies debugging a bit, and opens the possibility of adding in
Common::String as a replacement down the line.
This DOES change quite a bit of code, and has regressions wrt drawing, probably some
super-classes don't fully match their sub-classes wrt virtual functions any more.
Diffstat (limited to 'engines/wintermute/scriptables/SXFile.cpp')
-rw-r--r-- | engines/wintermute/scriptables/SXFile.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/wintermute/scriptables/SXFile.cpp b/engines/wintermute/scriptables/SXFile.cpp index 19b60043da..a24615e01d 100644 --- a/engines/wintermute/scriptables/SXFile.cpp +++ b/engines/wintermute/scriptables/SXFile.cpp @@ -96,7 +96,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
if (strcmp(Name, "SetFilename") == 0) {
Stack->CorrectParams(1);
- char *Filename = Stack->Pop()->GetString();
+ const char *Filename = Stack->Pop()->GetString();
Cleanup();
CBUtils::SetString(&_filename, Filename);
Stack->PushNULL();
@@ -181,7 +181,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "Copy") == 0) {
Stack->CorrectParams(2);
- char *Dest = Stack->Pop()->GetString();
+ const char *Dest = Stack->Pop()->GetString();
bool Overwrite = Stack->Pop()->GetBool(true);
Close();
@@ -290,7 +290,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WriteLine") == 0 || strcmp(Name, "WriteText") == 0) {
Stack->CorrectParams(1);
- char *Line = Stack->Pop()->GetString();
+ const char *Line = Stack->Pop()->GetString();
if (!_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in text mode.", Name);
Stack->PushBool(false);
@@ -547,7 +547,7 @@ HRESULT CSXFile::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *This //////////////////////////////////////////////////////////////////////////
else if (strcmp(Name, "WriteString") == 0) {
Stack->CorrectParams(1);
- char *Val = Stack->Pop()->GetString();
+ const char *Val = Stack->Pop()->GetString();
if (_textMode || !_writeFile) {
Script->RuntimeError("File.%s: File must be open for writing in binary mode.", Name);
|