OpenBarnyard
 
Loading...
Searching...
No Matches
TStringTable.cpp
Go to the documentation of this file.
1#include "ToshiPCH.h"
2#include "TStringTable.h"
3
4//-----------------------------------------------------------------------------
5// Enables memory debugging.
6// Note: Should be the last include!
7//-----------------------------------------------------------------------------
9
11
13{
14 {
16
17 TINT iVar2;
18 short sVar3;
19 short sVar4;
20 TINT index;
21 TINT uVar5;
22
23 sVar3 = *(short*)&m_NumStrings;
24 index = sVar3 >> 1;
25 if ( sVar3 >> 1 < 0x8000 )
26 {
27 uVar5 = 0;
28 do {
29 sVar4 = (short)index;
30 if ( sVar3 <= sVar4 )
31 {
32 return -1;
33 }
34 iVar2 = T2String8::Compare( string, m_Strings[ sVar4 ], -1 );
35 if ( iVar2 == 0 )
36 {
37 return (TINT)sVar4;
38 }
39 if ( -1 < iVar2 )
40 {
41 uVar5 = index + 1 & 0xffff;
42 sVar4 = sVar3;
43 }
44 sVar3 = sVar4;
45 index = ( ( (TINT)sVar3 - uVar5 ) >> 1 ) + uVar5 & 0xffff;
46 } while ( (short)uVar5 <= (short)index );
47 }
48
49 return -1;
50 }
51}
52
#define TASSERT(X,...)
Definition Defines.h:138
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
char TCHAR
Definition Typedefs.h:20
int TINT
Definition Typedefs.h:7
static TBOOL IsLowerCase(const TCHAR *str)
static TINT Compare(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
Definition T2String8.cpp:52
TINT GetStringID(const TCHAR *string)