From 0138aa5e5fd1e03a839e3baeb15787c026a835b0 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Thu, 30 Jan 2020 08:57:03 +0100 Subject: [PATCH] Removed precompiled header pch.h and framework.h --- MenuLib.vcxproj | 12 ++---------- MenuLib.vcxproj.filters | 9 --------- framework.h | 3 --- menu.c | 20 ++++++++++---------- menu.h | 6 +++--- pch.c | 5 ----- pch.h | 21 --------------------- 7 files changed, 15 insertions(+), 61 deletions(-) delete mode 100644 framework.h delete mode 100644 pch.c delete mode 100644 pch.h diff --git a/MenuLib.vcxproj b/MenuLib.vcxproj index 3bed85e..fd7d59a 100644 --- a/MenuLib.vcxproj +++ b/MenuLib.vcxproj @@ -98,7 +98,7 @@ - Use + NotUsing Level3 true _DEBUG;_LIB;%(PreprocessorDefinitions) @@ -130,7 +130,7 @@ - Use + NotUsing Level3 true true @@ -147,18 +147,10 @@ - - - - Create - Create - Create - Create - diff --git a/MenuLib.vcxproj.filters b/MenuLib.vcxproj.filters index 91c7ee9..5e4e4e8 100644 --- a/MenuLib.vcxproj.filters +++ b/MenuLib.vcxproj.filters @@ -15,12 +15,6 @@ - - Headerdateien - - - Headerdateien - Headerdateien @@ -29,8 +23,5 @@ Quelldateien - - Quelldateien - \ No newline at end of file diff --git a/framework.h b/framework.h deleted file mode 100644 index 862e2c2..0000000 --- a/framework.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // Selten verwendete Komponenten aus Windows-Headern ausschließen diff --git a/menu.c b/menu.c index 48269a8..d2c349d 100644 --- a/menu.c +++ b/menu.c @@ -1,8 +1,8 @@ -#include "pch.h" -#include "framework.h" - #include "menu.h" +#include +#include + const struct MenuBorder DEFAULT = { '*', '*', '*', '*', '*', '*', '[', ']' }; @@ -21,10 +21,10 @@ const struct MenuBorder SOLID = { void print_content(const int itemc, const struct MenuItem itemv[], const char title[], const struct MenuBorder* border); -void show_menu(const struct MenuPage* pages, const size_t page_count, const bool infinite_loop) +void show_menu(const struct MenuPage* pages, const size_t page_count, const int infinite_loop) { unsigned int page_index = 0; - bool action_performed, loop, page_changed = true; + int action_performed, loop, page_changed = 1; char page_key, itemKey; int i; @@ -50,10 +50,10 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool if (page_key == 'n' || page_key == 'm') break; - page_changed = false; + page_changed = 0; itemKey = page_key; do { - action_performed = false; + action_performed = 0; itemKey != page_key ? itemKey = _getch() : page_key; page_key = 0; @@ -64,7 +64,7 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool // Perform action system("cls"); pages[page_index].items[i].action(pages[page_index].items[i].param); - action_performed = true; + action_performed = 1; // Pause if requested if (pages[page_index].pause) @@ -83,7 +83,7 @@ void show_menu(const struct MenuPage* pages, const size_t page_count, const bool } // Checks if a line index should display a menu item -bool is_item_line(const int line, const int itemc, int* item_index) +int is_item_line(const int line, const int itemc, int* item_index) { if (line >= 2 && line % 2 == 0) { @@ -91,7 +91,7 @@ bool is_item_line(const int line, const int itemc, int* item_index) *item_index = (line - 2) / 2; return *item_index < itemc; } - return false; + return 0; } // Acquires the dimensions (width and height) of the console window diff --git a/menu.h b/menu.h index 3776b21..67efa04 100644 --- a/menu.h +++ b/menu.h @@ -1,6 +1,6 @@ #pragma once -#include "pch.h" +#include /// Represents one menu item in a menu. struct MenuItem { @@ -30,7 +30,7 @@ struct MenuPage { const struct MenuItem* items; const size_t item_count; char* title; - bool loopback, pause; + int loopback, pause; const struct MenuBorder* border; }; @@ -38,4 +38,4 @@ struct MenuPage { /// An array of all pages to display. /// The length of the array pages. /// Always display the first page after a loopback=false item finished executing. -void show_menu(const struct MenuPage* pages, const size_t page_count, const bool infinite_loop); +void show_menu(const struct MenuPage* pages, const size_t page_count, const int infinite_loop); diff --git a/pch.c b/pch.c deleted file mode 100644 index 1fcbac0..0000000 --- a/pch.c +++ /dev/null @@ -1,5 +0,0 @@ -// pch.cpp: Quelldatei, die dem vorkompilierten Header entspricht - -#include "pch.h" - -// Bei der Verwendung vorkompilierter Header ist diese Quelldatei für eine erfolgreiche Kompilierung erforderlich. diff --git a/pch.h b/pch.h deleted file mode 100644 index e0e6e72..0000000 --- a/pch.h +++ /dev/null @@ -1,21 +0,0 @@ -// pch.h: Dies ist eine vorkompilierte Headerdatei. -// Die unten aufgeführten Dateien werden nur einmal kompiliert, um die Buildleistung für zukünftige Builds zu verbessern. -// Dies wirkt sich auch auf die IntelliSense-Leistung aus, Codevervollständigung und viele Features zum Durchsuchen von Code eingeschlossen. -// Die hier aufgeführten Dateien werden jedoch ALLE neu kompiliert, wenn mindestens eine davon zwischen den Builds aktualisiert wird. -// Fügen Sie hier keine Dateien hinzu, die häufig aktualisiert werden sollen, da sich so der Leistungsvorteil ins Gegenteil verkehrt. - -#ifndef PCH_H -#define PCH_H - -// Fügen Sie hier Header hinzu, die vorkompiliert werden sollen. -#include "framework.h" - -#include -#include -#include -#include - -#include -#include - -#endif //PCH_H