From 49e922daa689ee330ec8ded87bed6278e701226d Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 1 Mar 2017 21:20:15 +0000 Subject: [PATCH] Remove stub HandleOnEditText and now unused global variables. --- src/gui.h | 1 - src/main_gui.cpp | 8 -------- src/misc_gui.cpp | 4 +++- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/gui.h b/src/gui.h index 39f1ea661e..39e80a5b66 100644 --- a/src/gui.h +++ b/src/gui.h @@ -22,7 +22,6 @@ struct Window; /* main_gui.cpp */ -void HandleOnEditText(const char *str); void InitializeGUI(); /* settings_gui.cpp */ diff --git a/src/main_gui.cpp b/src/main_gui.cpp index db92e210bf..0a3d55fdbd 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -47,9 +47,6 @@ #include "safeguards.h" -static int _rename_id = 1; -static int _rename_what = -1; - void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { #ifdef ENABLE_NETWORK @@ -68,11 +65,6 @@ void CcGiveMoney(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2 #endif /* ENABLE_NETWORK */ } -void HandleOnEditText(const char *str) -{ - NOT_REACHED(); -} - /** * This code is shared for the majority of the pushbuttons. * Handles e.g. the pressing of a button (to build things), playing of click sound and sets certain parameters diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 2d3871ffbd..40d3a83658 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -945,6 +945,8 @@ struct QueryStringWindow : public Window QueryStringWindow(StringID str, StringID caption, uint max_bytes, uint max_chars, WindowDesc *desc, Window *parent, CharSetFilter afilter, QueryStringFlags flags) : Window(desc), editbox(max_bytes, max_chars) { + assert(parent != NULL); + char *last_of = &this->editbox.text.buf[this->editbox.text.max_bytes - 1]; GetString(this->editbox.text.buf, str, last_of); str_validate(this->editbox.text.buf, last_of, SVS_NONE); @@ -996,7 +998,7 @@ struct QueryStringWindow : public Window if (this->parent != NULL) { this->parent->OnQueryTextFinished(this->editbox.text.buf); } else { - HandleOnEditText(this->editbox.text.buf); + NOT_REACHED(); } this->editbox.handled = true; }