diff options
author | Paul Gilbert | 2019-06-26 19:37:00 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-07-06 15:27:07 -0700 |
commit | 2de068a98aaeb8a1e9e8f2e719b5ff6ebf858b44 (patch) | |
tree | 8b3d3f2a5839adfbac135682de9966913463ff9f /engines/glk/alan3/exe.cpp | |
parent | 305330bda7e755f141805a4e0e45f74820e980e1 (diff) | |
download | scummvm-rg350-2de068a98aaeb8a1e9e8f2e719b5ff6ebf858b44.tar.gz scummvm-rg350-2de068a98aaeb8a1e9e8f2e719b5ff6ebf858b44.tar.bz2 scummvm-rg350-2de068a98aaeb8a1e9e8f2e719b5ff6ebf858b44.zip |
GLK: ALAN3: Further warning fixes
Diffstat (limited to 'engines/glk/alan3/exe.cpp')
-rw-r--r-- | engines/glk/alan3/exe.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/engines/glk/alan3/exe.cpp b/engines/glk/alan3/exe.cpp index 7f0fe2b687..f37cc2f661 100644 --- a/engines/glk/alan3/exe.cpp +++ b/engines/glk/alan3/exe.cpp @@ -340,8 +340,10 @@ void schedule(Aword event, Aword where, Aword after) cancelEvent(event); /* Check for overflow */ - if (eventQueue == NULL || eventQueueTop == eventQueueSize) + if (eventQueue == nullptr || eventQueueTop == eventQueueSize) { increaseEventQueue(); + assert(eventQueue); + } /* Bubble this event down */ for (i = eventQueueTop; i >= 1 && eventQueue[i-1].after <= (int)after; i--) { @@ -713,35 +715,33 @@ bool streq(char a[], char b[]) /*======================================================================*/ void startTranscript(void) { - if (logFile != NULL) - return; - - Common::String filename = g_vm->getTargetName() + ".log"; - - uint fileUsage = transcriptOption ? fileusage_Transcript : fileusage_InputRecord; - frefid_t logFileRef = g_vm->glk_fileref_create_by_name(fileUsage, filename.c_str(), 0); - logFile = g_vm->glk_stream_open_file(logFileRef, filemode_Write, 0); - - if (logFile == NULL) { - transcriptOption = FALSE; - logOption = FALSE; - } else { - transcriptOption = TRUE; + if (logFile == NULL) { + Common::String filename = g_vm->getTargetName() + ".log"; + + uint fileUsage = transcriptOption ? fileusage_Transcript : fileusage_InputRecord; + frefid_t logFileRef = g_vm->glk_fileref_create_by_name(fileUsage, filename.c_str(), 0); + logFile = g_vm->glk_stream_open_file(logFileRef, filemode_Write, 0); + + if (logFile == NULL) { + transcriptOption = FALSE; + logOption = FALSE; + } else { + transcriptOption = TRUE; + } } } /*======================================================================*/ void stopTranscript(void) { - if (logFile == NULL) - return; - - if (transcriptOption|| logOption) - delete logFile; + if (logFile != NULL) { + if (transcriptOption|| logOption) + delete logFile; - logFile = NULL; - transcriptOption = FALSE; - logOption = FALSE; + logFile = NULL; + transcriptOption = FALSE; + logOption = FALSE; + } } } // End of namespace Alan3 |