aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider2009-02-28 13:41:43 +0000
committerAndre Heider2009-02-28 13:41:43 +0000
commitb2cd5beb9e125c1da97aa12d04f558c95c650e9b (patch)
tree4c91ac8b041e4f3bc15e88325e8c9bc81faab914
parentaff4aeae14033053fd1753e319d12a0659362461 (diff)
downloadscummvm-rg350-b2cd5beb9e125c1da97aa12d04f558c95c650e9b.tar.gz
scummvm-rg350-b2cd5beb9e125c1da97aa12d04f558c95c650e9b.tar.bz2
scummvm-rg350-b2cd5beb9e125c1da97aa12d04f558c95c650e9b.zip
clean up some warnings
svn-id: r38965
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/engine/kernel.cpp16
-rw-r--r--engines/sci/engine/vm.cpp4
-rw-r--r--engines/sci/scicore/decompress1.cpp6
-rw-r--r--engines/sci/scicore/resource_map.cpp3
-rw-r--r--engines/sci/scicore/script.cpp2
-rw-r--r--engines/sci/scicore/versions.cpp2
-rw-r--r--engines/sci/sfx/iterator.cpp30
8 files changed, 29 insertions, 36 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 20ff91b476..fbccc9a7cc 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -245,7 +245,7 @@ int _reset_graphics_input(EngineState *s) {
int game_init_graphics(EngineState *s) {
#ifndef WITH_PIC_SCALING
if (s->gfx_state->options->pic0_unscaled == 0)
- sciprintf("WARNING: Pic scaling was disabled; your version of FreeSCI has no support for scaled pic drawing built in.\n");
+ warning("Pic scaling was disabled; your version of FreeSCI has no support for scaled pic drawing built in.");
s->gfx_state->options->pic0_unscaled = 1;
#endif
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 0d70be21a4..afd01ee17a 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -578,7 +578,7 @@ reg_t kMemory(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (dest && src)
memcpy(dest, src, size);
else {
- warning("Warning: Could not execute kMemory:memcpy of %d bytes:", size);
+ warning("Could not execute kMemory:memcpy of %d bytes:", size);
if (!dest) {
warning(" dest ptr ("PREG") invalid/memory region too small", PRINT_REG(argv[1]));
}
@@ -643,14 +643,12 @@ reg_t kstub(EngineState *s, int funct_nr, int argc, reg_t *argv) {
reg_t kNOP(EngineState *s, int funct_nr, int argc, reg_t *argv) {
const char *problem = (const char*)(s->kfunct_table[funct_nr].orig_name ? "unmapped" : "NOP");
- warning("Warning: Kernel function 0x%02x invoked: %s", funct_nr, problem);
+ warning("Kernel function 0x%02x invoked: %s", funct_nr, problem);
if (s->kfunct_table[funct_nr].orig_name && strcmp(s->kfunct_table[funct_nr].orig_name, SCRIPT_UNKNOWN_FUNCTION_STRING)) {
- sciprintf(" (but its name is known to be %s)", s->kfunct_table[funct_nr].orig_name);
+ warning(" (but its name is known to be %s)", s->kfunct_table[funct_nr].orig_name);
}
- sciprintf("\n");
-
return NULL_REG;
}
@@ -741,8 +739,8 @@ int script_map_kernel(EngineState *s) {
int max_functions_nr = sci_max_allowed_unknown_kernel_functions[s->resmgr->sci_version];
if (functions_nr < max_functions_nr) {
- sciprintf("Warning: SCI version believed to have %d kernel"
- " functions, but only %d reported-- filling up remaining %d\n",
+ warning("SCI version believed to have %d kernel"
+ " functions, but only %d reported-- filling up remaining %d",
max_functions_nr, functions_nr, max_functions_nr - functions_nr);
functions_nr = max_functions_nr;
@@ -765,10 +763,10 @@ int script_map_kernel(EngineState *s) {
if (found == -1) {
if (sought_name) {
- sciprintf("Warning: Kernel function %s[%x] unmapped\n", s->kernel_names[functnr], functnr);
+ warning("Kernel function %s[%x] unmapped", s->kernel_names[functnr], functnr);
s->kfunct_table[functnr].fun = kNOP;
} else {
- sciprintf("Warning: Flagging kernel function %x as unknown\n", functnr);
+ warning("Flagging kernel function %x as unknown", functnr);
s->kfunct_table[functnr].fun = k_Unknown;
}
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 7ce8bf0f08..16f33bb27f 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -658,7 +658,7 @@ void run_vm(EngineState *s, int restoring) {
scr = script_locate_by_segment(s, xs->addr.pc.segment);
if (!scr) {
// No script? Implicit return via fake instruction buffer
- warning("Running on non-existant script in segment %x!\n", xs->addr.pc.segment);
+ warning("Running on non-existant script in segment %x!", xs->addr.pc.segment);
code_buf = _fake_return_buffer;
#ifndef DISABLE_VALIDATIONS
code_buf_size = 2;
@@ -1978,7 +1978,7 @@ void script_uninstantiate(EngineState *s, int script_nr) {
reg.segment = s->seg_manager->segGet(script_nr);
if (!s->seg_manager->scriptIsLoaded(script_nr, SCRIPT_ID) || reg.segment <= 0) { // Is it already loaded?
- //sciprintf("Warning: unloading script 0x%x requested although not loaded\n", script_nr);
+ //warning("unloading script 0x%x requested although not loaded", script_nr);
// This is perfectly valid SCI behaviour
return;
}
diff --git a/engines/sci/scicore/decompress1.cpp b/engines/sci/scicore/decompress1.cpp
index 0b156272ba..327ba711dd 100644
--- a/engines/sci/scicore/decompress1.cpp
+++ b/engines/sci/scicore/decompress1.cpp
@@ -148,10 +148,10 @@ static int decrypt4_hdyn(byte *dest, int length, struct bit_read_struct *reader)
CALLC(length_param = getbits(reader, 8));
if (mode == DCL_ASCII_MODE) {
- warning("DCL-INFLATE: Warning: Decompressing ASCII mode (untested)");
+ warning("DCL-INFLATE: Decompressing ASCII mode (untested)");
//DEBUG_DCL_INFLATE = 1;
} else if (mode) {
- fprintf(stderr, "DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
+ warning("DCL-INFLATE: Error: Encountered mode %02x, expected 00 or 01\n", mode);
return 1;
}
@@ -170,7 +170,7 @@ static int decrypt4_hdyn(byte *dest, int length, struct bit_read_struct *reader)
if (length_param < 3 || length_param > 6)
- fprintf(stderr, "Warning: Unexpected length_param value %d (expected in [3,6])\n", length_param);
+ warning("Unexpected length_param value %d (expected in [3,6])\n", length_param);
while (write_pos < length) {
CALLC(value = getbits(reader, 1));
diff --git a/engines/sci/scicore/resource_map.cpp b/engines/sci/scicore/resource_map.cpp
index aa0932f8c9..b5177185b6 100644
--- a/engines/sci/scicore/resource_map.cpp
+++ b/engines/sci/scicore/resource_map.cpp
@@ -27,6 +27,7 @@
#include "sci/scicore/resource.h"
#include "sci/tools.h"
+#include "common/util.h"
#include "common/file.h"
namespace Sci {
@@ -295,7 +296,7 @@ int sci0_read_resource_map(ResourceManager *mgr, ResourceSource *map, resource_t
++resource_index;
if (++resources_total_read >= resource_nr) {
- sciprintf("Warning: After %d entries, resource.map is not terminated", resource_index);
+ warning("After %d entries, resource.map is not terminated", resource_index);
next_entry = 0;
}
diff --git a/engines/sci/scicore/script.cpp b/engines/sci/scicore/script.cpp
index 53344d01c1..ffa7fae332 100644
--- a/engines/sci/scicore/script.cpp
+++ b/engines/sci/scicore/script.cpp
@@ -113,7 +113,7 @@ int script_find_selector(EngineState *s, const char *selectorname) {
return pos;
}
- sciprintf("Warning: Could not map '%s' to any selector!\n", selectorname);
+ warning("Could not map '%s' to any selector!", selectorname);
return -1;
}
diff --git a/engines/sci/scicore/versions.cpp b/engines/sci/scicore/versions.cpp
index e3bfad421e..4f771edd9a 100644
--- a/engines/sci/scicore/versions.cpp
+++ b/engines/sci/scicore/versions.cpp
@@ -76,7 +76,7 @@ int version_parse(const char *vn, sci_version_t *result) {
int patchlevel = strtol(vn + 6, &endptr[2], 10);
if (endptr[0] != vn + 1 || endptr[1] != vn + 5 || *endptr[2] != '\0') {
- sciprintf("Warning: Failed to parse version string '%s'\n", vn);
+ warning("Failed to parse version string '%s'", vn);
return 1;
}
diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp
index 501ebb0ad9..cd9c0869f2 100644
--- a/engines/sci/sfx/iterator.cpp
+++ b/engines/sci/sfx/iterator.cpp
@@ -82,14 +82,14 @@ static void _common_init(base_song_iterator_t *self) {
#define CHECK_FOR_END_ABSOLUTE(offset) \
if (offset > self->size) { \
- fprintf(stderr, SIPFX "Reached end of song without terminator (%x/%x) at %d!\n", offset, self->size, __LINE__); \
+ warning(SIPFX "Reached end of song without terminator (%x/%x) at %d!", offset, self->size, __LINE__); \
return SI_FINISHED; \
}
#define CHECK_FOR_END(offset_augment) \
if ((channel->offset + (offset_augment)) > channel->end) { \
channel->state = SI_STATE_FINISHED; \
- fprintf(stderr, SIPFX "Reached end of track %d without terminator (%x+%x/%x) at %d!\n", channel->id, channel->offset, offset_augment, channel->end, __LINE__); \
+ warning(SIPFX "Reached end of track %d without terminator (%x+%x/%x) at %d!", channel->id, channel->offset, offset_augment, channel->end, __LINE__); \
return SI_FINISHED; \
}
@@ -380,7 +380,7 @@ static int _sci_midi_process_state(base_song_iterator_t *self, unsigned char *bu
}
case SI_STATE_UNINITIALISED:
- fprintf(stderr, SIPFX "Attempt to read command from uninitialized iterator!\n");
+ warning(SIPFX "Attempt to read command from uninitialized iterator!");
self->init((song_iterator_t *) self);
return self->next((song_iterator_t *) self, buf, result);
@@ -436,8 +436,7 @@ static int _sci_midi_process_state(base_song_iterator_t *self, unsigned char *bu
}
default:
- fprintf(stderr, SIPFX "Invalid iterator state %d!\n",
- channel->state);
+ warning(SIPFX "Invalid iterator state %d!", channel->state);
BREAKPOINT();
return SI_FINISHED;
}
@@ -486,8 +485,7 @@ static int _sci0_get_pcm_data(sci0_song_iterator_t *self,
self->size - offset);
if (!fc) {
- fprintf(stderr, SIPFX "Warning: Playing unterminated"
- " song!\n");
+ warning(SIPFX "Playing unterminated song!");
return 1;
}
@@ -500,9 +498,8 @@ static int _sci0_get_pcm_data(sci0_song_iterator_t *self,
}
if (!found_it) {
- fprintf(stderr, SIPFX
- "Warning: Song indicates presence of PCM, but"
- " none found (finally at offset %04x)\n", offset);
+ warning(SIPFX "Song indicates presence of PCM, but"
+ " none found (finally at offset %04x)", offset);
return 1;
}
@@ -519,9 +516,8 @@ static int _sci0_get_pcm_data(sci0_song_iterator_t *self,
if (offset + SCI0_PCM_DATA_OFFSET + size != self->size) {
int d = offset + SCI0_PCM_DATA_OFFSET + size - self->size;
- fprintf(stderr, SIPFX
- "Warning: PCM advertizes %d bytes of data, but %d"
- " bytes are trailing in the resource!\n",
+ warning(SIPFX "PCM advertizes %d bytes of data, but %d"
+ " bytes are trailing in the resource!",
size, self->size - (offset + SCI0_PCM_DATA_OFFSET));
if (d > 0)
@@ -1189,8 +1185,7 @@ static song_iterator_t *_sci1_handle_message(sci1_song_iterator_t *self,
}
default:
- fprintf(stderr, SIPFX "Unsupported command %d to"
- " SCI1 iterator", msg.type);
+ warning(SIPFX "Unsupported command %d to SCI1 iterator", msg.type);
}
return (song_iterator_t *) self;
}
@@ -1802,8 +1797,7 @@ song_iterator_t *songit_new(unsigned char *data, unsigned int size, int type, so
int i;
if (!data || size < 22) {
- warning(SIPFX "Attempt to instantiate song iterator for null"
- " song data");
+ warning(SIPFX "Attempt to instantiate song iterator for null song data");
return NULL;
}
@@ -1853,7 +1847,7 @@ song_iterator_t *songit_new(unsigned char *data, unsigned int size, int type, so
default:
/**-- Invalid/unsupported sound resources --**/
warning(SIPFX "Attempt to instantiate invalid/unknown"
- " song iterator type %d\n", type);
+ " song iterator type %d", type);
return NULL;
}
it->ID = id;