Fix some bad casts from GPtrArray to GArray

We missed fixing these in 47b6d5c80d.

(cherry picked from commit fe81b1c91f3528f0b4c63f14cc3aa6b209a7f3ab)
This commit is contained in:
Tom Stellard 2022-01-21 16:32:21 -08:00
parent f18841c40b
commit 670b327a44
3 changed files with 11 additions and 9 deletions

View File

@ -701,7 +701,7 @@ callback_show_team(gint type)
GtkTreeView *treeview_right =
GTK_TREE_VIEW(lookup_widget(window.main, "treeview_right"));
const Team *tm;
const GArray *teams = NULL;
const GPtrArray *teams = NULL;
const GPtrArray *teamsp = NULL;
gint len = -1;
@ -745,7 +745,7 @@ callback_show_team(gint type)
stat1 = 0;
if(stat2 < ID_CUP_START)
tm = &g_array_index(teams, Team, stat1);
tm = g_ptr_array_index(teams, stat1);
else
tm = (Team*)g_ptr_array_index(teamsp, stat1);
}

View File

@ -2063,18 +2063,20 @@ treeview_show_all_players(gint clid)
gint i, j;
GPtrArray *players = g_ptr_array_new();
const GArray *teams = NULL;
const GPtrArray *teams = NULL;
const GPtrArray *teamsp = NULL;
if(clid < ID_CUP_START)
{
teams = (GArray*)league_cup_get_teams(clid);
for(i=0;i<teams->len;i++)
if(&g_array_index(teams, Team, i) != current_user.tm)
for(j=0;j<g_array_index(teams, Team, i).players->len;j++)
g_ptr_array_add(players, &g_array_index(g_array_index(teams, Team, i).players,
teams = league_cup_get_teams(clid);
for(i=0;i<teams->len;i++) {
Team *team = g_ptr_array_index(teams, i);
if(team != current_user.tm)
for(j=0;j<team->players->len;j++)
g_ptr_array_add(players, &g_array_index(team->players,
Player, j));
}
}
else
{
teamsp = (GPtrArray*)league_cup_get_teams(clid);

View File

@ -413,7 +413,7 @@ user_weekly_update_counters(User *user)
#endif
gint rank = team_get_league_rank(user->tm, -1);
gint teamslen = ((GArray*)(league_cup_get_teams(user->tm->clid)))->len;
gint teamslen = ((GPtrArray*)(league_cup_get_teams(user->tm->clid)))->len;
gint rank_bounds[2] =
{(gint)rint(const_float("float_user_success_table_bound_upper") *
(gfloat)teamslen),