Merge pull request #3 from vobject/unification/master

Fix some CppCheck reports and Clang compilation
This commit is contained in:
Christian 2014-01-07 14:31:29 -08:00
commit 55fc7f58b5
8 changed files with 9 additions and 10 deletions

View file

@ -86,6 +86,7 @@ main(int argc, char *argv[])
} else {
fread(buf, len[i], 1, readfile);
fwrite(buf, len[i], 1, mvlfile);
free(buf);
}
fclose(readfile);
}

View file

@ -140,7 +140,7 @@ static void info_display_object_placement(int show_all)
old_Cur_object_index = Cur_object_index;
old_type = Objects[Cur_object_index].type;
old_movement_type = Objects[Cur_object_index].movement_type;
old_mode = Objects[Cur_object_index].control_type;
old_control_type = Objects[Cur_object_index].control_type;
old_mode = Objects[Cur_object_index].ctype.ai_info.behavior;
}

View file

@ -4467,7 +4467,7 @@ static void state_ai_cloak_info_to_ai_cloak_info_rw(ai_cloak_info *aic, ai_cloak
aic_rw->last_segment = aic->last_segment;
#endif
aic_rw->last_position.x = aic->last_position.x;
aic_rw->last_position.x = aic->last_position.y;
aic_rw->last_position.y = aic->last_position.y;
aic_rw->last_position.z = aic->last_position.z;
}

View file

@ -985,7 +985,7 @@ static int load_game_data(PHYSFS_file *LoadFile)
int t;
v29_trigger_read(&trig29, LoadFile);
trig.flags = trig29.flags;
trig.num_links = trig29.num_links;
// skip trig29.link_num. v30_trigger does not need it
trig.num_links = trig29.num_links;
trig.value = trig29.value;
trig.time = trig29.time;

View file

@ -512,11 +512,9 @@ static int main_menu_handler(newmenu *menu, d_event *event, int *menu_choice )
// Create the main menu.
static void create_main_menu(newmenu_item *m, int *menu_choice, int *callers_num_options)
{
int num_options;
int num_options = 0;
#ifndef DEMO_ONLY
num_options = 0;
ADD_ITEM(TXT_NEW_GAME,MENU_NEW_GAME,KEY_N);
ADD_ITEM(TXT_LOAD_GAME,MENU_LOAD_GAME,KEY_L);

View file

@ -1572,8 +1572,8 @@ newmenu *newmenu_do4( const char * title, const char * subtitle, int nitems, new
newmenu_create_structure(menu);
// Create the basic window
if (menu)
wind = window_create(&grd_curscreen->sc_canvas, menu->x, menu->y, menu->w, menu->h, newmenu_handler, menu);
wind = window_create(&grd_curscreen->sc_canvas, menu->x, menu->y, menu->w, menu->h, newmenu_handler, menu);
if (!wind)
{
d_free(menu);

View file

@ -857,7 +857,7 @@ void piggy_new_pigfile(char *pigname)
char tempname[20];
int SuperX;
sprintf( tempname, "%s#%d", basename, fnum );
sprintf( tempname, "%s#%u", basename, fnum );
//SuperX = (GameBitmaps[i+fnum].bm_flags&BM_FLAG_SUPER_TRANSPARENT)?254:-1;
SuperX = (GameBitmapFlags[i+fnum]&BM_FLAG_SUPER_TRANSPARENT)?254:-1;

View file

@ -270,7 +270,7 @@ void songs_pause_resume(void)
// 0 otherwise
static int songs_have_cd()
{
int discid;
unsigned long discid;
if (GameCfg.OrigTrackOrder)
return 1;