Linux GTK Port: Fix compiling issues that prevented building. (Regression from commit aa21454.)

This commit is contained in:
rogerman 2023-06-20 17:12:53 -07:00
parent aa21454373
commit b468aee01a
2 changed files with 20 additions and 18 deletions

View File

@ -77,25 +77,26 @@ enabled_toggled(GtkCellRendererToggle * cell,
GtkTreeModel *model = (GtkTreeModel *) data; GtkTreeModel *model = (GtkTreeModel *) data;
GtkTreeIter iter; GtkTreeIter iter;
GtkTreePath *path = gtk_tree_path_new_from_string(path_str); GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
gboolean enabled; gboolean guiEnabled;
gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get_iter(model, &iter, path);
gtk_tree_model_get(model, &iter, COLUMN_ENABLED, &enabled, -1); gtk_tree_model_get(model, &iter, COLUMN_ENABLED, &guiEnabled, -1);
enabled ^= 1; guiEnabled ^= 1;
CHEATS_LIST cheat; const bool cheatEnabled = (guiEnabled) ? true : false;
CHEATS_LIST tempCheatItem;
u32 ii; u32 ii;
GtkTreePath *path1; GtkTreePath *path1;
path1 = gtk_tree_model_get_path (model, &iter); path1 = gtk_tree_model_get_path (model, &iter);
ii = gtk_tree_path_get_indices (path)[0]; ii = gtk_tree_path_get_indices (path)[0];
cheats->copyItemFromIndex(ii, cheat); cheats->copyItemFromIndex(ii, tempCheatItem);
cheats->update(cheat.size, cheat.code[0][0], cheat.code[0][1], cheat.description, cheats->update(tempCheatItem.size, tempCheatItem.code[0][0], tempCheatItem.code[0][1], tempCheatItem.description,
enabled, ii); cheatEnabled, ii);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_ENABLED, enabled, -1); gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_ENABLED, guiEnabled, -1);
gtk_tree_path_free(path); gtk_tree_path_free(path);
} }
@ -180,7 +181,7 @@ static void cheat_list_add_cheat(GtkWidget * widget, gpointer data)
#define NEW_DESC "New cheat" #define NEW_DESC "New cheat"
GtkListStore *store = (GtkListStore *) data; GtkListStore *store = (GtkListStore *) data;
GtkTreeIter iter; GtkTreeIter iter;
cheats->add(1, 0, 0, g_strdup(NEW_DESC), FALSE); cheats->add(1, 0, 0, g_strdup(NEW_DESC), false);
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, gtk_list_store_set(store, &iter,
COLUMN_ENABLED, FALSE, COLUMN_ENABLED, FALSE,

View File

@ -77,25 +77,26 @@ enabled_toggled(GtkCellRendererToggle * cell,
GtkTreeModel *model = (GtkTreeModel *) data; GtkTreeModel *model = (GtkTreeModel *) data;
GtkTreeIter iter; GtkTreeIter iter;
GtkTreePath *path = gtk_tree_path_new_from_string(path_str); GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
gboolean enabled; gboolean guiEnabled;
gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get_iter(model, &iter, path);
gtk_tree_model_get(model, &iter, COLUMN_ENABLED, &enabled, -1); gtk_tree_model_get(model, &iter, COLUMN_ENABLED, &guiEnabled, -1);
enabled ^= 1; guiEnabled ^= 1;
CHEATS_LIST cheat; const bool cheatEnabled = (guiEnabled) ? true : false;
CHEATS_LIST tempCheatItem;
u32 ii; u32 ii;
GtkTreePath *path1; GtkTreePath *path1;
path1 = gtk_tree_model_get_path (model, &iter); path1 = gtk_tree_model_get_path (model, &iter);
ii = gtk_tree_path_get_indices (path)[0]; ii = gtk_tree_path_get_indices (path)[0];
cheats->copyItemFromIndex(ii, cheat); cheats->copyItemFromIndex(ii, tempCheatItem);
cheats->update(cheat.size, cheat.code[0][0], cheat.code[0][1], cheat.description, cheats->update(tempCheatItem.size, tempCheatItem.code[0][0], tempCheatItem.code[0][1], tempCheatItem.description,
enabled, ii); cheatEnabled, ii);
gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_ENABLED, enabled, -1); gtk_list_store_set(GTK_LIST_STORE(model), &iter, COLUMN_ENABLED, guiEnabled, -1);
gtk_tree_path_free(path); gtk_tree_path_free(path);
} }
@ -180,7 +181,7 @@ static void cheat_list_add_cheat(GtkWidget * widget, gpointer data)
#define NEW_DESC "New cheat" #define NEW_DESC "New cheat"
GtkListStore *store = (GtkListStore *) data; GtkListStore *store = (GtkListStore *) data;
GtkTreeIter iter; GtkTreeIter iter;
cheats->add(1, 0, 0, g_strdup(NEW_DESC), FALSE); cheats->add(1, 0, 0, g_strdup(NEW_DESC), false);
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, gtk_list_store_set(store, &iter,
COLUMN_ENABLED, FALSE, COLUMN_ENABLED, FALSE,