- changed header guards into #pragma once

Wed, 05 Mar 2014 03:45:49 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Wed, 05 Mar 2014 03:45:49 +0200
changeset 641
425b169a82aa
parent 640
d4dda62c6600
child 642
751a8df42842

- changed header guards into #pragma once

src/AddObjectDialog.h file | annotate | diff | comparison | revisions
src/ColorSelector.h file | annotate | diff | comparison | revisions
src/Colors.h file | annotate | diff | comparison | revisions
src/Configuration.h file | annotate | diff | comparison | revisions
src/ConfigurationDialog.h file | annotate | diff | comparison | revisions
src/CrashCatcher.h file | annotate | diff | comparison | revisions
src/Dialogs.h file | annotate | diff | comparison | revisions
src/Document.h file | annotate | diff | comparison | revisions
src/Documentation.h file | annotate | diff | comparison | revisions
src/EditHistory.h file | annotate | diff | comparison | revisions
src/GLRenderer.h file | annotate | diff | comparison | revisions
src/LDConfig.h file | annotate | diff | comparison | revisions
src/LDObject.h file | annotate | diff | comparison | revisions
src/Main.h file | annotate | diff | comparison | revisions
src/MainWindow.h file | annotate | diff | comparison | revisions
src/MessageLog.h file | annotate | diff | comparison | revisions
src/Misc.h file | annotate | diff | comparison | revisions
src/PartDownloader.h file | annotate | diff | comparison | revisions
src/Primitives.h file | annotate | diff | comparison | revisions
src/PropertyMacro.h file | annotate | diff | comparison | revisions
src/Types.h file | annotate | diff | comparison | revisions
src/Version.h file | annotate | diff | comparison | revisions
src/Widgets.h file | annotate | diff | comparison | revisions
src/misc/DocumentPointer.h file | annotate | diff | comparison | revisions
src/misc/InvokationDeferer.h file | annotate | diff | comparison | revisions
src/misc/RingFinder.h file | annotate | diff | comparison | revisions
--- a/src/AddObjectDialog.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/AddObjectDialog.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_ADDOBJECTDIALOG_H
-#define LDFORGE_ADDOBJECTDIALOG_H
-
+#pragma once
 #include <QDialog>
 #include "LDObject.h"
 
@@ -69,5 +67,3 @@
 		void slot_colorButtonClicked();
 		void slot_subfileTypeChanged();
 };
-
-#endif // LDFORGE_ADDOBJECTDIALOG_H
--- a/src/ColorSelector.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/ColorSelector.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_COLORSELECTOR_H
-#define LDFORGE_COLORSELECTOR_H
-
+#pragma once
 #include <QDialog>
 #include "Main.h"
 
@@ -50,5 +48,3 @@
 		void drawScene();
 		void drawColorInfo();
 };
-
-#endif // LDFORGE_COLORSELECTOR_H
--- a/src/Colors.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Colors.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_COLORS_H
-#define LDFORGE_COLORS_H
-
+#pragma once
 #include <QColor>
 #include "Main.h"
 
@@ -42,5 +40,3 @@
 // Main and edge color identifiers
 static const int maincolor = 16;
 static const int edgecolor = 24;
-
-#endif // LDFORGE_COLORS_H
--- a/src/Configuration.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Configuration.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,16 +16,13 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_CONFIG_H
-#define LDFORGE_CONFIG_H
-
+#pragma once
+#include <QString>
+#include <QVariant>
+#include <QKeySequence>
 #include "PropertyMacro.h"
 #include "Types.h"
 
-// =============================================================================
-#include <QString>
-#include <QVariant>
-#include <QKeySequence>
 class QSettings;
 
 #define MAX_INI_LINE 512
@@ -148,45 +145,50 @@
 	ValueType	m_default;
 
 // =============================================================================
+//
 class IntConfig : public Config
 {
 	IMPLEMENT_CONFIG (Int)
 };
 
 // =============================================================================
+//
 class StringConfig : public Config
 {
 	IMPLEMENT_CONFIG (String)
 };
 
 // =============================================================================
+//
 class FloatConfig : public Config
 {
 	IMPLEMENT_CONFIG (Float)
 };
 
 // =============================================================================
+//
 class BoolConfig : public Config
 {
 	IMPLEMENT_CONFIG (Bool)
 };
 
 // =============================================================================
+//
 class KeySequenceConfig : public Config
 {
 	IMPLEMENT_CONFIG (KeySequence)
 };
 
 // =============================================================================
+//
 class ListConfig : public Config
 {
 	IMPLEMENT_CONFIG (List)
 };
 
 // =============================================================================
+//
 class VertexConfig : public Config
 {
 	IMPLEMENT_CONFIG (Vertex)
 };
-
-#endif // LDFORGE_CONFIG_H
--- a/src/ConfigurationDialog.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/ConfigurationDialog.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_CONFIGDIALOG_H
-#define LDFORGE_CONFIGDIALOG_H
-
+#pragma once
 #include "MainWindow.h"
 #include <QDialog>
 
@@ -119,5 +117,3 @@
 	private slots:
 		virtual void keyPressEvent (QKeyEvent* ev) override;
 };
-
-#endif // LDFORGE_CONFIGDIALOG_H
--- a/src/CrashCatcher.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/CrashCatcher.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,14 +16,9 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_CRASHCATCHER_H
-#define LDFORGE_CRASHCATCHER_H
-
+#pragma once
 #ifdef __unix__
-
 void initCrashCatcher();
-
 #else // ifdef __unix__
-#define initCrashCatcher()
+# define initCrashCatcher()
 #endif // ifdef __unix__
-#endif // ifndef LDFORGE_CRASHCATCHER_H
\ No newline at end of file
--- a/src/Dialogs.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Dialogs.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_DIALOGS_H
-#define LDFORGE_DIALOGS_H
-
+#pragma once
 #include <QDialog>
 #include "Main.h"
 #include "Types.h"
@@ -141,5 +139,3 @@
 };
 
 void bombBox (const QString& message);
-
-#endif // LDFORGE_DIALOGS_H
--- a/src/Document.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Document.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_DOCUMENT_H
-#define LDFORGE_DOCUMENT_H
-
+#pragma once
 #include <QObject>
 #include "Main.h"
 #include "LDObject.h"
@@ -41,18 +39,16 @@
 }
 
 // =============================================================================
-// LDDocument
 //
-// The LDDocument class stores a document opened in LDForge either as a editable
-// file for the user or for subfile caching. Its methods handle file input and
-// output.
+// This class stores a document either as a editable file for the user or for
+// subfile caching. Its methods handle file input and output.
 //
 // A file is implicit when they are opened automatically for caching purposes
 // and are hidden from the user. User-opened files are explicit (not implicit).
 //
 // The default name is a placeholder, initially suggested name for a file. The
 // primitive generator uses this to give initial names to primitives.
-// =============================================================================
+//
 class LDDocument : public QObject
 {
 	properties:
@@ -208,14 +204,13 @@
 extern QList<LDDocument*> g_loadedFiles; // Vector of all currently opened files.
 
 // =============================================================================
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// =============================================================================
-// FileLoader
+//
+// LDFileLoader
 //
 // Loads the given file and parses it to LDObjects using parseLine. It's a
 // separate class so as to be able to do the work progressively through the
 // event loop, allowing the program to maintain responsivity during loading.
-// =============================================================================
+//
 class LDFileLoader : public QObject
 {
 	Q_OBJECT
@@ -241,5 +236,3 @@
 		void progressUpdate (int progress);
 		void workDone();
 };
-
-#endif // LDFORGE_DOCUMENT_H
--- a/src/Documentation.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Documentation.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,11 +16,6 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_DOCS_H
-#define LDFORGE_DOCS_H
-
+#pragma once
 extern const char* g_docs_overlays;
-
 void showDocumentation (const char* text);
-
-#endif // LDFORGE_DOCS_H
\ No newline at end of file
--- a/src/EditHistory.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/EditHistory.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_HISTORY_H
-#define LDFORGE_HISTORY_H
-
+#pragma once
 #include "Main.h"
 #include "LDObject.h"
 
@@ -180,5 +178,3 @@
 	private:
 		int a, b;
 };
-
-#endif // LDFORGE_HISTORY_H
--- a/src/GLRenderer.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/GLRenderer.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_GLDRAW_H
-#define LDFORGE_GLDRAW_H
-
+#pragma once
 #include <QGLWidget>
 #include "Main.h"
 #include "LDObject.h"
@@ -305,5 +303,3 @@
 
 extern const GL::EFixedCamera g_Cameras[7];
 extern const char* g_CameraNames[7];
-
-#endif // LDFORGE_GLDRAW_H
--- a/src/LDConfig.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/LDConfig.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_LDCONFIG_H
-#define LDFORGE_LDCONFIG_H
-
+#pragma once
 #include "Types.h"
 #include <QStringList>
 
@@ -54,5 +52,3 @@
 };
 
 void parseLDConfig();
-
-#endif // LDFORGE_LDCONFIG_H
--- a/src/LDObject.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/LDObject.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_LDTYPES_H
-#define LDFORGE_LDTYPES_H
-
+#pragma once
 #include "Main.h"
 #include "Types.h"
 #include "misc/DocumentPointer.h"
@@ -566,5 +564,3 @@
 static const int hires = 48;
 
 QString getLicenseText (int id);
-
-#endif // LDFORGE_LDTYPES_H
--- a/src/Main.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Main.h	Wed Mar 05 03:45:49 2014 +0200
@@ -20,9 +20,7 @@
 // This file is included one way or another in every source file of LDForge.
 // Stuff defined and included here is universally included.
 
-#ifndef LDFORGE_MAIN_H
-#define LDFORGE_MAIN_H
-
+#pragma once
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -103,5 +101,3 @@
 static const char* __func__ = ""; // Current function name
 typedef void FILE; // :|
 #endif // IN_IDE_PARSER
-
-#endif // LDFORGE_MAIN_H
--- a/src/MainWindow.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/MainWindow.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_GUI_H
-#define LDFORGE_GUI_H
-
+#pragma once
 #include <QMainWindow>
 #include <QAction>
 #include <QListWidget>
@@ -254,11 +252,15 @@
 };
 
 // =============================================================================
+//
 // Pointer to the instance of MainWindow.
+//
 extern MainWindow* g_win;
 
 // =============================================================================
-// Other GUI-related stuff not directly part of MainWindow:
+//
+// Other GUI-related stuff not directly part of MainWindow
+//
 QPixmap getIcon (QString iconName); // Get an icon from the resource dir
 QList<LDQuickColor> quickColorsFromConfig(); // Make a list of quick colors based on config
 bool confirm (QString title, QString msg); // Generic confirm prompt
@@ -269,10 +271,10 @@
 QImage imageFromScreencap (uchar* data, int w, int h);
 
 // =============================================================================
-// =============================================================================
+//
 // Takes in pairs of radio buttons and respective values and returns the value of
 // the first found radio button that was checked.
-// =============================================================================
+//
 template<class T>
 T radioSwitch (const T& defval, QList<pair<QRadioButton*, T>> haystack)
 {
@@ -284,10 +286,10 @@
 }
 
 // =============================================================================
-// =============================================================================
+//
 // Takes in pairs of radio buttons and respective values and checks the first
 // found radio button to have the given value.
-// =============================================================================
+//
 template<class T>
 void radioDefault (const T& expr, QList<pair<QRadioButton*, T>> haystack)
 {
@@ -300,5 +302,3 @@
 		}
 	}
 }
-
-#endif // LDFORGE_GUI_H
--- a/src/MessageLog.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/MessageLog.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_MESSAGELOG_H
-#define LDFORGE_MESSAGELOG_H
-
+#pragma once
 #include <QObject>
 #include <QDate>
 #include "Main.h"
@@ -66,5 +64,3 @@
 	private slots:
 		void tick();
 };
-
-#endif // LDFORGE_MESSAGELOG_H
--- a/src/Misc.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Misc.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_MISC_H
-#define LDFORGE_MISC_H
-
+#pragma once
 #include <QVector>
 #include "Configuration.h"
 #include "Main.h"
@@ -138,5 +136,3 @@
 	std::sort (a.begin(), a.end());
 	a.erase (std::unique (a.begin(), a.end()), a.end());
 }
-
-#endif // LDFORGE_MISC_H
--- a/src/PartDownloader.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/PartDownloader.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_DOWNLOAD_H
-#define LDFORGE_DOWNLOAD_H
-
+#pragma once
 #include <QDialog>
 #include "Main.h"
 #include "Types.h"
@@ -33,7 +31,7 @@
 class QAbstractButton;
 
 // =============================================================================
-// =============================================================================
+//
 class PartDownloader : public QDialog
 {
 	typedefs:
@@ -87,7 +85,7 @@
 };
 
 // =============================================================================
-// =============================================================================
+//
 class PartDownloadRequest : public QObject
 {
 	typedefs:
@@ -130,5 +128,3 @@
 		void downloadProgress (qint64 recv, qint64 total);
 		void abort();
 };
-
-#endif // LDFORGE_DOWNLOAD_H
--- a/src/Primitives.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Primitives.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_PRIMITIVES_H
-#define LDFORGE_PRIMITIVES_H
-
+#pragma once
 #include "Main.h"
 #include "Types.h"
 #include <QRegExp>
@@ -130,5 +128,3 @@
 LDDocument* getPrimitive (PrimitiveType type, int segs, int divs, int num);
 
 QString radialFileName (PrimitiveType type, int segs, int divs, int num);
-
-#endif // LDFORGE_PRIMITIVES_H
--- a/src/PropertyMacro.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/PropertyMacro.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,8 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_PROPERTY_H
-#define LDFORGE_PROPERTY_H
+#pragma once
 
 // =============================================================================
 //
@@ -199,5 +198,3 @@
 		{																		\
 			return PROPERTY_GET_ACCESSOR (NAME)().size();						\
 		}
-
-#endif // LDFORGE_PROPERTY_H
\ No newline at end of file
--- a/src/Types.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Types.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_TYPES_H
-#define LDFORGE_TYPES_H
-
+#pragma once
 #include <QString>
 #include <QObject>
 #include <QStringList>
@@ -311,5 +309,3 @@
 extern const Matrix g_identity; // Identity matrix
 
 static const double pi = 3.14159265358979323846;
-
-#endif // LDFORGE_TYPES_H
--- a/src/Version.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Version.h	Wed Mar 05 03:45:49 2014 +0200
@@ -34,4 +34,4 @@
 
 #ifdef RELEASE
 # undef DEBUG
-#endif // RELEASE
\ No newline at end of file
+#endif // RELEASE
--- a/src/Widgets.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/Widgets.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,9 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef WIDGETS_H
-#define WIDGETS_H
-
+#pragma once
 #include <QGroupBox>
 #include <QSpinBox>
 #include <map>
@@ -92,5 +90,3 @@
 		void slot_buttonPressed (int btn);
 		void slot_buttonReleased (int btn);
 };
-
-#endif // WIDGETS_H
--- a/src/misc/DocumentPointer.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/misc/DocumentPointer.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,8 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_DOCUMENT_POINTER_H
-#define LDFORGE_DOCUMENT_POINTER_H
+#pragma once
 
 #include "../Main.h"
 
@@ -55,4 +54,3 @@
 		void removeReference();
 };
 
-#endif // LDFORGE_DOCUMENT_POINTER_H
\ No newline at end of file
--- a/src/misc/InvokationDeferer.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/misc/InvokationDeferer.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,8 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_MISC_INVOKATION_DEFERER_H
-#define LDFORGE_MISC_INVOKATION_DEFERER_H
+#pragma once
 
 #include <QObject>
 
@@ -43,4 +42,3 @@
 
 void invokeLater (InvokationDeferer::FunctionType func);
 
-#endif // LDFORGE_MISC_INVOKATION_DEFERER_H
\ No newline at end of file
--- a/src/misc/RingFinder.h	Wed Mar 05 03:39:31 2014 +0200
+++ b/src/misc/RingFinder.h	Wed Mar 05 03:45:49 2014 +0200
@@ -16,8 +16,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef LDFORGE_MISC_RINGFINDER_H
-#define LDFORGE_MISC_RINGFINDER_H
+#pragma once
 
 #include "../Main.h"
 
@@ -85,4 +84,3 @@
 
 extern RingFinder g_RingFinder;
 
-#endif // LDFORGE_MISC_RINGFINDER_H
\ No newline at end of file

mercurial