diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:58:32 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-18 08:58:32 +0200 |
| commit | 0dc33a4dd49eb560e98b24090969fd618a4c6198 (patch) | |
| tree | 77e7070bcbbcc9db4e0c5552ae83a33d3b2f9cfc /src/ui | |
| parent | c1d950f2765cde614c8411b4effb3850146ba598 (diff) | |
refactor memops
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/ui_contacts.cpp | 9 | ||||
| -rw-r--r-- | src/ui/ui_log.cpp | 2 | ||||
| -rw-r--r-- | src/ui/ui_projects.cpp | 2 | ||||
| -rw-r--r-- | src/ui/ui_settings.cpp | 10 |
4 files changed, 10 insertions, 13 deletions
diff --git a/src/ui/ui_contacts.cpp b/src/ui/ui_contacts.cpp index cc5a7e0..ff1f424 100644 --- a/src/ui/ui_contacts.cpp +++ b/src/ui/ui_contacts.cpp @@ -14,13 +14,14 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "strops.hpp" -#include "config.hpp" #include "ui.hpp" #include "imgui.h" +#include "strops.hpp" +#include "config.hpp" +#include "memops.hpp" +#include "locales.hpp" #include "administration.hpp" #include "administration_writer.hpp" -#include "locales.hpp" static ui::view_state current_view_state = ui::view_state::LIST_ALL; static contact selected_for_removal; @@ -42,7 +43,7 @@ void ui::setup_contacts() { current_view_state = ui::view_state::LIST_ALL; active_contact = active_contact = administration::contact_create_empty(); - memset(&selected_for_removal, 0, sizeof(contact)); + memops::zero(&selected_for_removal, sizeof(contact)); } void draw_addressee_form_ex(delivery_info* buffer, bool viewing_only = false) diff --git a/src/ui/ui_log.cpp b/src/ui/ui_log.cpp index d19e26e..1f4aa84 100644 --- a/src/ui/ui_log.cpp +++ b/src/ui/ui_log.cpp @@ -14,8 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdio.h> - #include "ui.hpp" #include "imgui.h" #include "logger.hpp" diff --git a/src/ui/ui_projects.cpp b/src/ui/ui_projects.cpp index 43a8eb4..5e0df0c 100644 --- a/src/ui/ui_projects.cpp +++ b/src/ui/ui_projects.cpp @@ -14,8 +14,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <stdio.h> - #include "ui.hpp" #include "imgui.h" #include "administration.hpp" diff --git a/src/ui/ui_settings.cpp b/src/ui/ui_settings.cpp index a4b5748..7de543f 100644 --- a/src/ui/ui_settings.cpp +++ b/src/ui/ui_settings.cpp @@ -158,7 +158,7 @@ static void draw_vat_rates() if (ImGui::Button(locale::get("form.cancel"))) { is_editing_item = false; is_adding_item = false; - memset(&new_tax_rate, 0, sizeof(new_tax_rate)); + memops::zero(&new_tax_rate, sizeof(new_tax_rate)); } } else @@ -204,7 +204,7 @@ static void draw_vat_rates() if (ImGui::Button(locale::get("form.cancel"))) { is_editing_item = false; is_adding_item = false; - memset(&new_tax_rate, 0, sizeof(new_tax_rate)); + memops::zero(&new_tax_rate, sizeof(new_tax_rate)); } } } @@ -252,7 +252,7 @@ static void draw_cost_centers() administration::cost_center_update(new_cost_center); - memset(&new_cost_center, 0, sizeof(new_cost_center)); + memops::zero(&new_cost_center, sizeof(new_cost_center)); ui::destroy_settings(); ui::setup_settings(); @@ -263,7 +263,7 @@ static void draw_cost_centers() if (ImGui::Button(locale::get("form.cancel"))) { is_editing_item = false; is_adding_item = false; - memset(&new_cost_center, 0, sizeof(new_cost_center)); + memops::zero(&new_cost_center, sizeof(new_cost_center)); } } else @@ -316,7 +316,7 @@ static void draw_cost_centers() if (ImGui::Button(locale::get("form.cancel"))) { is_adding_item = false; is_editing_item = false; - memset(&new_cost_center, 0, sizeof(new_cost_center)); + memops::zero(&new_cost_center, sizeof(new_cost_center)); } } |
