[Scummvm-git-logs] scummvm master -> 4873c8d994bc11eb9ccccbe144c781ed5861b03a

sev- noreply at scummvm.org
Sun Nov 20 14:07:35 UTC 2022


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

Summary:
c687f86f2c DEVTOOLS: CREATE_ENGINE: Various small tweaks in generated engine
4873c8d994 DEVTOOLS: CREATE_ENINGE: sprintf -> snprintf


Commit: c687f86f2cca538e5156d05a914dc4a71c91786b
    https://github.com/scummvm/scummvm/commit/c687f86f2cca538e5156d05a914dc4a71c91786b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-11-20T15:01:42+01:00

Commit Message:
DEVTOOLS: CREATE_ENGINE: Various small tweaks in generated engine

Changed paths:
    devtools/create_engine/files/console.cpp
    devtools/create_engine/files/console.h
    devtools/create_engine/files/detection.cpp
    devtools/create_engine/files/detection.h
    devtools/create_engine/files/detection_tables.h
    devtools/create_engine/files/metaengine.h
    devtools/create_engine/files/xyzzy.cpp
    devtools/create_engine/files/xyzzy.h


diff --git a/devtools/create_engine/files/console.cpp b/devtools/create_engine/files/console.cpp
index 0de29135d50..f917a755791 100644
--- a/devtools/create_engine/files/console.cpp
+++ b/devtools/create_engine/files/console.cpp
@@ -35,4 +35,4 @@ bool Console::Cmd_test(int argc, const char **argv) {
 	return true;
 }
 
-} // namespace Xyzzy
+} // End of namespace Xyzzy
diff --git a/devtools/create_engine/files/console.h b/devtools/create_engine/files/console.h
index b5cdc6e1258..c421e2589c2 100644
--- a/devtools/create_engine/files/console.h
+++ b/devtools/create_engine/files/console.h
@@ -37,4 +37,4 @@ public:
 
 } // End of namespace Xyzzy
 
-#endif
+#endif // XYZZY_CONSOLE_H
diff --git a/devtools/create_engine/files/detection.cpp b/devtools/create_engine/files/detection.cpp
index 0592d954777..fcd39c1dfad 100644
--- a/devtools/create_engine/files/detection.cpp
+++ b/devtools/create_engine/files/detection.cpp
@@ -38,8 +38,8 @@ const DebugChannelDef XyzzyMetaEngineDetection::debugFlagList[] = {
 	DEBUG_CHANNEL_END
 };
 
-XyzzyMetaEngineDetection::XyzzyMetaEngineDetection() : AdvancedMetaEngineDetection(Xyzzy::GAME_DESCRIPTIONS,
-	sizeof(ADGameDescription), Xyzzy::GAME_NAMES) {
+XyzzyMetaEngineDetection::XyzzyMetaEngineDetection() : AdvancedMetaEngineDetection(Xyzzy::gameDescriptions,
+	sizeof(ADGameDescription), Xyzzy::xyzzyGames) {
 }
 
 REGISTER_PLUGIN_STATIC(XYZZY_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, XyzzyMetaEngineDetection);
diff --git a/devtools/create_engine/files/detection.h b/devtools/create_engine/files/detection.h
index 83f4b4acd4b..1b9d86b750c 100644
--- a/devtools/create_engine/files/detection.h
+++ b/devtools/create_engine/files/detection.h
@@ -31,12 +31,12 @@ enum XyzzyDebugChannels {
 	kDebugPath     = 1 << 1,
 	kDebugScan     = 1 << 2,
 	kDebugFilePath = 1 << 3,
-	kDebugScript   = 1 << 4
+	kDebugScript   = 1 << 4,
 };
 
-extern const PlainGameDescriptor GAME_NAMES[];
+extern const PlainGameDescriptor xyzzyGames[];
 
-extern const ADGameDescription GAME_DESCRIPTIONS[];
+extern const ADGameDescription gameDescriptions[];
 
 } // namespace Xyzzy
 
@@ -64,4 +64,4 @@ public:
 	}
 };
 
-#endif
+#endif // XYZZY_DETECTION_H
diff --git a/devtools/create_engine/files/detection_tables.h b/devtools/create_engine/files/detection_tables.h
index aea6223e597..8d1c5f41eed 100644
--- a/devtools/create_engine/files/detection_tables.h
+++ b/devtools/create_engine/files/detection_tables.h
@@ -21,12 +21,12 @@
 
 namespace Xyzzy {
 
-const PlainGameDescriptor GAME_NAMES[] = {
+const PlainGameDescriptor xyzzyGames[] = {
 	{ "xyzzy", "Xyzzy" },
 	{ 0, 0 }
 };
 
-const ADGameDescription GAME_DESCRIPTIONS[] = {
+const ADGameDescription gameDescriptions[] = {
 	{
 		"xyzzy",
 		nullptr,
@@ -40,4 +40,4 @@ const ADGameDescription GAME_DESCRIPTIONS[] = {
 	AD_TABLE_END_MARKER
 };
 
-} // namespace Xyzzy
+} // End of namespace Xyzzy
diff --git a/devtools/create_engine/files/metaengine.h b/devtools/create_engine/files/metaengine.h
index c80e647db78..903eea46281 100644
--- a/devtools/create_engine/files/metaengine.h
+++ b/devtools/create_engine/files/metaengine.h
@@ -39,4 +39,4 @@ public:
 	bool hasFeature(MetaEngineFeature f) const override;
 };
 
-#endif
+#endif // XYZZY_METAENGINE_H
diff --git a/devtools/create_engine/files/xyzzy.cpp b/devtools/create_engine/files/xyzzy.cpp
index 52efc57f98c..fdf65322155 100644
--- a/devtools/create_engine/files/xyzzy.cpp
+++ b/devtools/create_engine/files/xyzzy.cpp
@@ -104,4 +104,4 @@ Common::Error XyzzyEngine::syncGame(Common::Serializer &s) {
 	return Common::kNoError;
 }
 
-} // namespace Xyzzy
+} // End of namespace Xyzzy
diff --git a/devtools/create_engine/files/xyzzy.h b/devtools/create_engine/files/xyzzy.h
index 971814428fb..e7bf3157932 100644
--- a/devtools/create_engine/files/xyzzy.h
+++ b/devtools/create_engine/files/xyzzy.h
@@ -19,8 +19,8 @@
  *
  */
 
-#ifndef XYZZY_XYZZY_H
-#define XYZZY_XYZZY_H
+#ifndef XYZZY_H
+#define XYZZY_H
 
 #include "common/scummsys.h"
 #include "common/system.h"
@@ -100,6 +100,6 @@ public:
 extern XyzzyEngine *g_engine;
 #define SHOULD_QUIT ::Xyzzy::g_engine->shouldQuit()
 
-} // namespace Xyzzy
+} // End of namespace Xyzzy
 
-#endif
+#endif // XYZZY_H


Commit: 4873c8d994bc11eb9ccccbe144c781ed5861b03a
    https://github.com/scummvm/scummvm/commit/4873c8d994bc11eb9ccccbe144c781ed5861b03a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-11-20T15:04:44+01:00

Commit Message:
DEVTOOLS: CREATE_ENINGE: sprintf -> snprintf

Changed paths:
    devtools/create_engine/create_engine.cpp


diff --git a/devtools/create_engine/create_engine.cpp b/devtools/create_engine/create_engine.cpp
index 552f44e4546..a8a0d96d497 100644
--- a/devtools/create_engine/create_engine.cpp
+++ b/devtools/create_engine/create_engine.cpp
@@ -110,12 +110,12 @@ void process_file(FILE *in, FILE *out) {
 // Copies and processes the specified file
 void process_file(const char *filename, const char *prefix, const char *prefix2) {
 	char srcFilename[MAX_LINE_LENGTH], destFilename[MAX_LINE_LENGTH];
-	sprintf(srcFilename, "%s/files/%s", prefix2, filename);
+	snprintf(srcFilename, MAX_LINE_LENGTH, "%s/files/%s", prefix2, filename);
 	if (!strncmp(filename, "xyzzy.", 6))
-		sprintf(destFilename, "%s/engines/%s/%s.%s",
+		snprintf(destFilename, MAX_LINE_LENGTH, "%s/engines/%s/%s.%s",
 			prefix, engineLowercase, engineLowercase, filename + 6);
 	else
-		sprintf(destFilename, "%s/engines/%s/%s",
+		snprintf(destFilename, MAX_LINE_LENGTH, "%s/engines/%s/%s",
 			prefix, engineLowercase, filename);
 
 	printf("Creating file %s...", destFilename);
@@ -148,13 +148,13 @@ void create_batch_file(const char *prefix) {
 	char line[MAX_LINE_LENGTH];
 	char destFilename[MAX_LINE_LENGTH];
 
-	sprintf(destFilename, "%s/dists/msvc/create_msvc.bat", prefix);
+	snprintf(destFilename, MAX_LINE_LENGTH, "%s/dists/msvc/create_msvc.bat", prefix);
 	if (!(in = fopen(destFilename, "r"))) {
 		printf("Could not open create_msvc.bat\n");
 		exit(0);
 	}
 
-	sprintf(destFilename, "%s/dists/msvc/%s.bat", prefix, engineLowercase);
+	snprintf(destFilename, MAX_LINE_LENGTH, "%s/dists/msvc/%s.bat", prefix, engineLowercase);
 
 	printf("Creating file %s...", destFilename);
 	fflush(stdout);
@@ -167,7 +167,7 @@ void create_batch_file(const char *prefix) {
 	// Get each line until there are none left
 	while (fgets(line, MAX_LINE_LENGTH, in)) {
 		if (!strcmp(line, ENGINES)) {
-			sprintf(line + strlen(line) - 1,
+			snprintf(line + strlen(line) - 1, MAX_LINE_LENGTH - strlen(line) + 1,
 				" --disable-all-engines --enable-engine=%s\n",
 				engineLowercase);
 		}
@@ -212,7 +212,7 @@ int main(int argc, char *argv[]) {
 
 	// Create a directory for the new engine
 	char folder[MAX_LINE_LENGTH];
-	sprintf(folder, "%s/engines/%s", prefix, engineLowercase);
+	snprintf(folder, MAX_LINE_LENGTH, "%s/engines/%s", prefix, engineLowercase);
 
 	printf("Creating directory %s...", folder);
 	fflush(stdout);




More information about the Scummvm-git-logs mailing list