naming style (variable_to_string); nicer error messages for problems during dependency checking

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@67 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-10-31 16:06:17 +00:00
parent 2ba7267db5
commit 5ee944e426
9 changed files with 37 additions and 21 deletions
+3 -3
View File
@@ -17,7 +17,7 @@ Variables variables;
DECLARE_TYPEOF(Variables);
/// Return a unique name for a variable to allow for faster loopups
unsigned int stringToVariable(const String& s) {
unsigned int string_to_variable(const String& s) {
map<String, unsigned int>::iterator it = variables.find(s);
if (it == variables.end()) {
unsigned int v = (unsigned int)variables.size();
@@ -31,7 +31,7 @@ unsigned int stringToVariable(const String& s) {
/// Get the name of a vaiable
/** Warning: this function is slow, it should only be used for error messages and such.
*/
String variableToString(unsigned int v) {
String variable_to_string(unsigned int v) {
FOR_EACH(vi, variables) {
if (vi.second == v) return vi.first;
}
@@ -159,7 +159,7 @@ String Script::dumpInstr(unsigned int pos, Instruction i) const {
ret += "\t" + lexical_cast<String>(i.data);
break;
case I_GET_VAR: case I_SET_VAR: case I_NOP: // variable
ret += "\t" + variableToString(i.data) + "\t$" + lexical_cast<String>(i.data);
ret += "\t" + variable_to_string(i.data) + "\t$" + lexical_cast<String>(i.data);
break;
}
return ret;