From 61945782d6a73967d122f38a4f97f9b7377abdea Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 11 May 2012 14:16:50 +0200 Subject: 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. --- engines/wintermute/UIButton.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/wintermute/UIButton.cpp') diff --git a/engines/wintermute/UIButton.cpp b/engines/wintermute/UIButton.cpp index ebb72cbe97..4b5dde50fe 100644 --- a/engines/wintermute/UIButton.cpp +++ b/engines/wintermute/UIButton.cpp @@ -95,7 +95,7 @@ CUIButton::~CUIButton() { ////////////////////////////////////////////////////////////////////////// -HRESULT CUIButton::LoadFile(char *Filename) { +HRESULT CUIButton::LoadFile(const char *Filename) { byte *Buffer = Game->_fileManager->ReadWholeFile(Filename); if (Buffer == NULL) { Game->LOG(0, "CUIButton::LoadFile failed for file '%s'", Filename); @@ -744,7 +744,7 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th delete _imageDisable; _imageDisable = new CBSprite(Game); - char *Filename = Stack->Pop()->GetString(); + const char *Filename = Stack->Pop()->GetString(); if (!_imageDisable || FAILED(_imageDisable->LoadFile(Filename))) { delete _imageDisable; _imageDisable = NULL; @@ -785,7 +785,7 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th delete _imageHover; _imageHover = new CBSprite(Game); - char *Filename = Stack->Pop()->GetString(); + const char *Filename = Stack->Pop()->GetString(); if (!_imageHover || FAILED(_imageHover->LoadFile(Filename))) { delete _imageHover; _imageHover = NULL; @@ -825,7 +825,7 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th delete _imagePress; _imagePress = new CBSprite(Game); - char *Filename = Stack->Pop()->GetString(); + const char *Filename = Stack->Pop()->GetString(); if (!_imagePress || FAILED(_imagePress->LoadFile(Filename))) { delete _imagePress; _imagePress = NULL; @@ -865,7 +865,7 @@ HRESULT CUIButton::ScCallMethod(CScScript *Script, CScStack *Stack, CScStack *Th delete _imageFocus; _imageFocus = new CBSprite(Game); - char *Filename = Stack->Pop()->GetString(); + const char *Filename = Stack->Pop()->GetString(); if (!_imageFocus || FAILED(_imageFocus->LoadFile(Filename))) { delete _imageFocus; _imageFocus = NULL; -- cgit v1.2.3