[Scummvm-cvs-logs] scummvm master -> 10d9d8dee5104736da53a2807f3367b13731ad8f

wjp wjp at usecode.org
Wed Dec 23 22:02:16 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
10d9d8dee5 LAB: Fix warnings by adding consts


Commit: 10d9d8dee5104736da53a2807f3367b13731ad8f
    https://github.com/scummvm/scummvm/commit/10d9d8dee5104736da53a2807f3367b13731ad8f
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2015-12-23T21:51:39+01:00

Commit Message:
LAB: Fix warnings by adding consts

Changed paths:
    engines/lab/lab.h
    engines/lab/special.cpp



diff --git a/engines/lab/lab.h b/engines/lab/lab.h
index ba642f5..200dd00 100644
--- a/engines/lab/lab.h
+++ b/engines/lab/lab.h
@@ -312,7 +312,7 @@ private:
 	/**
 	 * Draws the text for the monitor.
 	 */
-	void drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive);
+	void drawMonText(const char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive);
 
 	/**
 	 * Draws a room map.
@@ -430,7 +430,7 @@ private:
 	/**
 	 * Processes user input.
 	 */
-	void processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
+	void processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
 
 	/**
 	 * Figures out what a room's coordinates should be.
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 649c725..7dd42dc 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -293,10 +293,10 @@ void LabEngine::doJournal() {
 	_graphics->blackScreen();
 }
 
-void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) {
+void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) {
 	uint16 drawingToPage = 0, yspacing = 0;
 	int charsDrawn = 0;
-	char *curText = text;
+	const char *curText = text;
 
 	_event->mouseHide();
 
@@ -347,7 +347,7 @@ void LabEngine::drawMonText(char *text, TextFont *monitorFont, Common::Rect text
 	_event->mouseShow();
 }
 
-void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
+void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
 	Common::String startFileName = _monitorTextFilename;
 	CloseDataPtr startClosePtr = _closeDataPtr, lastClosePtr[10];
 	uint16 depth = 0;
@@ -371,7 +371,7 @@ void LabEngine::processMonitor(char *ntext, TextFont *monitorFont, bool isIntera
 
 				Common::String text = _resource->getText(_monitorTextFilename);
 				_graphics->fade(false, 0);
-				drawMonText((char *)text.c_str(), monitorFont, textRect, isInteractive);
+				drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
 				_graphics->fade(true, 0);
 			}
 		}
@@ -461,10 +461,10 @@ void LabEngine::doMonitor(const Common::String background, const Common::String
 
 	Common::String ntext = _resource->getText(textfile);
 	_graphics->loadBackPict(background, _highPalette);
-	drawMonText((char *)ntext.c_str(), monitorFont, scaledRect, isinteractive);
+	drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
 	_event->mouseShow();
 	_graphics->fade(true, 0);
-	processMonitor((char *)ntext.c_str(), monitorFont, isinteractive, scaledRect);
+	processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
 	_graphics->fade(false, 0);
 	_event->mouseHide();
 	_graphics->closeFont(&monitorFont);






More information about the Scummvm-git-logs mailing list