summaryrefslogtreecommitdiff
path: root/src/strings_func.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-02-26 19:40:32 +0000
committerfrosch <frosch@openttd.org>2017-02-26 19:40:32 +0000
commitf4da8ece0ce02d6fe3dac6f8adc147e8a3d095a3 (patch)
tree8a2c1ca7a961cc1df6588bd0c360ef8eb182d72a /src/strings_func.h
parent9ad09627ad03030d39bd07e28c74bf91b83a0f24 (diff)
downloadopenttd-f4da8ece0ce02d6fe3dac6f8adc147e8a3d095a3.tar.xz
(svn r27755) -Codechange: Move TAB_SIZE to strings_type.h and use it consistently.
Diffstat (limited to 'src/strings_func.h')
-rw-r--r--src/strings_func.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/strings_func.h b/src/strings_func.h
index 5d69121e3..3e3aa4840 100644
--- a/src/strings_func.h
+++ b/src/strings_func.h
@@ -24,7 +24,7 @@
*/
static inline uint GetStringTab(StringID str)
{
- return GB(str, 11, 5);
+ return GB(str, TAB_SIZE_BITS, 5);
}
/**
@@ -34,7 +34,7 @@ static inline uint GetStringTab(StringID str)
*/
static inline uint GetStringIndex(StringID str)
{
- return GB(str, 0, 11);
+ return GB(str, 0, TAB_SIZE_BITS);
}
/**
@@ -45,7 +45,8 @@ static inline uint GetStringIndex(StringID str)
*/
static inline StringID MakeStringID(uint tab, uint index)
{
- return tab << 11 | index;
+ assert(index < TAB_SIZE);
+ return tab << TAB_SIZE_BITS | index;
}
class StringParameters {