[Scummvm-git-logs] scummvm master -> 626206de7f93abeff6a56751fd3c49e70e89ec23

neuromancer neuromancer at users.noreply.github.com
Wed Jun 23 06:26:19 UTC 2021


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:
626206de7f PRIVATE: fixed warning when casting a const char


Commit: 626206de7f93abeff6a56751fd3c49e70e89ec23
    https://github.com/scummvm/scummvm/commit/626206de7f93abeff6a56751fd3c49e70e89ec23
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2021-06-23T08:25:27+02:00

Commit Message:
PRIVATE: fixed warning when casting a const char

Changed paths:
    engines/private/lexer.cpp
    engines/private/lexer.l
    engines/private/private.cpp


diff --git a/engines/private/lexer.cpp b/engines/private/lexer.cpp
index 30a829c4fb..6ae2887d26 100644
--- a/engines/private/lexer.cpp
+++ b/engines/private/lexer.cpp
@@ -2188,7 +2188,7 @@ void yyfree (void * ptr )
 
 namespace Private {
 
-int parse(char *code) {
+int parse(const char *code) {
     g_setts->init();
     YY_BUFFER_STATE bp;
     yy_delete_buffer(YY_CURRENT_BUFFER);
diff --git a/engines/private/lexer.l b/engines/private/lexer.l
index 9b0c4206ab..e57985a18d 100644
--- a/engines/private/lexer.l
+++ b/engines/private/lexer.l
@@ -68,7 +68,7 @@ Random			        return RANDOMTOK;
 
 namespace Private {
 
-int parse(char *code) {
+int parse(const char *code) {
 	g_setts->init();
 	YY_BUFFER_STATE bp;
 	yy_delete_buffer(YY_CURRENT_BUFFER);
diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index a6a008442c..f2548138c5 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -45,7 +45,7 @@ namespace Private {
 
 PrivateEngine *g_private = NULL;
 
-extern int parse(char *);
+extern int parse(const char *);
 
 PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
 	: Engine(syst), _gameDescription(gd), _image(nullptr), _videoDecoder(nullptr),
@@ -179,15 +179,15 @@ Common::Error PrivateEngine::run() {
 	Decompiler decomp(buf, fileSize, _platform == Common::kPlatformMacintosh);
 	free(buf);
 
-	buf = (char *)decomp.getResult().c_str();
-	debugC(1, kPrivateDebugCode, "code:\n%s", buf);
+	Common::String scripts = decomp.getResult();
+	debugC(1, kPrivateDebugCode, "code:\n%s", scripts.c_str());
 
 	// Initialize stuff
 	Gen::g_vm = new Gen::VM();
 	Settings::g_setts = new Settings::SettingMaps();
 
 	initFuncs();
-	parse(buf);
+	parse(scripts.c_str());
 	delete file;
 	assert(maps.constants.size() > 0);
 




More information about the Scummvm-git-logs mailing list