diff options
author | frosch <frosch@openttd.org> | 2012-11-14 22:50:17 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-14 22:50:17 +0000 |
commit | f6d4200f86e93828a4a58a957d6ae7d9d5497a86 (patch) | |
tree | 2d940ae42f1f273a19c2c33f2858feab9122d9c2 /src/textbuf_type.h | |
parent | 0ea21523556a345d38933ee2dd6dcdca0ec08514 (diff) | |
download | openttd-f6d4200f86e93828a4a58a957d6ae7d9d5497a86.tar.xz |
(svn r24738) -Codechange: Remove Textbuf::Initialize in favour of a constructor.
Diffstat (limited to 'src/textbuf_type.h')
-rw-r--r-- | src/textbuf_type.h | 6 |
1 files changed, 3 insertions, 3 deletions
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); |