[Scummvm-git-logs] scummvm master -> 84398f85d8cad3ee2805cfdc6f5563aa4c7748d6
digitall
547637+digitall at users.noreply.github.com
Sat Nov 23 12:42:27 UTC 2019
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:
84398f85d8 GLK: MAGNETIC: Fix Compilation on AmigaOS4
Commit: 84398f85d8cad3ee2805cfdc6f5563aa4c7748d6
https://github.com/scummvm/scummvm/commit/84398f85d8cad3ee2805cfdc6f5563aa4c7748d6
Author: D G Turner (digitall at scummvm.org)
Date: 2019-11-23T12:38:11Z
Commit Message:
GLK: MAGNETIC: Fix Compilation on AmigaOS4
This seems to be an issue where the initializer for the members called log
get confused for a call to the log() standard library function.
Renaming these members with leading underscores and adding some checks for
nullptr before usage are good practice in any case and should fix this.
Changed paths:
engines/glk/magnetic/glk.cpp
engines/glk/magnetic/magnetic.cpp
engines/glk/magnetic/magnetic.h
diff --git a/engines/glk/magnetic/glk.cpp b/engines/glk/magnetic/glk.cpp
index 7b70fa3..1c0a366 100644
--- a/engines/glk/magnetic/glk.cpp
+++ b/engines/glk/magnetic/glk.cpp
@@ -3980,13 +3980,17 @@ void Magnetic::writeChar(char c) {
}
void Magnetic::script_write(type8 c) {
- if (log_on == 2)
- log1->writeByte(c);
+ if (log_on == 2) {
+ if (_log1) {
+ _log1->writeByte(c);
+ }
+ }
}
void Magnetic::transcript_write(type8 c) {
- if (log2)
- log2->writeByte(c);
+ if (_log2) {
+ _log2->writeByte(c);
+ }
}
} // End of namespace Magnetic
diff --git a/engines/glk/magnetic/magnetic.cpp b/engines/glk/magnetic/magnetic.cpp
index 581d246..9e909bc 100644
--- a/engines/glk/magnetic/magnetic.cpp
+++ b/engines/glk/magnetic/magnetic.cpp
@@ -64,7 +64,7 @@ Magnetic::Magnetic(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(s
pos_table_index(-1), pos_table_max(-1), anim_repeat(0)
#endif
, hints(nullptr), hint_contents(nullptr), xpos(0), bufpos(0), log_on(0),
- ms_gfx_enabled(0), log1(nullptr), log2(nullptr), GMS_LUMINANCE_WEIGHTS(299, 587, 114),
+ ms_gfx_enabled(0), _log1(nullptr), _log2(nullptr), GMS_LUMINANCE_WEIGHTS(299, 587, 114),
linear_gamma(nullptr), pic_current_crc(0), hints_current_crc(0),
hints_crc_initialized(false), _saveData(nullptr), _saveSize(0) {
diff --git a/engines/glk/magnetic/magnetic.h b/engines/glk/magnetic/magnetic.h
index a3ea9ce..c19ef9c 100644
--- a/engines/glk/magnetic/magnetic.h
+++ b/engines/glk/magnetic/magnetic.h
@@ -259,7 +259,7 @@ private:
size_t _saveSize;
private:
type8 buffer[80], xpos, bufpos, log_on, ms_gfx_enabled, filename[256];
- Common::DumpFile *log1, *log2;
+ Common::DumpFile *_log1, *_log2;
private:
/* Method local statics in original code */
glui32 crc_table[BYTE_MAX_VAL + 1];
More information about the Scummvm-git-logs
mailing list