diff options
author | Willem Jan Palenstijn | 2009-02-21 14:11:41 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-02-21 14:11:41 +0000 |
commit | 34f90ac043230f049c58aaaf843ac347e0fc5c21 (patch) | |
tree | 36bc91c0e2ff560438f1c8e2f3e7565f82883e79 /engines/sci/engine/kernel.cpp | |
parent | 7ce7993c30225f3c28ce2a8d68935ef03a6e7175 (diff) | |
download | scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.gz scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.tar.bz2 scummvm-rg350-34f90ac043230f049c58aaaf843ac347e0fc5c21.zip |
revert large parts of r38621. error() is for fatal errors and does not return. warning() is not for debugging status messages.
svn-id: r38696
Diffstat (limited to 'engines/sci/engine/kernel.cpp')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 49d612e998..5e01f93695 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -356,7 +356,7 @@ static const char *argtype_description[] = { "Undetermined (WTF?)", "List", "Nod int kernel_oops(EngineState *s, const char *file, int line, const char *reason) { sciprintf("Kernel Oops in file %s, line %d: %s\n", file, line, reason); - error("Kernel Oops in file %s, line %d: %s", file, line, reason); + fprintf(stderr, "Kernel Oops in file %s, line %d: %s\n", file, line, reason); script_debug_flag = script_error_flag = 1; return 0; } @@ -389,7 +389,7 @@ byte *kmem(EngineState *s, reg_t handle) { hunk_table_t *ht = &(mobj->data.hunks); if (!mobj || !ENTRY_IS_VALID(ht, handle.offset)) { - error("Error: kmem() with invalid handle"); + SCIkwarn(SCIkERROR, "Error: kmem() with invalid handle\n"); return NULL; } @@ -508,7 +508,7 @@ reg_t kGetTime(EngineState *s, int funct_nr, int argc, reg_t *argv) { #ifdef WIN32 if (TIMERR_NOERROR != timeBeginPeriod(1)) { - error("timeBeginPeriod(1) failed in kGetTime"); + fprintf(stderr, "timeBeginPeriod(1) failed in kGetTime!\n"); } #endif // WIN32 @@ -517,7 +517,7 @@ reg_t kGetTime(EngineState *s, int funct_nr, int argc, reg_t *argv) { #ifdef WIN32 if (TIMERR_NOERROR != timeEndPeriod(1)) { - error("timeEndPeriod(1) failed in kGetTime"); + fprintf(stderr, "timeEndPeriod(1) failed in kGetTime!\n"); } #endif // WIN32 @@ -587,7 +587,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) { switch (UKPV(0)) { case K_MEMORY_ALLOCATE_CRITICAL : if (!sm_alloc_dynmem(&s->seg_manager, UKPV(1), "kMemory() critical", &s->r_acc)) { - error("Critical heap allocation failed"); + SCIkwarn(SCIkERROR, "Critical heap allocation failed\n"); script_error_flag = script_debug_flag = 1; } return s->r_acc; @@ -597,7 +597,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) { break; case K_MEMORY_FREE : if (sm_free_dynmem(&s->seg_manager, argv[1])) { - error("Attempt to kMemory::free() non-dynmem pointer "PREG"", PRINT_REG(argv[1])); + SCIkwarn(SCIkERROR, "Attempt to kMemory::free() non-dynmem pointer "PREG"!\n", PRINT_REG(argv[1])); } break; case K_MEMORY_MEMCPY : { @@ -622,7 +622,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) { byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2); if (!ref) { - error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1])); + SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1])); return s->r_acc; } if (s->seg_manager.heap[argv[1].segment]->type == MEM_OBJ_LOCALS) @@ -635,7 +635,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) { byte *ref = kernel_dereference_bulk_pointer(s, argv[1], 2); if (!ref) { - error("Attempt to poke invalid memory at "PREG"", PRINT_REG(argv[1])); + SCIkdebug(SCIkERROR, "Attempt to poke invalid memory at "PREG"!\n", PRINT_REG(argv[1])); return s->r_acc; } @@ -643,7 +643,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) { *((reg_t *) ref) = argv[2]; else { if (argv[2].segment) { - error("Attempt to poke memory reference "PREG" to "PREG"", PRINT_REG(argv[2]), PRINT_REG(argv[1])); + SCIkdebug(SCIkERROR, "Attempt to poke memory reference "PREG" to "PREG"!\n", PRINT_REG(argv[2]), PRINT_REG(argv[1])); return s->r_acc; putInt16(ref, argv[2].offset); // ??? } @@ -960,12 +960,12 @@ static inline void *_kernel_dereference_pointer(EngineState *s, reg_t pointer, i void *retval = sm_dereference(&s->seg_manager, pointer, &maxsize); if (pointer.offset & (align - 1)) { - error("Unaligned pointer read: "PREG" expected with %d alignment", PRINT_REG(pointer), align); + SCIkdebug(SCIkERROR, "Unaligned pointer read: "PREG" expected with %d alignment!\n", PRINT_REG(pointer), align); return NULL; } if (entries > maxsize) { - error("Trying to dereference pointer "PREG" beyond end of segment", PRINT_REG(pointer)); + SCIkdebug(SCIkERROR, "Trying to dereference pointer "PREG" beyond end of segment!\n", PRINT_REG(pointer)); return NULL; } return retval; |