Const correctness

svn-id: r41790
This commit is contained in:
Sven Hesse 2009-06-23 01:19:37 +00:00
parent 8bd5c0ceba
commit 4fa11436a0
2 changed files with 8 additions and 8 deletions

View file

@ -119,7 +119,7 @@ bool Script::skip(int32 offset) {
return seek(offset, SEEK_CUR); return seek(offset, SEEK_CUR);
} }
int32 Script::getOffset(byte *ptr) { int32 Script::getOffset(byte *ptr) const {
if (!_totData) if (!_totData)
return -1; return -1;
@ -129,7 +129,7 @@ int32 Script::getOffset(byte *ptr) {
return ptr - _totData; return ptr - _totData;
} }
byte *Script::getData(int32 offset) { byte *Script::getData(int32 offset) const {
if (!_totData) if (!_totData)
return 0; return 0;
if ((offset < 0) || (((uint32) offset) >= _totSize)) if ((offset < 0) || (((uint32) offset) >= _totSize))
@ -303,11 +303,11 @@ bool Script::evalBoolResult() {
return false; return false;
} }
int32 Script::getResultInt() { int32 Script::getResultInt() const {
return _expression->getResultInt(); return _expression->getResultInt();
} }
char *Script::getResultStr() { char *Script::getResultStr() const {
return _expression->getResultStr(); return _expression->getResultStr();
} }

View file

@ -85,13 +85,13 @@ public:
bool evalBoolResult(); bool evalBoolResult();
// Accessing the result of expressions // Accessing the result of expressions
int32 getResultInt(); int32 getResultInt() const;
char *getResultStr(); char *getResultStr() const;
/** Returns the offset the specified pointer is within the script data. */ /** Returns the offset the specified pointer is within the script data. */
int32 getOffset(byte *ptr); int32 getOffset(byte *ptr) const;
/** Returns the data pointer to the offset. */ /** Returns the data pointer to the offset. */
byte *getData(int32 offset); byte *getData(int32 offset) const;
/** Returns the raw data pointer. */ /** Returns the raw data pointer. */
byte *getData(); byte *getData();