From f6d4200f86e93828a4a58a957d6ae7d9d5497a86 Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 14 Nov 2012 22:50:17 +0000 Subject: (svn r24738) -Codechange: Remove Textbuf::Initialize in favour of a constructor. --- src/textbuf_type.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/textbuf_type.h') diff --git a/src/textbuf_type.h b/src/textbuf_type.h index 77a957f84..8d38e8b8a 100644 --- a/src/textbuf_type.h +++ b/src/textbuf_type.h @@ -17,7 +17,7 @@ /** Helper/buffer for input fields. */ struct Textbuf { - char *buf; ///< buffer in which text is saved + char * const buf; ///< buffer in which text is saved uint16 max_bytes; ///< the maximum size of the buffer in bytes (including terminating '\0') uint16 max_chars; ///< the maximum size of the buffer in characters (including terminating '\0') uint16 bytes; ///< the current size of the string in bytes (including terminating '\0') @@ -27,8 +27,8 @@ struct Textbuf { uint16 caretpos; ///< the current position of the caret in the buffer, in bytes uint16 caretxoffs; ///< the current position of the caret in pixels - void Initialize(char *buf, uint16 max_bytes); - void Initialize(char *buf, uint16 max_bytes, uint16 max_chars); + explicit Textbuf(uint16 max_bytes, uint16 max_chars = UINT16_MAX); + ~Textbuf(); void Assign(StringID string); void Assign(const char *text); -- cgit v1.2.3-54-g00ecf