(svn r27756) -Codechange: Add StringTab enum

This commit is contained in:
frosch
2017-02-26 19:40:53 +00:00
parent f4da8ece0c
commit a56e2bccd0
10 changed files with 65 additions and 50 deletions

View File

@@ -22,9 +22,9 @@
* @param str String identifier
* @return StringTab from \a str
*/
static inline uint GetStringTab(StringID str)
static inline StringTab GetStringTab(StringID str)
{
return GB(str, TAB_SIZE_BITS, 5);
return (StringTab)GB(str, TAB_SIZE_BITS, 5);
}
/**
@@ -43,8 +43,9 @@ static inline uint GetStringIndex(StringID str)
* @param index StringIndex
* @return StringID composed from \a tab and \a index
*/
static inline StringID MakeStringID(uint tab, uint index)
static inline StringID MakeStringID(StringTab tab, uint index)
{
assert(tab < TEXT_TAB_END);
assert(index < TAB_SIZE);
return tab << TAB_SIZE_BITS | index;
}