diff options
author | Einar Johan Trøan Sømåen | 2012-07-03 05:46:34 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-03 05:46:34 +0200 |
commit | 317e53aca7aafcd5ed356a25795ad994152a4fc8 (patch) | |
tree | b2cb26e951588be111af20385c47395a9f204e26 /engines/wintermute/Base | |
parent | 6fb4151b9f4d4bbd6100756752ebf25d4dd6514c (diff) | |
download | scummvm-rg350-317e53aca7aafcd5ed356a25795ad994152a4fc8.tar.gz scummvm-rg350-317e53aca7aafcd5ed356a25795ad994152a4fc8.tar.bz2 scummvm-rg350-317e53aca7aafcd5ed356a25795ad994152a4fc8.zip |
WINTERMUTE: Rename FuncName->funcName in SXArray
Diffstat (limited to 'engines/wintermute/Base')
-rw-r--r-- | engines/wintermute/Base/scriptables/SXArray.cpp | 82 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/SXArray.h | 6 | ||||
-rw-r--r-- | engines/wintermute/Base/scriptables/SXString.cpp | 2 |
3 files changed, 45 insertions, 45 deletions
diff --git a/engines/wintermute/Base/scriptables/SXArray.cpp b/engines/wintermute/Base/scriptables/SXArray.cpp index 72c848f747..0b3c6a80d5 100644 --- a/engines/wintermute/Base/scriptables/SXArray.cpp +++ b/engines/wintermute/Base/scriptables/SXArray.cpp @@ -45,15 +45,15 @@ CSXArray::CSXArray(CBGame *inGame, CScStack *stack): CBScriptable(inGame) { _length = 0;
_values = new CScValue(Game);
- int NumParams = stack->pop()->getInt(0);
-
- if (NumParams == 1) _length = stack->pop()->getInt(0);
- else if (NumParams > 1) {
- _length = NumParams;
- char ParamName[20];
- for (int i = 0; i < NumParams; i++) {
- sprintf(ParamName, "%d", i);
- _values->setProp(ParamName, stack->pop());
+ int numParams = stack->pop()->getInt(0);
+
+ if (numParams == 1) _length = stack->pop()->getInt(0);
+ else if (numParams > 1) {
+ _length = numParams;
+ char paramName[20];
+ for (int i = 0; i < numParams; i++) {
+ sprintf(paramName, "%d", i);
+ _values->setProp(paramName, stack->pop());
}
}
}
@@ -74,21 +74,21 @@ CSXArray::~CSXArray() { //////////////////////////////////////////////////////////////////////////
const char *CSXArray::scToString() {
- static char Dummy[32768];
- strcpy(Dummy, "");
- char PropName[20];
+ static char dummy[32768]; // TODO: Get rid of static.
+ strcpy(dummy, "");
+ char propName[20];
for (int i = 0; i < _length; i++) {
- sprintf(PropName, "%d", i);
- CScValue *val = _values->getProp(PropName);
+ sprintf(propName, "%d", i);
+ CScValue *val = _values->getProp(propName);
if (val) {
- if (strlen(Dummy) + strlen(val->getString()) < 32768) {
- strcat(Dummy, val->getString());
+ if (strlen(dummy) + strlen(val->getString()) < 32768) {
+ strcat(dummy, val->getString());
}
}
- if (i < _length - 1 && strlen(Dummy) + 1 < 32768) strcat(Dummy, ",");
+ if (i < _length - 1 && strlen(dummy) + 1 < 32768) strcat(dummy, ",");
}
- return Dummy;
+ return dummy;
}
@@ -98,13 +98,13 @@ HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi // Push
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Push") == 0) {
- int NumParams = stack->pop()->getInt(0);
- char ParamName[20];
+ int numParams = stack->pop()->getInt(0);
+ char paramName[20];
- for (int i = 0; i < NumParams; i++) {
+ for (int i = 0; i < numParams; i++) {
_length++;
- sprintf(ParamName, "%d", _length - 1);
- _values->setProp(ParamName, stack->pop(), true);
+ sprintf(paramName, "%d", _length - 1);
+ _values->setProp(paramName, stack->pop(), true);
}
stack->pushInt(_length);
@@ -119,10 +119,10 @@ HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi stack->correctParams(0);
if (_length > 0) {
- char ParamName[20];
- sprintf(ParamName, "%d", _length - 1);
- stack->push(_values->getProp(ParamName));
- _values->deleteProp(ParamName);
+ char paramName[20];
+ sprintf(paramName, "%d", _length - 1);
+ stack->push(_values->getProp(paramName));
+ _values->deleteProp(paramName);
_length--;
} else stack->pushNULL();
@@ -158,7 +158,7 @@ CScValue *CSXArray::scGetProperty(const char *name) { //////////////////////////////////////////////////////////////////////////
else {
char ParamName[20];
- if (ValidNumber(name, ParamName)) {
+ if (validNumber(name, ParamName)) {
return _values->getProp(ParamName);
} else return _scValue;
}
@@ -188,11 +188,11 @@ HRESULT CSXArray::scSetProperty(const char *name, CScValue *value) { // [number]
//////////////////////////////////////////////////////////////////////////
else {
- char ParamName[20];
- if (ValidNumber(name, ParamName)) {
- int Index = atoi(ParamName);
+ char paramName[20];
+ if (validNumber(name, paramName)) {
+ int Index = atoi(paramName);
if (Index >= _length) _length = Index + 1;
- return _values->setProp(ParamName, value);
+ return _values->setProp(paramName, value);
} else return E_FAIL;
}
}
@@ -210,28 +210,28 @@ HRESULT CSXArray::persist(CBPersistMgr *persistMgr) { //////////////////////////////////////////////////////////////////////////
-bool CSXArray::ValidNumber(const char *OrigStr, char *OutStr) {
+bool CSXArray::validNumber(const char *origStr, char *outStr) {
bool IsNumber = true;
- for (int i = 0; i < strlen(OrigStr); i++) {
- if (!(OrigStr[i] >= '0' && OrigStr[i] <= '9')) {
+ for (int i = 0; i < strlen(origStr); i++) {
+ if (!(origStr[i] >= '0' && origStr[i] <= '9')) {
IsNumber = false;
break;
}
}
if (IsNumber) {
- int Index = atoi(OrigStr);
- sprintf(OutStr, "%d", Index);
+ int Index = atoi(origStr);
+ sprintf(outStr, "%d", Index);
return true;
} else return false;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CSXArray::Push(CScValue *Val) {
- char ParamName[20];
+HRESULT CSXArray::push(CScValue *val) {
+ char paramName[20];
_length++;
- sprintf(ParamName, "%d", _length - 1);
- _values->setProp(ParamName, Val, true);
+ sprintf(paramName, "%d", _length - 1);
+ _values->setProp(paramName, val, true);
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/SXArray.h b/engines/wintermute/Base/scriptables/SXArray.h index deb52bd86a..81599892d9 100644 --- a/engines/wintermute/Base/scriptables/SXArray.h +++ b/engines/wintermute/Base/scriptables/SXArray.h @@ -35,10 +35,10 @@ namespace WinterMute { class CSXArray : public CBScriptable {
public:
- HRESULT Push(CScValue *Val);
- bool ValidNumber(const char *OrigStr, char *OutStr);
+ HRESULT push(CScValue *Val);
+ bool validNumber(const char *origStr, char *outStr);
DECLARE_PERSISTENT(CSXArray, CBScriptable)
- CSXArray(CBGame *inGame, CScStack *Stack);
+ CSXArray(CBGame *inGame, CScStack *stack);
CSXArray(CBGame *inGame);
virtual ~CSXArray();
CScValue *scGetProperty(const char *name);
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp index 41aa395949..1e3b1b0bf9 100644 --- a/engines/wintermute/Base/scriptables/SXString.cpp +++ b/engines/wintermute/Base/scriptables/SXString.cpp @@ -303,7 +303,7 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th else
Val = new CScValue(Game, StringUtil::WideToAnsi(part).c_str());
- Array->Push(Val);
+ Array->push(Val);
delete Val;
Val = NULL;
}
|