Fixed more warnings (and at least one case of uninited data)

svn-id: r38331
This commit is contained in:
Max Horn 2009-02-15 23:49:42 +00:00
parent 296686e812
commit 033ade4f5c
4 changed files with 16 additions and 17 deletions

View File

@ -43,8 +43,8 @@ static int c_set(struct _state *s); /* sets an int variable */
static int c_print(struct _state *s); /* prints a variable */
static int c_size(struct _state *s); /* displays the size of a resource */
static int c_dump(struct _state *s); /* gives a hex dump of a resource */
static int c_objinfo(struct _state *s); /* shows some info about one class */
static int c_objmethods(struct _state *s); /* Disassembles all methods of a class */
//static int c_objinfo(struct _state *s); /* shows some info about one class */
//static int c_objmethods(struct _state *s); /* Disassembles all methods of a class */
static int c_hexgrep(struct _state *s); /* Searches a string in one resource or resource class */
static int c_selectornames(struct _state *s); /* Displays all selector names */
static int c_kernelnames(struct _state *s); /* Displays all kernel function names */

View File

@ -254,7 +254,6 @@ _gfxop_install_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm) {
if (driver->mode->palette &&
(!(pxm->flags & GFX_PIXMAP_FLAG_PALETTE_SET))) {
int i;
int error;
for (i = 0; i < pxm->colors_nr; i++) {
if ((error = driver->set_palette(driver, pxm->colors[i].global_index,
@ -806,7 +805,7 @@ gfxop_set_clip_zone(gfx_state_t *state, rect_t zone) {
int
gfxop_set_color(gfx_state_t *state, gfx_color_t *color, int r, int g, int b, int a,
int priority, int control) {
gfx_pixmap_color_t pixmap_color = {0};
gfx_pixmap_color_t pixmap_color = {0, 0, 0, 0};
int error_code;
int mask = ((r >= 0 && g >= 0 && b >= 0) ? GFX_MASK_VISUAL : 0)
| ((priority >= 0) ? GFX_MASK_PRIORITY : 0)
@ -872,8 +871,8 @@ gfxop_set_system_color(gfx_state_t *state, gfx_color_t *color) {
int
gfxop_free_color(gfx_state_t *state, gfx_color_t *color) {
gfx_palette_color_t *palette_color = {0};
gfx_pixmap_color_t pixmap_color = {0};
gfx_palette_color_t *palette_color = 0;
gfx_pixmap_color_t pixmap_color = {0, 0, 0, 0};
int error_code;
BASIC_CHECKS(GFX_FATAL);
@ -1231,7 +1230,6 @@ gfxop_draw_box(gfx_state_t *state, rect_t box, gfx_color_t color1, gfx_color_t c
float mod_offset = 0.0, mod_breadth = 1.0; /* 0.0 to 1.0: Color adjustment */
gfx_rectangle_fill_t driver_shade_type;
rect_t new_box;
gfx_color_t draw_color1, draw_color2 = {{0, 0, 0}, 0, 0, 0, 0};
BASIC_CHECKS(GFX_FATAL);
REMOVE_POINTER;
@ -1304,6 +1302,9 @@ gfxop_draw_box(gfx_state_t *state, rect_t box, gfx_color_t color1, gfx_color_t c
return GFX_ERROR;
}
gfx_color_t draw_color1 = {{0, 0, 0, 0}, 0, 0, 0, 0};
gfx_color_t draw_color2 = {{0, 0, 0, 0}, 0, 0, 0, 0};
draw_color1.mask = draw_color2.mask = color1.mask;
draw_color1.priority = draw_color2.priority = color1.priority;
@ -1540,8 +1541,8 @@ gfxop_usleep(gfx_state_t *state, long usecs) {
int
_gfxop_set_pointer(gfx_state_t *state, gfx_pixmap_t *pxm) {
rect_t old_pointer_bounds = {0};
rect_t pointer_bounds = {0};
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;
@ -1817,7 +1818,7 @@ _gfxop_numlockify(int c) {
sci_event_t
gfxop_get_event(gfx_state_t *state, unsigned int mask) {
sci_event_t error_event = { SCI_EVT_ERROR, 0, 0 };
sci_event_t error_event = { SCI_EVT_ERROR, 0, 0, 0 };
sci_event_t event;
event.data = 0;
event.buckybits = 0;
@ -2209,10 +2210,10 @@ gfxop_new_text(gfx_state_t *state, int font_nr, char *text, int maxwidth,
gfx_alignment_t halign, gfx_alignment_t valign,
gfx_color_t color1, gfx_color_t color2, gfx_color_t bg_color,
int flags) {
gfx_text_handle_t *handle = {0};
gfx_bitmap_font_t *font = {0};
gfx_text_handle_t *handle;
gfx_bitmap_font_t *font;
int i;
gfx_pixmap_color_t pxm_col1, pxm_col2, pxm_colbg = {0};
gfx_pixmap_color_t pxm_col1, pxm_col2, pxm_colbg;
BASIC_CHECKS(NULL);
COL_XLATE(pxm_col1, color1);

View File

@ -262,7 +262,7 @@ gfxr_interpreter_get_resources(gfx_resstate_t *state, gfx_resource_type_t type,
break;
default:
GFX_DEBUG("Unsupported resource %d\n", type);
GFXDEBUG("Unsupported resource %d\n", type);
return NULL; /* unsupported resource */
}
@ -308,7 +308,7 @@ gfxr_interpreter_get_palette(gfx_resstate_t *state, int version, int *colors_nr,
return gfxr_read_pal1(res->id, colors_nr, res->data, res->size);
case SCI_VERSION_1_1 :
case SCI_VERSION_32 :
GFX_DEBUG("Palettes are not yet supported in this SCI version\n");
GFXDEBUG("Palettes are not yet supported in this SCI version\n");
return NULL;
default:

View File

@ -35,8 +35,6 @@
#include <dirent.h>
#else
#include <io.h>
# undef inline /* just to be sure it is not defined */
# define inline __inline
#endif
typedef int8 gint8;