mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-25 22:07:34 +00:00
SCI: Fixed more warnings
svn-id: r38658
This commit is contained in:
parent
ecaab0fe94
commit
bcb1a71052
@ -2166,7 +2166,8 @@ static int c_send(state_t *s) {
|
||||
reg_t object = cmd_params[0].reg;
|
||||
char *selector_name = cmd_params[1].str;
|
||||
stack_ptr_t stackframe = s->execution_stack->sp;
|
||||
unsigned int i, selector_id, selector_type;
|
||||
int selector_id;
|
||||
unsigned int i, selector_type;
|
||||
exec_stack_t *xstack;
|
||||
object_t *o;
|
||||
reg_t *vptr;
|
||||
@ -2877,7 +2878,6 @@ static int c_gc_list_reachable(state_t *s) {
|
||||
|
||||
void script_debug(state_t *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, reg_t *objp, int *restadjust,
|
||||
seg_id_t *segids, reg_t **variables, reg_t **variables_base, int *variables_nr, int bp) {
|
||||
static int last_step;
|
||||
// Do we support a separate console?
|
||||
|
||||
if (sci_debug_flags & _DEBUG_FLAG_LOGGING) {
|
||||
|
@ -1084,7 +1084,7 @@ void run_vm(state_t *s, int restoring) {
|
||||
|
||||
case 0x24: // ret
|
||||
do {
|
||||
stack_ptr_t old_sp = xs->sp;
|
||||
stack_ptr_t old_sp2 = xs->sp;
|
||||
stack_ptr_t old_fp = xs->fp;
|
||||
exec_stack_t *old_xs = s->execution_stack + s->execution_stack_pos;
|
||||
|
||||
@ -1114,7 +1114,7 @@ void run_vm(state_t *s, int restoring) {
|
||||
|
||||
if (xs->sp == CALL_SP_CARRY // Used in sends to 'carry' the stack pointer
|
||||
|| xs->type != EXEC_STACK_TYPE_CALL) {
|
||||
xs->sp = old_sp;
|
||||
xs->sp = old_sp2;
|
||||
xs->fp = old_fp;
|
||||
}
|
||||
|
||||
@ -1765,9 +1765,6 @@ int script_instantiate_sci0(state_t *s, int script_nr) {
|
||||
|
||||
if (s->version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER) {
|
||||
//
|
||||
int locals_size = getUInt16(script->data)*2;
|
||||
int locals = (locals_size)? script->size : 0;
|
||||
|
||||
int locals_nr = getUInt16(script->data);
|
||||
|
||||
// Old script block
|
||||
|
@ -1521,7 +1521,6 @@ int
|
||||
_gfxop_set_pointer(gfx_state_t *state, gfx_pixmap_t *pxm) {
|
||||
rect_t old_pointer_bounds = {0, 0, 0, 0};
|
||||
rect_t pointer_bounds = {0, 0, 0, 0};
|
||||
int retval = -1;
|
||||
int draw_old;
|
||||
int draw_new = 0;
|
||||
|
||||
|
@ -42,12 +42,11 @@ static void (*_con_pixmap_callback)(gfx_pixmap_t *) = NULL;
|
||||
/****************************************/
|
||||
|
||||
|
||||
int
|
||||
sciprintf(const char *fmt, ...) {
|
||||
int sciprintf(const char *fmt, ...) {
|
||||
va_list argp;
|
||||
size_t bufsize = 256;
|
||||
unsigned int i;
|
||||
char *buf = (char *) sci_malloc(bufsize);
|
||||
int bufsize = 256;
|
||||
int i;
|
||||
char *buf = (char *)sci_malloc(bufsize);
|
||||
|
||||
if (NULL == fmt) {
|
||||
error("console.c: sciprintf(): NULL passed for parameter fmt\n");
|
||||
@ -67,7 +66,7 @@ sciprintf(const char *fmt, ...) {
|
||||
va_start(argp, fmt); /* reset argp */
|
||||
|
||||
free(buf);
|
||||
buf = (char *) sci_malloc(bufsize <<= 1);
|
||||
buf = (char *)sci_malloc(bufsize <<= 1);
|
||||
}
|
||||
va_end(argp);
|
||||
|
||||
@ -85,8 +84,7 @@ sciprintf(const char *fmt, ...) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
con_set_string_callback(void(*callback)(char *)) {
|
||||
void con_set_string_callback(void(*callback)(char *)) {
|
||||
_con_string_callback = callback;
|
||||
}
|
||||
|
||||
|
@ -249,10 +249,10 @@ int sci0_get_compression_method(Common::ReadStream &stream) {
|
||||
|
||||
|
||||
int decompress0(resource_t *result, Common::ReadStream &stream, int sci_version) {
|
||||
guint16 compressedLength;
|
||||
guint16 compressionMethod;
|
||||
guint16 result_size;
|
||||
guint8 *buffer;
|
||||
uint16 compressedLength;
|
||||
uint16 compressionMethod;
|
||||
uint16 result_size;
|
||||
uint8 *buffer;
|
||||
|
||||
if (stream.read(&(result->id), 2) != 2)
|
||||
return SCI_ERROR_IO_ERROR;
|
||||
@ -278,8 +278,7 @@ int decompress0(resource_t *result, Common::ReadStream &stream, int sci_version)
|
||||
#endif
|
||||
result->size = result_size;
|
||||
|
||||
if ((result->size > SCI_MAX_RESOURCE_SIZE) ||
|
||||
(compressedLength > SCI_MAX_RESOURCE_SIZE))
|
||||
if (result->size > SCI_MAX_RESOURCE_SIZE)
|
||||
return SCI_ERROR_RESOURCE_TOO_BIG;
|
||||
/* With SCI0, this simply cannot happen. */
|
||||
|
||||
|
@ -44,16 +44,16 @@ struct tokenlist {
|
||||
static gint8 stak[0x1014] = {0};
|
||||
static gint8 lastchar = 0;
|
||||
static gint16 stakptr = 0;
|
||||
static guint16 numbits, s_bitstring, lastbits, decryptstart;
|
||||
static guint16 s_numbits, s_bitstring, lastbits, decryptstart;
|
||||
static gint16 curtoken, endtoken;
|
||||
|
||||
|
||||
guint32 gbits(int numbits, guint8 * data, int dlen);
|
||||
uint32 gbits(int numbits, guint8 * data, int dlen);
|
||||
|
||||
void decryptinit3(void) {
|
||||
int i;
|
||||
lastchar = lastbits = s_bitstring = stakptr = 0;
|
||||
numbits = 9;
|
||||
s_numbits = 9;
|
||||
curtoken = 0x102;
|
||||
endtoken = 0x1ff;
|
||||
decryptstart = 0;
|
||||
@ -71,7 +71,7 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) {
|
||||
switch (decryptstart) {
|
||||
case 0:
|
||||
case 1:
|
||||
s_bitstring = gbits(numbits, src, complength);
|
||||
s_bitstring = gbits(s_numbits, src, complength);
|
||||
if (s_bitstring == 0x101) { /* found end-of-data signal */
|
||||
decryptstart = 4;
|
||||
return 0;
|
||||
@ -84,7 +84,7 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) {
|
||||
return 0;
|
||||
}
|
||||
if (s_bitstring == 0x100) { /* start-over signal */
|
||||
numbits = 9;
|
||||
s_numbits = 9;
|
||||
endtoken = 0x1ff;
|
||||
curtoken = 0x102;
|
||||
decryptstart = 0;
|
||||
@ -114,8 +114,8 @@ int decrypt3(guint8 *dest, guint8 *src, int length, int complength) {
|
||||
tokens[curtoken].data = lastchar;
|
||||
tokens[curtoken].next = lastbits;
|
||||
curtoken++;
|
||||
if (curtoken == endtoken && numbits != 12) {
|
||||
numbits++;
|
||||
if (curtoken == endtoken && s_numbits != 12) {
|
||||
s_numbits++;
|
||||
endtoken <<= 1;
|
||||
endtoken++;
|
||||
}
|
||||
@ -491,9 +491,9 @@ byte *view_reorder(byte *inbuffer, int dsize) {
|
||||
|
||||
|
||||
int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version) {
|
||||
guint16 compressedLength, result_size;
|
||||
guint16 compressionMethod;
|
||||
guint8 *buffer;
|
||||
uint16 compressedLength, result_size;
|
||||
uint16 compressionMethod;
|
||||
uint8 *buffer;
|
||||
|
||||
if (stream.read(&(result->id), 2) != 2)
|
||||
return SCI_ERROR_IO_ERROR;
|
||||
@ -524,8 +524,7 @@ int decompress01(resource_t *result, Common::ReadStream &stream, int sci_version
|
||||
return SCI_ERROR_DECOMPRESSION_INSANE; */
|
||||
/* This return will never happen in SCI0 or SCI1 (does it have any use?) */
|
||||
|
||||
if ((result->size > SCI_MAX_RESOURCE_SIZE) ||
|
||||
(compressedLength > SCI_MAX_RESOURCE_SIZE))
|
||||
if (result->size > SCI_MAX_RESOURCE_SIZE)
|
||||
return SCI_ERROR_RESOURCE_TOO_BIG;
|
||||
|
||||
if (compressedLength > 4)
|
||||
|
@ -274,10 +274,10 @@ void decryptinit3(void);
|
||||
int decrypt3(guint8* dest, guint8* src, int length, int complength);
|
||||
|
||||
int decompress1(resource_t *result, Common::ReadStream &stream, int sci_version) {
|
||||
guint16 compressedLength;
|
||||
guint16 compressionMethod, result_size;
|
||||
guint8 *buffer;
|
||||
guint8 tempid;
|
||||
uint16 compressedLength;
|
||||
uint16 compressionMethod, result_size;
|
||||
uint8 *buffer;
|
||||
uint8 tempid;
|
||||
|
||||
if (sci_version == SCI_VERSION_1_EARLY) {
|
||||
if (stream.read(&(result->id), 2) != 2)
|
||||
@ -321,8 +321,7 @@ int decompress1(resource_t *result, Common::ReadStream &stream, int sci_version)
|
||||
#endif
|
||||
result->size = result_size;
|
||||
|
||||
if ((result->size > SCI_MAX_RESOURCE_SIZE) ||
|
||||
(compressedLength > SCI_MAX_RESOURCE_SIZE))
|
||||
if (result->size > SCI_MAX_RESOURCE_SIZE)
|
||||
return SCI_ERROR_RESOURCE_TOO_BIG;
|
||||
|
||||
if (compressedLength > 4)
|
||||
|
@ -74,8 +74,7 @@ int decompress11(resource_t *result, Common::ReadStream &stream, int sci_version
|
||||
return SCI_ERROR_DECOMPRESSION_INSANE; */
|
||||
/* This return will never happen in SCI0 or SCI1 (does it have any use?) */
|
||||
|
||||
if ((result->size > SCI_MAX_RESOURCE_SIZE) ||
|
||||
(compressedLength > SCI_MAX_RESOURCE_SIZE))
|
||||
if (result->size > SCI_MAX_RESOURCE_SIZE)
|
||||
return SCI_ERROR_RESOURCE_TOO_BIG;
|
||||
|
||||
if (compressedLength > 0)
|
||||
|
@ -62,7 +62,6 @@
|
||||
#include "common/str.h"
|
||||
|
||||
#ifdef UNIX
|
||||
#define _GNU_SOURCE /* For FNM_CASEFOLD in fnmatch.h */
|
||||
#include <fnmatch.h>
|
||||
#endif
|
||||
|
||||
|
@ -780,7 +780,6 @@ _sci1_song_init(sci1_song_iterator_t *self) {
|
||||
self->next_sample = 0;
|
||||
// self->device_id = 0x0c;
|
||||
|
||||
CHECK_FOR_END_ABSOLUTE(0);
|
||||
if (SONGDATA(0) == 0xf0) {
|
||||
self->priority = SONGDATA(1);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user