diff options
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/grammar.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kernel.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 7 | ||||
-rw-r--r-- | engines/sci/engine/klists.cpp | 21 | ||||
-rw-r--r-- | engines/sci/engine/said.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/said.y | 8 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 10 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.h | 8 | ||||
-rw-r--r-- | engines/sci/engine/stringfrag.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 26 |
11 files changed, 42 insertions, 56 deletions
diff --git a/engines/sci/engine/grammar.cpp b/engines/sci/engine/grammar.cpp index 19ceded6ce..e44a02ef30 100644 --- a/engines/sci/engine/grammar.cpp +++ b/engines/sci/engine/grammar.cpp @@ -237,7 +237,7 @@ void vocab_free_rule_list(parse_rule_list_t *list) { } } -static inline int _rules_equal_p(parse_rule_t *r1, parse_rule_t *r2) { +static int _rules_equal_p(parse_rule_t *r1, parse_rule_t *r2) { if ((r1->id != r2->id) || (r1->length != r2->length) || (r1->first_special != r2->first_special)) return 0; diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index b9434aa937..34912d2dc0 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -922,7 +922,7 @@ int kernel_matches_signature(EngineState *s, const char *sig, int argc, reg_t *a return (*sig == 0 || (*sig & KSIG_ELLIPSIS)); } -static inline void *_kernel_dereference_pointer(EngineState *s, reg_t pointer, int entries, int align) { +static void *_kernel_dereference_pointer(EngineState *s, reg_t pointer, int entries, int align) { int maxsize; void *retval = s->seg_manager->dereference(pointer, &maxsize); diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 62230559e5..e1dcfad108 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -401,11 +401,6 @@ reg_t kMoveCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) { return s->r_acc; } -static inline void _ascertain_port_contents(gfxw_port_t *port) { - if (!port->contents) - port->contents = (gfxw_widget_t *) gfxw_new_list(port->bounds, 0); -} - reg_t kShow(EngineState *s, int funct_nr, int argc, reg_t *argv) { int old_map = s->pic_visible_map; @@ -1672,7 +1667,7 @@ static void draw_rect_to_control_map(EngineState *s, abs_rect_t abs_zone) { ADD_TO_CURRENT_PICTURE_PORT(box); } -static inline void draw_obj_to_control_map(EngineState *s, gfxw_dyn_view_t *view) { +static void draw_obj_to_control_map(EngineState *s, gfxw_dyn_view_t *view) { reg_t obj = make_reg(view->ID, view->subID); if (!is_object(s, obj)) diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index a3e0cc0baa..f49c6a06c9 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -28,12 +28,7 @@ namespace Sci { -#ifdef LOOKUP_NODE -# undef LOOKUP_NODE -# define LOOKUP_NODE(addr) inline_lookup_node(s, (addr), __FILE__, __LINE__) -#endif - -inline Node *inline_lookup_node(EngineState *s, reg_t addr, const char *file, int line) { +Node *lookup_node(EngineState *s, reg_t addr, const char *file, int line) { MemObject *mobj; NodeTable *nt; @@ -61,13 +56,9 @@ inline Node *inline_lookup_node(EngineState *s, reg_t addr, const char *file, in return &(nt->table[addr.offset].entry); } -Node *lookup_node(EngineState *s, reg_t addr, const char *file, int line) { - return inline_lookup_node(s, addr, file, line); -} - #define LOOKUP_NULL_LIST(addr) _lookup_list(s, addr, __FILE__, __LINE__, 1) -inline List *_lookup_list(EngineState *s, reg_t addr, const char *file, int line, int may_be_null) { +List *_lookup_list(EngineState *s, reg_t addr, const char *file, int line, int may_be_null) { MemObject *mobj; ListTable *lt; @@ -104,7 +95,7 @@ List *lookup_list(EngineState *s, reg_t addr, const char *file, int line) { #else -static inline int sane_nodep(EngineState *s, reg_t addr) { +static int sane_nodep(EngineState *s, reg_t addr) { int have_prev = 0; reg_t prev = addr; @@ -196,7 +187,7 @@ reg_t kDisposeList(EngineState *s, int funct_nr, int argc, reg_t *argv) { return s->r_acc; } -inline reg_t _k_new_node(EngineState *s, reg_t value, reg_t key) { +reg_t _k_new_node(EngineState *s, reg_t value, reg_t key) { reg_t nodebase; Node *n = s->seg_manager->alloc_Node(&nodebase); @@ -253,7 +244,7 @@ reg_t kEmptyList(EngineState *s, int funct_nr, int argc, reg_t *argv) { return make_reg(0, ((l) ? IS_NULL_REG(l->first) : 0)); } -inline void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) { +void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) { List *l = LOOKUP_LIST(listbase); Node *new_n = LOOKUP_NODE(nodebase); @@ -276,7 +267,7 @@ inline void _k_add_to_front(EngineState *s, reg_t listbase, reg_t nodebase) { l->first = nodebase; } -inline void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) { +void _k_add_to_end(EngineState *s, reg_t listbase, reg_t nodebase) { List *l = LOOKUP_LIST(listbase); Node *new_n = LOOKUP_NODE(nodebase); diff --git a/engines/sci/engine/said.cpp b/engines/sci/engine/said.cpp index f5759b090b..4c7cdbbe24 100644 --- a/engines/sci/engine/said.cpp +++ b/engines/sci/engine/said.cpp @@ -1903,13 +1903,13 @@ static int yylex(void) { return retval; } -static inline int said_next_node() { +static int said_next_node() { return ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++; } #define SAID_NEXT_NODE said_next_node() -static inline int said_leaf_node(tree_t pos, int value) { +static int said_leaf_node(tree_t pos, int value) { said_tree[pos].type = PARSE_TREE_NODE_LEAF; if (value != VALUE_IGNORE) @@ -1918,7 +1918,7 @@ static inline int said_leaf_node(tree_t pos, int value) { return pos; } -static inline int said_branch_node(tree_t pos, int left, int right) { +static int said_branch_node(tree_t pos, int left, int right) { said_tree[pos].type = PARSE_TREE_NODE_BRANCH; if (left != VALUE_IGNORE) @@ -2180,7 +2180,7 @@ static void aug_find_words(parse_tree_node_t *tree, int startpos, int *base_word } -static inline int aug_contains_word(int *list, int length, int word) { +static int aug_contains_word(int *list, int length, int word) { int i; if (word == ANYWORD) diff --git a/engines/sci/engine/said.y b/engines/sci/engine/said.y index d2a1c2cc84..d2144e76da 100644 --- a/engines/sci/engine/said.y +++ b/engines/sci/engine/said.y @@ -259,13 +259,13 @@ static int yylex(void) { return retval; } -static inline int said_next_node() { +static int said_next_node() { return ((said_tree_pos == 0) || (said_tree_pos >= VOCAB_TREE_NODES)) ? said_tree_pos = 0 : said_tree_pos++; } #define SAID_NEXT_NODE said_next_node() -static inline int said_leaf_node(tree_t pos, int value) { +static int said_leaf_node(tree_t pos, int value) { said_tree[pos].type = PARSE_TREE_NODE_LEAF; if (value != VALUE_IGNORE) @@ -274,7 +274,7 @@ static inline int said_leaf_node(tree_t pos, int value) { return pos; } -static inline int said_branch_node(tree_t pos, int left, int right) { +static int said_branch_node(tree_t pos, int left, int right) { said_tree[pos].type = PARSE_TREE_NODE_BRANCH; if (left != VALUE_IGNORE) @@ -536,7 +536,7 @@ static void aug_find_words(parse_tree_node_t *tree, int startpos, int *base_word } -static inline int aug_contains_word(int *list, int length, int word) { +static int aug_contains_word(int *list, int length, int word) { int i; if (word == ANYWORD) diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 27fd60bbf6..388ca6b585 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -101,7 +101,7 @@ const char *_debug_get_input_default() { return inputbuf; } -static inline int _parse_ticks(byte *data, int *offset_p, int size) { +static int _parse_ticks(byte *data, int *offset_p, int size) { int ticks = 0; int tempticks; int offset = 0; diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 35297cb077..8d58b94fc4 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -54,7 +54,7 @@ namespace Sci { #define INVALID_SCRIPT_ID -1 -inline int SegManager::findFreeId(int *id) { +int SegManager::findFreeId(int *id) { bool was_added = false; int retval = 0; @@ -719,7 +719,7 @@ static void SegManager::sm_set_variables(reg_t reg, int obj_index, reg_t variabl } #endif -inline int SegManager::relocateBlock(reg_t *block, int block_location, int block_items, SegmentId segment, int location) { +int SegManager::relocateBlock(reg_t *block, int block_location, int block_items, SegmentId segment, int location) { int rel = location - block_location; int index; @@ -742,14 +742,14 @@ inline int SegManager::relocateBlock(reg_t *block, int block_location, int block return 1; } -inline int SegManager::relocateLocal(Script *scr, SegmentId segment, int location) { +int SegManager::relocateLocal(Script *scr, SegmentId segment, int location) { if (scr->locals_block) return relocateBlock(scr->locals_block->locals, scr->locals_offset, scr->locals_block->nr, segment, location); else return 0; // No hands, no cookies } -inline int SegManager::relocateObject(Object *obj, SegmentId segment, int location) { +int SegManager::relocateObject(Object *obj, SegmentId segment, int location) { return relocateBlock(obj->variables, obj->pos.offset, obj->variables_nr, segment, location); } @@ -1186,7 +1186,7 @@ void SegManager::scriptFreeUnusedObjects(SegmentId seg) { } /* -static inline char *SegManager::dynprintf(char *msg, ...) { +static char *SegManager::dynprintf(char *msg, ...) { va_list argp; char *buf = (char *)sci_malloc(strlen(msg) + 100); diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h index 12d2ec72be..ba7fcb5795 100644 --- a/engines/sci/engine/seg_manager.h +++ b/engines/sci/engine/seg_manager.h @@ -431,11 +431,11 @@ private: Hunk *alloc_Hunk(reg_t *); void free_Hunk(reg_t addr); - inline int relocateLocal(Script *scr, SegmentId segment, int location); - inline int relocateBlock(reg_t *block, int block_location, int block_items, SegmentId segment, int location); - inline int relocateObject(Object *obj, SegmentId segment, int location); + int relocateLocal(Script *scr, SegmentId segment, int location); + int relocateBlock(reg_t *block, int block_location, int block_items, SegmentId segment, int location); + int relocateObject(Object *obj, SegmentId segment, int location); - inline int findFreeId(int *id); + int findFreeId(int *id); static void setScriptSize(MemObject *mem, EngineState *s, int script_nr); Object *scriptObjInit0(EngineState *s, reg_t obj_pos); Object *scriptObjInit11(EngineState *s, reg_t obj_pos); diff --git a/engines/sci/engine/stringfrag.cpp b/engines/sci/engine/stringfrag.cpp index 47dcb297bd..e39f702526 100644 --- a/engines/sci/engine/stringfrag.cpp +++ b/engines/sci/engine/stringfrag.cpp @@ -166,7 +166,7 @@ void stringfrag_append_char(EngineState *s, reg_t pos, unsigned char c) { internal_stringfrag_append_char(s, buffer, c); } -inline void stringfrag_setchar(reg_t *buffer, int pos, int offset, unsigned char c) { +void stringfrag_setchar(reg_t *buffer, int pos, int offset, unsigned char c) { switch (offset) { case 0 : buffer[pos].offset = (buffer[pos].offset & 0x00ff) | (c << 8); @@ -177,7 +177,7 @@ inline void stringfrag_setchar(reg_t *buffer, int pos, int offset, unsigned char } } -inline unsigned char stringfrag_getchar(reg_t *buffer, int pos, int offset) { +unsigned char stringfrag_getchar(reg_t *buffer, int pos, int offset) { switch (offset) { case 0 : return buffer[pos].offset >> 8; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 17ff95d0a2..515f3e46d4 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -65,7 +65,7 @@ static reg_t _dummy_register; #ifndef DISABLE_VALIDATIONS -static inline reg_t &validate_property(Object *obj, int index) { +static reg_t &validate_property(Object *obj, int index) { if (!obj) { if (sci_debug_flags & 4) sciprintf("[VM] Sending to disposed object!\n"); @@ -85,7 +85,7 @@ static inline reg_t &validate_property(Object *obj, int index) { return obj->variables[index]; } -static inline StackPtr validate_stack_addr(EngineState *s, StackPtr sp) { +static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) { if (sp >= s->stack_base && sp < s->stack_top) return sp; @@ -95,7 +95,7 @@ static inline StackPtr validate_stack_addr(EngineState *s, StackPtr sp) { return 0; } -static inline int validate_arithmetic(reg_t reg) { +static int validate_arithmetic(reg_t reg) { if (reg.segment) { if (!_weak_validations) script_debug_flag = script_error_flag = 1; @@ -107,7 +107,7 @@ static inline int validate_arithmetic(reg_t reg) { return reg.offset; } -static inline int signed_validate_arithmetic(reg_t reg) { +static int signed_validate_arithmetic(reg_t reg) { if (reg.segment) { if (!_weak_validations) script_debug_flag = script_error_flag = 1; @@ -122,7 +122,7 @@ static inline int signed_validate_arithmetic(reg_t reg) { return reg.offset; } -static inline int validate_variable(reg_t *r, reg_t *stack_base, int type, int max, int index, int line) { +static int validate_variable(reg_t *r, reg_t *stack_base, int type, int max, int index, int line) { const char *names[4] = {"global", "local", "temp", "param"}; if (index < 0 || index >= max) { @@ -154,14 +154,14 @@ static inline int validate_variable(reg_t *r, reg_t *stack_base, int type, int m return 0; } -static inline reg_t validate_read_var(reg_t *r, reg_t *stack_base, int type, int max, int index, int line, reg_t default_value) { +static reg_t validate_read_var(reg_t *r, reg_t *stack_base, int type, int max, int index, int line, reg_t default_value) { if (!validate_variable(r, stack_base, type, max, index, line)) return r[index]; else return default_value; } -static inline void validate_write_var(reg_t *r, reg_t *stack_base, int type, int max, int index, int line, reg_t value) { +static void validate_write_var(reg_t *r, reg_t *stack_base, int type, int max, int index, int line, reg_t value) { if (!validate_variable(r, stack_base, type, max, index, line)) r[index] = value; } @@ -252,7 +252,7 @@ reg_t get_class_address(EngineState *s, int classnr, int lock, reg_t caller) { #define OBJ_SUPERCLASS(s, reg) SEG_GET_HEAP(s, make_reg(reg.segment, reg.offset + SCRIPT_SUPERCLASS_OFFSET)) // Returns an object's superclass -inline ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackPtr sp, reg_t calling_obj, uint16 argc, StackPtr argp) { +ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackPtr sp, reg_t calling_obj, uint16 argc, StackPtr argp) { int seg; uint16 temp; @@ -534,7 +534,7 @@ void vm_handle_fatal_error(EngineState *s, int line, const char *file) { error("Could not recover, exitting...\n"); } -static inline Script *script_locate_by_segment(EngineState *s, SegmentId seg) { +static Script *script_locate_by_segment(EngineState *s, SegmentId seg) { MemObject *memobj = GET_SEGMENT(*s->seg_manager, seg, MEM_OBJ_SCRIPT); if (memobj) return &(memobj->data.script); @@ -571,7 +571,7 @@ static reg_t pointer_add(EngineState *s, reg_t base, int offset) { } } -static inline void gc_countdown(EngineState *s) { +static void gc_countdown(EngineState *s) { if (s->gc_countdown-- <= 0) { s->gc_countdown = script_gc_interval; run_gc(s); @@ -1476,7 +1476,7 @@ void run_vm(EngineState *s, int restoring) { } } -static inline int _obj_locate_varselector(EngineState *s, Object *obj, Selector slc) { +static int _obj_locate_varselector(EngineState *s, Object *obj, Selector slc) { // Determines if obj explicitly defines slc as a varselector // Returns -1 if not found @@ -1509,7 +1509,7 @@ static inline int _obj_locate_varselector(EngineState *s, Object *obj, Selector } } -static inline int _class_locate_funcselector(EngineState *s, Object *obj, Selector slc) { +static int _class_locate_funcselector(EngineState *s, Object *obj, Selector slc) { // Determines if obj is a class and explicitly defines slc as a funcselector // Does NOT say anything about obj's superclasses, i.e. failure may be // returned even if one of the superclasses defines the funcselector. @@ -1523,7 +1523,7 @@ static inline int _class_locate_funcselector(EngineState *s, Object *obj, Select return -1; // Failed } -static inline SelectorType _lookup_selector_function(EngineState *s, int seg_id, Object *obj, Selector selector_id, reg_t *fptr) { +static SelectorType _lookup_selector_function(EngineState *s, int seg_id, Object *obj, Selector selector_id, reg_t *fptr) { int index; // "recursive" lookup |