Skip to content

Commit

Permalink
DIRECTOR: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Sep 5, 2016
1 parent 5727c90 commit b35c555
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion engines/director/lingo/lingo-builtins.cpp
Expand Up @@ -183,7 +183,7 @@ void Lingo::dropStack(int nargs) {
pop();
}

void Lingo::drop(int num) {
void Lingo::drop(uint num) {
if (num > _stack.size() - 1) {
warning("Incorrect number of elements to drop from stack: %d > %d", num, _stack.size() - 1);
return;
Expand Down
10 changes: 5 additions & 5 deletions engines/director/lingo/lingo-code.cpp
Expand Up @@ -778,7 +778,7 @@ void Lingo::c_whencode() {
g_lingo->define(eventname, start, 0, NULL, end);

if (debugChannelSet(3, kDebugLingoExec)) {
int pc = start;
uint pc = start;
while (pc <= end) {
Common::String instr = g_lingo->decodeInstruction(pc, &pc);
debugC(3, kDebugLingoExec, "[%5d] %s", pc, instr.c_str());
Expand Down Expand Up @@ -855,7 +855,7 @@ void Lingo::c_call() {
}

void Lingo::call(Common::String name, int nargs) {
bool drop = false;
bool dropArgs = false;

Symbol *sym;

Expand All @@ -869,7 +869,7 @@ void Lingo::call(Common::String name, int nargs) {

if (!g_lingo->_handlers.contains(name)) {
warning("Call to undefined handler '%s'. Dropping %d stack items", name.c_str(), nargs);
drop = true;
dropArgs = true;
} else {
sym = g_lingo->_handlers[name];

Expand All @@ -879,11 +879,11 @@ void Lingo::call(Common::String name, int nargs) {
else
warning("Incorrect number of arguments to handler '%s', expecting %d or %d. Dropping %d stack items", name.c_str(), sym->nargs, sym->maxArgs, nargs);

drop = true;
dropArgs = true;
}
}

if (drop) {
if (dropArgs) {
for (int i = 0; i < nargs; i++)
g_lingo->pop();

Expand Down
4 changes: 2 additions & 2 deletions engines/director/lingo/lingo-codegen.cpp
Expand Up @@ -51,7 +51,7 @@

namespace Director {

void Lingo::execute(int pc) {
void Lingo::execute(uint pc) {
for(_pc = pc; (*_currentScript)[_pc] != STOP && !_returning;) {
Common::String instr = decodeInstruction(_pc);

Expand Down Expand Up @@ -79,7 +79,7 @@ void Lingo::printStack(const char *s) {
debugC(5, kDebugLingoExec, "%s", stack.c_str());
}

Common::String Lingo::decodeInstruction(int pc, int *newPc) {
Common::String Lingo::decodeInstruction(uint pc, uint *newPc) {
Symbol sym;
Common::String res;

Expand Down
4 changes: 2 additions & 2 deletions engines/director/lingo/lingo.cpp
Expand Up @@ -197,7 +197,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
parse(chunk.c_str());

if (debugChannelSet(3, kDebugLingoCompile)) {
int pc = 0;
uint pc = 0;
while (pc < _currentScript->size()) {
Common::String instr = decodeInstruction(pc, &pc);
debugC(3, kDebugLingoCompile, "[%5d] %s", pc, instr.c_str());
Expand Down Expand Up @@ -225,7 +225,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) {
if (_currentScript->size() && !_hadError)
Common::hexdump((byte *)&_currentScript->front(), _currentScript->size() * sizeof(inst));

int pc = 0;
uint pc = 0;
while (pc < _currentScript->size()) {
Common::String instr = decodeInstruction(pc, &pc);
debugC(3, kDebugLingoCompile, "[%5d] %s", pc, instr.c_str());
Expand Down
8 changes: 4 additions & 4 deletions engines/director/lingo/lingo.h
Expand Up @@ -175,7 +175,7 @@ class Lingo {
void addCode(const char *code, ScriptType type, uint16 id);
void executeScript(ScriptType type, uint16 id);
void printStack(const char *s);
Common::String decodeInstruction(int pc, int *newPC = NULL);
Common::String decodeInstruction(uint pc, uint *newPC = NULL);

ScriptType event2script(LEvent ev);

Expand All @@ -193,7 +193,7 @@ class Lingo {
const char *findNextDefinition(const char *s);

public:
void execute(int pc);
void execute(uint pc);
void pushContext();
void popContext();
Symbol *lookupVar(const char *name, bool create = true, bool putInGlobalList = false);
Expand Down Expand Up @@ -296,7 +296,7 @@ class Lingo {
void printStubWithArglist(const char *funcname, int nargs);
void convertVOIDtoString(int arg, int nargs);
void dropStack(int nargs);
void drop(int num);
void drop(uint num);

static void b_abs(int nargs);
static void b_atan(int nargs);
Expand Down Expand Up @@ -445,7 +445,7 @@ class Lingo {

FuncHash _functions;

int _pc;
uint _pc;

StackData _stack;

Expand Down
2 changes: 1 addition & 1 deletion engines/director/score.cpp
Expand Up @@ -820,7 +820,7 @@ void Score::processEvents() {

Common::Event event;

int endTime = g_system->getMillis() + 200;
uint endTime = g_system->getMillis() + 200;

while (g_system->getMillis() < endTime) {
while (g_system->getEventManager()->pollEvent(event)) {
Expand Down

0 comments on commit b35c555

Please sign in to comment.