diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 3 | ||||
-rw-r--r-- | engines/sci/engine/kfile.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/scriptconsole.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 8 | ||||
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 6 | ||||
-rw-r--r-- | engines/sci/engine/vm.cpp | 4 | ||||
-rw-r--r-- | engines/sci/gfx/resource/sci_pic_0.cpp | 4 | ||||
-rw-r--r-- | engines/sci/gfx/resource/sci_view_1.cpp | 2 | ||||
-rw-r--r-- | engines/sci/gfx/widgets.cpp | 4 | ||||
-rw-r--r-- | engines/sci/include/kernel.h | 2 | ||||
-rw-r--r-- | engines/sci/include/resource.h | 2 |
11 files changed, 19 insertions, 20 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 33f9df7ddf..470f407ac6 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -699,8 +699,7 @@ void kernel_compile_signature(const char **s) { v = 0; if (ellipsis) { - sciprintf("INTERNAL ERROR when compiling kernel function signature '%s': non-terminal ellipsis\n", *s, *src); - exit(1); + error("Failed compiling kernel function signature '%s': non-terminal ellipsis '%c'\n", *s, *src); } do { diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 041784ee27..9ed22989bd 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -119,7 +119,7 @@ static FILE *f_open_mirrored(state_t *s, char *fname) { int ret; ret = write(fd, buf, fsize); if (ret < fsize) { - sciprintf("kfile.c: f_open_mirrored(): Warning: Could not write all %ld bytes to '%s' in '%s' (only wrote %ld)\n", + sciprintf("kfile.c: f_open_mirrored(): Warning: Could not write all %ld bytes to '%s' in '%s' (only wrote %d)\n", (long)fsize, fname, s->work_dir, ret); } diff --git a/engines/sci/engine/scriptconsole.cpp b/engines/sci/engine/scriptconsole.cpp index 8b7208a8e3..286671bf8f 100644 --- a/engines/sci/engine/scriptconsole.cpp +++ b/engines/sci/engine/scriptconsole.cpp @@ -754,7 +754,7 @@ static void _cmd_print_command(cmd_mm_entry_t *data, int full) { const char *paramseeker = ((cmd_command_t *)data)->param; if (full) { - sciprintf("SYNOPSIS\n\n %s ", data->name, paramseeker); + sciprintf("SYNOPSIS\n\n %s (%s) ", data->name, paramseeker); while (*paramseeker) { switch (*paramseeker) { diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index d3cd82a22f..c669bc8eca 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -394,7 +394,7 @@ static void _c_single_seg_info(state_t *s, mem_obj_t *mobj) { case MEM_OBJ_SCRIPT: { int i; script_t *scr = &(mobj->data.script); - sciprintf("script.%03d locked by %d, bufsize=%d (%x)\n", scr->nr, scr->lockers, scr->buf_size, scr->buf_size); + sciprintf("script.%03d locked by %d, bufsize=%d (%x)\n", scr->nr, scr->lockers, (uint)scr->buf_size, (uint)scr->buf_size); if (scr->export_table) sciprintf(" Exports: %4d at %d\n", scr->exports_nr, ((byte *)scr->export_table) - ((byte *)scr->buf)); else @@ -629,7 +629,7 @@ static int c_vr(state_t *s) { break; default: - sciprintf("unknown.\n", type); + sciprintf("unknown type %d.\n", type); } @@ -1364,7 +1364,7 @@ reg_t disassemble(state_t *s, reg_t pos, int print_bw_tag, int print_bytecode) { param_value = 0xffff & (scr[retval.offset] | (scr[retval.offset+1] << 8)); retval.offset += 2; } - sciprintf(opsize ? " %02x [%04x]" : " %04x", param_value); + sciprintf(opsize ? " %02x" : " %04x", param_value); break; case Script_SRelative: @@ -2653,7 +2653,7 @@ int c_bpe(state_t *s) { int c_bplist(state_t *s) { breakpoint_t *bp; int i = 0; - long bpdata; + int bpdata; bp = s->bp_list; while (bp) { diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index eb1b50ea41..b3bad34b42 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -1076,7 +1076,7 @@ void sm_script_initialise_locals(seg_manager_t *self, reg_t location) { scr->locals_offset = location.offset; if (!(location.offset + count * 2 + 1 < scr->buf_size)) { - sciprintf("Locals extend beyond end of script: offset %04x, count %x vs size %x\n", location.offset, count, scr->buf_size); + sciprintf("Locals extend beyond end of script: offset %04x, count %x vs size %x\n", location.offset, count, (uint)scr->buf_size); count = (scr->buf_size - location.offset) >> 1; } @@ -1329,7 +1329,7 @@ byte *sm_dereference(seg_manager_t *self, reg_t pointer, int *size) { case MEM_OBJ_SCRIPT: if (pointer.offset > mobj->data.script.buf_size) { sciprintf("Error: Attempt to dereference invalid pointer "PREG" into script segment (script size=%d)\n", - PRINT_REG(pointer), mobj->data.script.buf_size); + PRINT_REG(pointer), (uint)mobj->data.script.buf_size); return NULL; } if (size) @@ -1363,7 +1363,7 @@ byte *sm_dereference(seg_manager_t *self, reg_t pointer, int *size) { } case MEM_OBJ_RESERVED: - sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'", mobj->data.reserved); + sciprintf("Error: Trying to dereference pointer "PREG" to reserved segment `%s'", PRINT_REG(pointer), mobj->data.reserved); return NULL; break; diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index d272f68e66..6770c32cb9 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -221,7 +221,7 @@ reg_t get_class_address(state_t *s, int classnr, int lock, reg_t caller) { if (!the_class->reg.segment) { sciprintf("[VM] Trying to instantiate class %x by instantiating script 0x%x (%03d) failed;" - " Entering debugger.\n", classnr, the_class->script); + " Entering debugger.\n", classnr, the_class->script, the_class->script); script_error_flag = script_debug_flag = 1; return NULL_REG; } @@ -1648,7 +1648,7 @@ reg_t script_lookup_export(state_t *s, int script_nr, int export_index) { #ifndef DISABLE_VALIDATIONS if (!seg) { CORE_ERROR("EXPORTS", "Script invalid or not loaded"); - sciprintf("Script was script.03d (0x%x)\n", + sciprintf("Script was script.%03d (0x%x)\n", script_nr, script_nr); return NULL_REG; } diff --git a/engines/sci/gfx/resource/sci_pic_0.cpp b/engines/sci/gfx/resource/sci_pic_0.cpp index 41ac4a1110..cfe60a585b 100644 --- a/engines/sci/gfx/resource/sci_pic_0.cpp +++ b/engines/sci/gfx/resource/sci_pic_0.cpp @@ -1832,7 +1832,7 @@ gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, if (!pic->internal) { pic->internal = sci_malloc(16 * sizeof(int)); } else { - GFXERROR("pic->internal is not NULL (%08x); this only occurs with overlaid pics, otherwise it's a bug", pic->internal); + GFXERROR("pic->internal is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", pic->internal); } pri_table = (int*)pic->internal; @@ -1854,7 +1854,7 @@ gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, if (!pic->internal) { pic->internal = sci_malloc(16 * sizeof(int)); } else { - GFXERROR("pic->internal is not NULL (%08x); possible memory corruption", pic->internal); + GFXERROR("pic->internal is not NULL (%p); possible memory corruption", pic->internal); } pri_table = (int*)pic->internal; diff --git a/engines/sci/gfx/resource/sci_view_1.cpp b/engines/sci/gfx/resource/sci_view_1.cpp index aef02b694b..eb926c5eae 100644 --- a/engines/sci/gfx/resource/sci_view_1.cpp +++ b/engines/sci/gfx/resource/sci_view_1.cpp @@ -388,7 +388,7 @@ gfxr_draw_view1(int id, byte *resource, int size, gfx_pixmap_color_t *static_pal int loop_offset = get_uint_16(resource + V1_FIRST_LOOP_OFFSET + (i << 1)); if (loop_offset >= size) { - GFXERROR("View %04x:(%d) supposed to be at illegal offset 0x%04x\n", id, i); + GFXERROR("View %04x:(%d) supposed to be at illegal offset 0x%04x\n", id, i, loop_offset); error_token = 1; } diff --git a/engines/sci/gfx/widgets.cpp b/engines/sci/gfx/widgets.cpp index 777d567a32..b01ab3846b 100644 --- a/engines/sci/gfx/widgets.cpp +++ b/engines/sci/gfx/widgets.cpp @@ -889,7 +889,7 @@ _gfxwop_some_view_print(gfxw_widget_t *widget, int indentation, const char *type _gfxw_print_widget(widget, indentation); sciprintf(type_string); - sciprintf(" SORT=%d z=%d seq=%d (%d/%d/%d)@(%d,%d)[p:%d,c:%d]; sig[%04x@%04x]", view->force_precedence, view->z, + sciprintf(" SORT=%d z=%d seq=%d (%d/%d/%d)@(%d,%d)[p:%d,c:%d]; sig[%04x@%p]", view->force_precedence, view->z, view->sequence, view->view, view->loop, view->cel, view->pos.x, view->pos.y, (view->color.mask & GFX_MASK_PRIORITY) ? view->color.priority : -1, (view->color.mask & GFX_MASK_CONTROL) ? view->color.control : -1, @@ -1973,7 +1973,7 @@ _gfxwop_port_free(gfxw_widget_t *widget) { if (visual->port_refs[ID] != port) { GFXWARN("While freeing port %d: Port is at %p, but port list indicates %p", - ID, port, visual->port_refs[ID]); + ID, (void *)port, (void *)visual->port_refs[ID]); } else visual->port_refs[ID] = NULL; } diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h index e9467e246e..071aee7b46 100644 --- a/engines/sci/include/kernel.h +++ b/engines/sci/include/kernel.h @@ -154,7 +154,7 @@ is_object(struct _state *s, reg_t obj); void _SCIkvprintf(FILE *file, const char *format, va_list args); void -_SCIkprintf(FILE *file, const char *format, ...); +_SCIkprintf(FILE *file, const char *format, ...) GCC_PRINTF(2, 3); diff --git a/engines/sci/include/resource.h b/engines/sci/include/resource.h index ada1e4823f..ebaa23f642 100644 --- a/engines/sci/include/resource.h +++ b/engines/sci/include/resource.h @@ -214,7 +214,7 @@ sci_open(const char *fname, int flags); int -sciprintf(const char *fmt, ...); +sciprintf(const char *fmt, ...) GCC_PRINTF(1, 2); #define gfxprintf sciprintf /* Prints a string to the console stack ** Parameters: fmt: a printf-style format string |