From 71a4ace85116d57e12745d15b37335ed9276f13c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 8 May 2021 14:53:30 -0400 Subject: "not sure" button --- main.c | 22 +++++++++++++--------- ui.glade | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index 628d43f..4056276 100644 --- a/main.c +++ b/main.c @@ -533,8 +533,8 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) { bool success = true; if (memory_reader) { - uint64_t value; - bool same; + uint64_t value = 0; + bool same = false, not_sure = false; switch (search_type) { case SEARCH_ENTER_VALUE: { GtkEntry *value_entry = GTK_ENTRY(gtk_builder_get_object(builder, "current-value")); @@ -543,6 +543,8 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) { case SEARCH_SAME_DIFFERENT: { GtkToggleButton *same_button = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "same")); same = gtk_toggle_button_get_active(same_button); + GtkToggleButton *not_sure_button = GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "not-sure")); + not_sure = gtk_toggle_button_get_active(not_sure_button); } break; } if (success) { @@ -619,14 +621,16 @@ G_MODULE_EXPORT void search_update(GtkWidget *_widget, gpointer user_data) { candidates[bitset_index/64] &= ~MASK64(bitset_index % 64); } break; - case SEARCH_SAME_DIFFERENT: { - void const *prev_value_here = &((uint8_t const *)savchunk)[i * item_size]; - bool this_same = data_equal(data_type, value_here, prev_value_here); - if (this_same != same) { - // eliminate this candidate - candidates[bitset_index/64] &= ~MASK64(bitset_index % 64); + case SEARCH_SAME_DIFFERENT: + if (!not_sure) { + void const *prev_value_here = &((uint8_t const *)savchunk)[i * item_size]; + bool this_same = data_equal(data_type, value_here, prev_value_here); + if (this_same != same) { + // eliminate this candidate + candidates[bitset_index/64] &= ~MASK64(bitset_index % 64); + } } - } break; + break; } ++bitset_index; } diff --git a/ui.glade b/ui.glade index ee81f28..4f2329f 100644 --- a/ui.glade +++ b/ui.glade @@ -806,6 +806,24 @@ 1 + + + Not sure + not-sure + True + True + False + Just update the current value, don't worry about what it was before. + True + True + same + + + False + True + 2 + + False -- cgit v1.2.3