src/stringTable.cpp

changeset 134
eca2fc0acaa2
parent 133
dbbdb870c835
child 135
8b9132fea327
equal deleted inserted replaced
133:dbbdb870c835 134:eca2fc0acaa2
57 if (g_StringTable[idx] == a) 57 if (g_StringTable[idx] == a)
58 return idx; 58 return idx;
59 } 59 }
60 60
61 // Must not be too long. 61 // Must not be too long.
62 if (a.length() >= gMaxStringLength) 62 if (a.length() >= Limits::MaxStringLength)
63 {
63 error ("string `%1` too long (%2 characters, max is %3)\n", 64 error ("string `%1` too long (%2 characters, max is %3)\n",
64 a, a.length(), gMaxStringLength); 65 a, a.length(), Limits::MaxStringLength);
66 }
65 67
66 // Check if the table is already full 68 // Check if the table is already full
67 if (g_StringTable.size() == gMaxStringlistSize - 1) 69 if (g_StringTable.size() == Limits::MaxStringlistSize - 1)
68 error ("too many strings!\n"); 70 error ("too many strings!\n");
69 71
70 // Now, dump the string into the slot 72 // Now, dump the string into the slot
71 g_StringTable.append (a); 73 g_StringTable.append (a);
72 return (g_StringTable.size() - 1); 74 return (g_StringTable.size() - 1);

mercurial