Use #pragma once everywhere (thanks @guardonce project)

This commit is contained in:
Bertrand Songis
2020-10-13 09:25:46 +02:00
parent 91b220bac2
commit 66253e1f7d
37 changed files with 37 additions and 111 deletions
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _BASENUMBEREDIT_H_
#define _BASENUMBEREDIT_H_
#pragma once
#include "form.h"
@@ -99,4 +98,3 @@ class BaseNumberEdit : public FormField {
std::function<void(int32_t)> _setValue;
};
#endif // _BASENUMBEREDIT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _BITFIELD_H
#define _BITFIELD_H
#pragma once
#include <inttypes.h>
@@ -82,4 +81,3 @@ inline T bfSingleBitGet(T y, uint8_t i)
return bfBitGet(y, bfBit<T>(i));
}
#endif //BITFIELD_H
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _BITMAP_BUFFER_H_
#define _BITMAP_BUFFER_H_
#pragma once
#include <stdint.h>
#include <stdlib.h>
@@ -519,4 +518,3 @@ class BitmapBuffer: public BitmapBufferBase<pixel_t>
extern BitmapBuffer * lcd;
#endif // _BITMAP_BUFFER_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _BUFFERED_WINDOW_H_
#define _BUFFERED_WINDOW_H_
#pragma once
#include "window.h"
@@ -123,4 +122,3 @@ class TransparentBitmapBackground: public TransparentBufferedWindow<Window>
}
};
#endif // _BUFFERED_WINDOW_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _BUTTON_H_
#define _BUTTON_H_
#pragma once
#include "form.h"
@@ -134,4 +133,3 @@ class IconButton: public Button {
uint8_t icon;
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _CAROUSEL_H_
#define _CAROUSEL_H_
#pragma once
#include <vector>
#include "button.h"
@@ -139,4 +138,3 @@ class Carousel: public Window {
CarouselWindow * body = nullptr;
};
#endif // _CAROUSEL_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _CHECKBOX_H_
#define _CHECKBOX_H_
#pragma once
#include "form.h"
@@ -69,4 +68,3 @@ class CheckBox : public FormField {
std::function<void(uint8_t)> _setValue;
};
#endif // _CHECKBOX_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _CHOICE_H_
#define _CHOICE_H_
#pragma once
#include <vector>
#include "form.h"
@@ -159,4 +158,3 @@ class Choice : public ChoiceBase {
virtual void openMenu();
};
#endif // _CHOICE_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _COLOREDIT_H_
#define _COLOREDIT_H_
#pragma once
#include "form.h"
@@ -34,4 +33,3 @@ class ColorEdit : public FormGroup {
#endif
};
#endif // _COLOREDIT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _DIALOG_H_
#define _DIALOG_H_
#pragma once
#include "modal_window.h"
#include "form.h"
@@ -55,4 +54,3 @@ class Dialog: public ModalWindow {
DialogWindowContent * content;
};
#endif // _DIALOG_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _EXPANSION_PANEL_H_
#define _EXPANSION_PANEL_H_
#pragma once
#include "form.h"
@@ -87,4 +86,3 @@ class ExpansionPanel: public FormGroup {
bool isOpen = false;
};
#endif // _EXPANSION_PANEL_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _FILECHOICE_H_
#define _FILECHOICE_H_
#pragma once
#include "choice.h"
#include <string>
@@ -54,4 +53,3 @@ class FileChoice: public ChoiceBase {
bool openMenu();
};
#endif // _FILECHOICE_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _FONT_H_
#define _FONT_H_
#pragma once
#include "libopenui_types.h"
@@ -27,4 +26,3 @@ uint8_t getFontHeight(LcdFlags flags);
int getCharWidth(uint8_t c, const uint16_t * spec);
int getTextWidth(const char * s, int len = 0, LcdFlags flags = 0);
#endif // _FONT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _FORM_H_
#define _FORM_H_
#pragma once
#include "window.h"
@@ -173,4 +172,3 @@ class FormWindow: public FormGroup {
#endif
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _GRIDLAYOUT_H_
#define _GRIDLAYOUT_H_
#pragma once
#include "window.h"
@@ -120,4 +119,3 @@ class FormGridLayout: public GridLayout {
coord_t lineMarginRight = PAGE_PADDING;
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _KEYBOARD_BASE_H_
#define _KEYBOARD_BASE_H_
#pragma once
#include "mainwindow.h"
#include "form.h"
@@ -86,4 +85,3 @@ class Keyboard: public FormWindow {
}
};
#endif // _KEYBOARD_BASE_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _KEYBOARD_NUMBER_H_
#define _KEYBOARD_NUMBER_H_
#pragma once
#include "keyboard_base.h"
@@ -48,4 +47,3 @@ class NumberKeyboard : public Keyboard {
static NumberKeyboard * _instance;
};
#endif // _KEYBOARD_NUMBER_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _KEYBOARD_TEXT_H_
#define _KEYBOARD_TEXT_H_
#pragma once
#include "keyboard_base.h"
@@ -61,4 +60,3 @@ class TextKeyboard : public Keyboard {
const char * const * layout;
};
#endif // _KEYBOARD_TEXT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_DEFINES_H_
#define _LIBOPEUI_DEFINES_H_
#pragma once
#include "libopenui_types.h"
@@ -116,4 +115,3 @@
#define TABLE_HEADER_BGCOLOR COLOR(TABLE_HEADER_BGCOLOR_INDEX)
#define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_DEPENDS_H_
#define _LIBOPEUI_DEPENDS_H_
#pragma once
#include <inttypes.h>
#include "libopenui_config.h"
@@ -31,4 +30,3 @@ void onKeyError();
void killEvents(event_t event);
event_t getWindowEvent();
#endif // _LIBOPEUI_DEPENDS_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_FILE_H_
#define _LIBOPEUI_FILE_H_
#pragma once
#include <string>
#include <string.h>
@@ -38,4 +37,3 @@ inline bool compare_nocase(const std::string &first, const std::string &second)
return strcasecmp(first.c_str(), second.c_str()) < 0;
}
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_GLOBALS_H_
#define _LIBOPEUI_GLOBALS_H_
#pragma once
#include <inttypes.h>
#include "libopenui_config.h"
@@ -32,4 +31,3 @@ inline void lcdSetColor(uint16_t color)
lcdColorTable[CUSTOM_COLOR_INDEX] = color;
}
#endif // _LIBOPEUI_GLOBALS_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_HELPERS_H_
#define _LIBOPEUI_HELPERS_H_
#pragma once
#include <string>
#include <cstring>
@@ -61,4 +60,3 @@ inline std::string TEXT_AT_INDEX(const char * val, uint8_t idx)
return std::string(start, min<uint8_t>(val[0], (uint8_t)strlen(start)));
}
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _LIBOPEUI_TYPES_H_
#define _LIBOPEUI_TYPES_H_
#pragma once
#include <inttypes.h>
@@ -73,4 +72,3 @@ struct rect_t
typedef uint32_t LcdFlags;
typedef uint16_t event_t;
#endif // _LIBOPEUI_TYPES_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _MAINWINDOW_H_
#define _MAINWINDOW_H_
#pragma once
#include <utility>
#include "window.h"
@@ -65,4 +64,3 @@ class MainWindow: public Window {
extern MainWindow mainWindow;
#endif // _MAINWINDOW_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _MENU_H_
#define _MENU_H_
#pragma once
#include <vector>
#include <functional>
@@ -223,4 +222,3 @@ Menu * MenuBody::getParentMenu()
return static_cast<Menu *>(getParent()->getParent());
}
#endif // _MENU_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _MENUTOOLBAR_H_
#define _MENUTOOLBAR_H_
#pragma once
#include "button.h"
#include "menu.h"
@@ -170,5 +169,4 @@ class MenuToolbar: public FormGroup {
}
};
#endif // _MENUTOOLBAR_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _MODAL_WINDOW_H_
#define _MODAL_WINDOW_H_
#pragma once
#include "window.h"
@@ -122,4 +121,3 @@ class ModalWindowContent: public Window {
std::string title;
};
#endif // _MODAL_WINDOW_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _NUMBEREDIT_H_
#define _NUMBEREDIT_H_
#pragma once
#include "basenumberedit.h"
#include <string>
@@ -78,4 +77,3 @@ class NumberEdit : public BaseNumberEdit {
std::function<bool(int)> isValueAvailable;
};
#endif // _NUMBEREDIT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _PROGRESS_H_
#define _PROGRESS_H_
#pragma once
#include "window.h"
@@ -48,4 +47,3 @@ class Progress : public Window {
int value = 0;
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _ROLLER_H_
#define _ROLLER_H_
#pragma once
#include <touch.h>
#include <choice.h>
@@ -175,4 +174,3 @@ class Roller: public Choice
}
};
#endif // _ROLLER_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _SLIDER_H_
#define _SLIDER_H_
#pragma once
#include "form.h"
@@ -69,4 +68,3 @@ class Slider: public FormField {
std::function<void(int32_t)> _setValue;
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _STATIC_H_
#define _STATIC_H_
#pragma once
#include "window.h"
#include "button.h" // TODO just for BUTTON_BACKGROUND
@@ -186,4 +185,3 @@ class DynamicNumber: public Window
const char * suffix;
};
#endif
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _TABLE_H_
#define _TABLE_H_
#pragma once
#include <utility>
#include <vector>
@@ -342,4 +341,3 @@ class Table: public FormField {
Body body;
};
#endif // _TABLE_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _TEXTEDIT_H_
#define _TEXTEDIT_H_
#pragma once
#include "form.h"
@@ -115,4 +114,3 @@ class TextEdit : public FormField {
};
#endif // _TEXTEDIT_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _THEME_H_
#define _THEME_H_
#pragma once
#include "bitmapbuffer.h"
#include "checkbox.h"
@@ -63,4 +62,3 @@ extern Theme * theme;
MenuWindowContent * createMenuWindow(Menu * menu);
DialogWindowContent * createDialogWindow(Dialog * dialog, const rect_t & rect);
#endif // _THEME_H_
+1 -3
View File
@@ -17,8 +17,7 @@
* Lesser General Public License for more details.
*/
#ifndef _WINDOW_H_
#define _WINDOW_H_
#pragma once
#include <stdlib.h>
#include <stdio.h>
@@ -419,4 +418,3 @@ class Window {
bool hasOpaqueRect(const rect_t & testRect) const;
};
#endif // _WINDOW_H_