From 96ebd81e5f29e9cde3d83c4af0b9166cd1f40b26 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 11 May 2019 16:15:07 +1000 Subject: GLK: HUGO: NULL to nullptr, Amiga compilation fix --- engines/glk/hugo/heglk.cpp | 38 +++++++++++++++++----------------- engines/glk/hugo/hemisc.cpp | 50 ++++++++++++++++++++++----------------------- engines/glk/hugo/herun.cpp | 36 ++++++++++++++++---------------- 3 files changed, 62 insertions(+), 62 deletions(-) (limited to 'engines/glk/hugo') diff --git a/engines/glk/hugo/heglk.cpp b/engines/glk/hugo/heglk.cpp index 4884d0f8cf..f6f40814f5 100644 --- a/engines/glk/hugo/heglk.cpp +++ b/engines/glk/hugo/heglk.cpp @@ -52,7 +52,7 @@ void Hugo::hugo_getline(const char *prmpt) { window that hasn't been created, switch as a failsafe to mainwin */ - if (currentwin == NULL) + if (currentwin == nullptr) glk_set_window(currentwin = mainwin); /* Print prompt */ @@ -97,7 +97,7 @@ int Hugo::hugo_waitforkey() { window that hasn't been created, switch as a failsafe to mainwin */ - if (currentwin == NULL) + if (currentwin == nullptr) glk_set_window(currentwin = mainwin); #if defined (NO_KEYPRESS_CURSOR) @@ -211,7 +211,7 @@ void Hugo::hugo_clearwindow() { not really a window */ if (inwindow && currentwin == mainwin) return; - if (currentwin == NULL) return; + if (currentwin == nullptr) return; glk_window_clear(currentwin); @@ -227,7 +227,7 @@ void Hugo::hugo_clearwindow() { stream_result_t sr; glk_window_close(auxwin, &sr); - auxwin = NULL; + auxwin = nullptr; glk_set_window(currentwin = mainwin); } @@ -256,11 +256,11 @@ void Hugo::hugo_settextwindow(int left, int top, int right, int bottom) { in_valid_window = false; /* Glk-illegal floating window; setting currentwin - to NULL will tell hugo_print() not to print in it: + to nullptr will tell hugo_print() not to print in it: */ if (bottom= physical_windowwidth) @@ -1750,7 +1750,7 @@ void Hugo::PromptMore() { { if (hugo_fclose(playback)) FatalError(READ_E); - playback = NULL; + playback = nullptr; } else if (playback && k=='+') skipping_more = true; @@ -1802,7 +1802,7 @@ int Hugo::RecordCommands() { strcpy(recordfile, line); #else /* Glk implementation */ - frefid_t fref = NULL; + frefid_t fref = nullptr; fref = glk_fileref_create_by_prompt(fileusage_Transcript | fileusage_TextMode, filemode_Write, 0); @@ -1824,7 +1824,7 @@ int Hugo::RecordCommands() { { if (hugo_fclose(record)) return (0); - record = NULL; + record = nullptr; return 1; } break; @@ -1844,7 +1844,7 @@ int Hugo::RecordCommands() { strcpy(recordfile, line); #else /* Glk implementation */ - frefid_t fref = NULL; + frefid_t fref = nullptr; fref = glk_fileref_create_by_prompt(fileusage_InputRecord | fileusage_TextMode, filemode_Read, 0); @@ -2173,7 +2173,7 @@ HUGO_FILE TrytoOpen(char *f, char *p, char *d) } } - return NULL; /* return NULL if not openable */ + return nullptr; /* return nullptr if not openable */ } #endif /* GLK */ diff --git a/engines/glk/hugo/herun.cpp b/engines/glk/hugo/herun.cpp index 43837977d5..6466f8829f 100644 --- a/engines/glk/hugo/herun.cpp +++ b/engines/glk/hugo/herun.cpp @@ -163,7 +163,7 @@ RestartDebugger: /* If no gamefile is loaded, jump immediately to the debugger interrupt function. */ - if (game==NULL) Debugger(); + if (game==nullptr) Debugger(); #endif stack_depth = RESET_STACK_DEPTH; @@ -271,7 +271,7 @@ FreshInput: { if (hugo_fclose(playback)) FatalError(READ_E); - playback = NULL; + playback = nullptr; GetCommand(); } else @@ -635,7 +635,7 @@ EndofCommand: if (playback) { if (hugo_fclose(playback)) FatalError(READ_E); - playback = NULL; + playback = nullptr; } Flushpbuffer(); @@ -702,7 +702,7 @@ NormalTermination: debugger_collapsing = false; - if ((game!=NULL) && !RunRestart()) + if ((game!=nullptr) && !RunRestart()) DebugMessageBox("Restart Error", "Unable to restart"); SwitchtoGame(); @@ -1115,7 +1115,7 @@ int Hugo::RunRestart() { { if (hugo_fclose(playback)) FatalError(READ_E); - playback = NULL; + playback = nullptr; } if (active_screen!=DEBUGGER) @@ -1169,7 +1169,7 @@ int Hugo::RestoreGameData() { { AP("Incorrect save file."); if (hugo_fclose(save)) FatalError(READ_E); - save = NULL; + save = nullptr; return 0; } @@ -1179,7 +1179,7 @@ int Hugo::RestoreGameData() { { AP("Save file created by different version."); if (hugo_fclose(save)) FatalError(READ_E); - save = NULL; + save = nullptr; return 0; } @@ -1258,7 +1258,7 @@ RestoreError: int Hugo::RunRestore() { #if !defined (GLK) - save = NULL; + save = nullptr; /* stdio implementation */ hugo_getfilename("to restore", savefile); @@ -1273,7 +1273,7 @@ int Hugo::RunRestore() { /* Glk implementation */ frefid_t savefile; - save = NULL; + save = nullptr; savefile = glk_fileref_create_by_prompt(fileusage_SavedGame | fileusage_BinaryMode, filemode_Read, 0); @@ -1281,7 +1281,7 @@ int Hugo::RunRestore() { if (glk_fileref_does_file_exist(savefile)) save = glk_stream_open_file(savefile, filemode_Read, 0); else - save = NULL; + save = nullptr; glk_fileref_destroy(savefile); if (!save) return 0; @@ -1290,7 +1290,7 @@ int Hugo::RunRestore() { if (!RestoreGameData()) goto RestoreError; if (hugo_fclose(save)) FatalError(READ_E); - save = NULL; + save = nullptr; #if !defined (GLK) strcpy(savefile, line); @@ -1302,7 +1302,7 @@ int Hugo::RunRestore() { RestoreError: if ((save) && hugo_fclose(save)) FatalError(READ_E); - save = NULL; + save = nullptr; game_reset = false; return 0; } @@ -1413,7 +1413,7 @@ void Hugo::RunRoutine(long addr) { } /* If not object.property or an event */ - if (strchr(debug_line, '.')==NULL && strstr(debug_line, "vent ")==NULL) + if (strchr(debug_line, '.')==nullptr && strstr(debug_line, "vent ")==nullptr) { strcat(debug_line, "("); for (i=0; i