diff --git a/src/AboutDialog.h b/src/AboutDialog.h index 2211e63598..73c52a5e2e 100644 --- a/src/AboutDialog.h +++ b/src/AboutDialog.h @@ -1,5 +1,4 @@ -#ifndef ABOUTDIALOG_H_ -#define ABOUTDIALOG_H_ +#pragma once #include "ui_AboutDialog.h" @@ -21,5 +20,3 @@ class AboutDialog : public QDialog, public Ui::AboutDialog this->aboutText->setHtml(tmp); } }; - -#endif diff --git a/src/AppleEvents.h b/src/AppleEvents.h index 90023994fd..204fb5b86a 100644 --- a/src/AppleEvents.h +++ b/src/AppleEvents.h @@ -1,6 +1,3 @@ -#ifndef APPLEEVENTS_H_ -#define APPLEEVENTS_H_ +#pragma once void installAppleEventHandlers(); - -#endif diff --git a/src/AutoUpdater.h b/src/AutoUpdater.h index 18527c8fb8..0580a694d1 100644 --- a/src/AutoUpdater.h +++ b/src/AutoUpdater.h @@ -1,5 +1,4 @@ -#ifndef AUTOUPDATER_H_ -#define AUTOUPDATER_H_ +#pragma once #include @@ -21,5 +20,3 @@ class AutoUpdater protected: static AutoUpdater *updater_instance; }; - -#endif diff --git a/src/CGALCache.h b/src/CGALCache.h index b82d8cc3a2..f62e7dc51b 100644 --- a/src/CGALCache.h +++ b/src/CGALCache.h @@ -1,5 +1,4 @@ -#ifndef CGALCACHE_H_ -#define CGALCACHE_H_ +#pragma once #include "cache.h" #include "memory.h" @@ -33,5 +32,3 @@ class CGALCache Cache cache; }; - -#endif diff --git a/src/CGALRenderer.h b/src/CGALRenderer.h index 8c9e6cc4d8..193e1e687a 100644 --- a/src/CGALRenderer.h +++ b/src/CGALRenderer.h @@ -1,5 +1,4 @@ -#ifndef CGALRENDERER_H_ -#define CGALRENDERER_H_ +#pragma once #include "renderer.h" @@ -14,5 +13,3 @@ class CGALRenderer : public Renderer class Polyhedron *polyhedron; shared_ptr polyset; }; - -#endif diff --git a/src/CGAL_Nef3_workaround.h b/src/CGAL_Nef3_workaround.h index b44585a3d4..c9efd0fe33 100644 --- a/src/CGAL_Nef3_workaround.h +++ b/src/CGAL_Nef3_workaround.h @@ -55,8 +55,7 @@ distributed, this file may become obsolete and can be deleted from OpenSCAD */ -#ifndef _CGAL_NEF3_WORKAROUND_H -#define _CGAL_NEF3_WORKAROUND_H +#pragma once #include #include @@ -345,9 +344,3 @@ bool convert_to_Polyhedron( const CGAL::Nef_polyhedron_3 &N, CGAL::Polyh } //namespace nefworkaround - - - - -#endif - diff --git a/src/CGAL_Nef_polyhedron.h b/src/CGAL_Nef_polyhedron.h index 44813df505..72f6b33db7 100644 --- a/src/CGAL_Nef_polyhedron.h +++ b/src/CGAL_Nef_polyhedron.h @@ -1,5 +1,4 @@ -#ifndef CGAL_NEF_POLYHEDRON_H_ -#define CGAL_NEF_POLYHEDRON_H_ +#pragma once #include "Geometry.h" #include "cgal.h" @@ -31,5 +30,3 @@ class CGAL_Nef_polyhedron : public Geometry void transform( const Transform3d &matrix ); shared_ptr p3; }; - -#endif diff --git a/src/CGAL_renderer.h b/src/CGAL_renderer.h index 27ee59a6e9..c66337e346 100644 --- a/src/CGAL_renderer.h +++ b/src/CGAL_renderer.h @@ -24,11 +24,9 @@ * */ -#ifndef CGAL_RENDERER_H -#define CGAL_RENDERER_H +#pragma once #ifndef NULLGL - #include "OGL_helper.h" #undef CGAL_NEF3_MARKED_VERTEX_COLOR #undef CGAL_NEF3_MARKED_EDGE_COLOR @@ -119,8 +117,3 @@ class Polyhedron }; #endif // NULLGL - - - - -#endif // CGAL_RENDERER_H diff --git a/src/CSGTermEvaluator.h b/src/CSGTermEvaluator.h index c7633ada86..12afdd09bd 100644 --- a/src/CSGTermEvaluator.h +++ b/src/CSGTermEvaluator.h @@ -1,5 +1,4 @@ -#ifndef CSGTERMEVALUATOR_H_ -#define CSGTERMEVALUATOR_H_ +#pragma once #include #include @@ -46,5 +45,3 @@ class CSGTermEvaluator : public Visitor const Tree &tree; class GeometryEvaluator *geomevaluator; }; - -#endif diff --git a/src/Camera.h b/src/Camera.h index 6079672b50..87be4e3a25 100644 --- a/src/Camera.h +++ b/src/Camera.h @@ -1,5 +1,4 @@ -#ifndef OPENSCAD_CAMERA_H_ -#define OPENSCAD_CAMERA_H_ +#pragma once /* @@ -86,6 +85,3 @@ class Camera unsigned int pixel_width; unsigned int pixel_height; }; - - -#endif diff --git a/src/CocoaUtils.h b/src/CocoaUtils.h index 35e8c28abd..a720e885f6 100644 --- a/src/CocoaUtils.h +++ b/src/CocoaUtils.h @@ -1,5 +1,4 @@ -#ifndef COCOAUTILS_H_ -#define COCOAUTILS_H_ +#pragma once #include @@ -9,5 +8,3 @@ class CocoaUtils static void endApplication(); static void nslog(const std::string &str, void *userdata); }; - -#endif diff --git a/src/CsgInfo.h b/src/CsgInfo.h index 91a28ee0fa..bb054aea43 100644 --- a/src/CsgInfo.h +++ b/src/CsgInfo.h @@ -1,5 +1,4 @@ -#ifndef __CSGINFO_H__ -#define __CSGINFO_H__ +#pragma once #include "OffscreenView.h" #include "csgterm.h" @@ -87,6 +86,3 @@ class CsgInfo return true; } }; - -#endif - diff --git a/src/EventFilter.h b/src/EventFilter.h index c3942b5059..3299ba5780 100644 --- a/src/EventFilter.h +++ b/src/EventFilter.h @@ -1,5 +1,4 @@ -#ifndef FILTER_H_ -#define FILTER_H_ +#pragma once #include #include @@ -24,5 +23,3 @@ class EventFilter : public QObject } } }; - -#endif diff --git a/src/GLView.h b/src/GLView.h index af04e81211..3fba6f6712 100644 --- a/src/GLView.h +++ b/src/GLView.h @@ -1,5 +1,4 @@ -#ifndef GLVIEW_H_ -#define GLVIEW_H_ +#pragma once /* GLView: A basic OpenGL rectangle for rendering images. @@ -79,5 +78,3 @@ class GLView int opencsg_id; #endif }; - -#endif diff --git a/src/GeometryEvaluator.h b/src/GeometryEvaluator.h index c1c5001af9..21f20ddac7 100644 --- a/src/GeometryEvaluator.h +++ b/src/GeometryEvaluator.h @@ -1,5 +1,4 @@ -#ifndef GEOMETRYEVALUATOR_H_ -#define GEOMETRYEVALUATOR_H_ +#pragma once #include "visitor.h" #include "enums.h" @@ -73,6 +72,3 @@ class GeometryEvaluator : public Visitor public: }; - - -#endif diff --git a/src/MainWindow.h b/src/MainWindow.h index 410ac18bdc..7056d46dd2 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -1,5 +1,4 @@ -#ifndef MAINWINDOW_H_ -#define MAINWINDOW_H_ +#pragma once #include #include "ui_MainWindow.h" @@ -237,5 +236,3 @@ class GuiLocker private: static unsigned int gui_locked; }; - -#endif diff --git a/src/ModuleCache.h b/src/ModuleCache.h index 0c15fbdaaf..a4dd13da4a 100644 --- a/src/ModuleCache.h +++ b/src/ModuleCache.h @@ -1,3 +1,5 @@ +#pragma once + #include #include diff --git a/src/OGL_helper.h b/src/OGL_helper.h index 74f92bf304..4d818567f6 100644 --- a/src/OGL_helper.h +++ b/src/OGL_helper.h @@ -17,8 +17,7 @@ // // Author(s) : Peter Hachenberger -#ifndef CGAL_NEF_OPENGL_HELPER_H -#define CGAL_NEF_OPENGL_HELPER_H +#pragma once #include #include @@ -702,4 +701,3 @@ namespace OGL { } // namespace OGL } //namespace CGAL -#endif // CGAL_NEF_OPENGL_HELPER_H diff --git a/src/OffscreenContext.h b/src/OffscreenContext.h index e74e1048b2..fe68f7c437 100644 --- a/src/OffscreenContext.h +++ b/src/OffscreenContext.h @@ -1,5 +1,4 @@ -#ifndef OFFSCREENCONTEXT_H_ -#define OFFSCREENCONTEXT_H_ +#pragma once // Here we implement a 'portability' pattern but since we are mixing // Objective-C with C++, it is a bit different. The main struct @@ -15,5 +14,3 @@ bool teardown_offscreen_context(OffscreenContext *ctx); bool save_framebuffer(OffscreenContext *ctx, const char * filename); bool save_framebuffer(OffscreenContext *ctx, std::ostream &output); std::string offscreen_context_getinfo(OffscreenContext *ctx); - -#endif diff --git a/src/OffscreenView.h b/src/OffscreenView.h index 8a3daaf56e..9e6a1879be 100644 --- a/src/OffscreenView.h +++ b/src/OffscreenView.h @@ -1,5 +1,4 @@ -#ifndef OFFSCREENVIEW_H_ -#define OFFSCREENVIEW_H_ +#pragma once #include "OffscreenContext.h" #include @@ -27,5 +26,3 @@ class OffscreenView : public GLView void display_opencsg_warning(); #endif }; - -#endif diff --git a/src/OpenCSGRenderer.h b/src/OpenCSGRenderer.h index e6091aa7d9..cca7161d3e 100644 --- a/src/OpenCSGRenderer.h +++ b/src/OpenCSGRenderer.h @@ -1,5 +1,4 @@ -#ifndef OPENCSGRENDERER_H_ -#define OPENCSGRENDERER_H_ +#pragma once #include "renderer.h" #include "system-gl.h" @@ -19,5 +18,3 @@ class OpenCSGRenderer : public Renderer CSGChain *background_chain; GLint *shaderinfo; }; - -#endif diff --git a/src/OpenCSGWarningDialog.h b/src/OpenCSGWarningDialog.h index 5d9c8fa209..4cf9ec0545 100644 --- a/src/OpenCSGWarningDialog.h +++ b/src/OpenCSGWarningDialog.h @@ -1,5 +1,4 @@ -#ifndef OPENCSGWARNINGDIALOG_H_ -#define OPENCSGWARNINGDIALOG_H_ +#pragma once #include "ui_OpenCSGWarningDialog.h" @@ -12,5 +11,3 @@ class OpenCSGWarningDialog : public QDialog, public Ui::OpenCSGWarningDialog public slots: void setText(const QString &text); }; - -#endif diff --git a/src/PlatformUtils.h b/src/PlatformUtils.h index 964dedb8c3..5b26852505 100644 --- a/src/PlatformUtils.h +++ b/src/PlatformUtils.h @@ -1,5 +1,4 @@ -#ifndef PLATFORMUTILS_H_ -#define PLATFORMUTILS_H_ +#pragma once #include @@ -21,5 +20,3 @@ namespace PlatformUtils { */ std::string pathSeparatorChar(); } - -#endif diff --git a/src/Polygon2d-CGAL.h b/src/Polygon2d-CGAL.h index 49ed953bea..4b7cdc4cd5 100644 --- a/src/Polygon2d-CGAL.h +++ b/src/Polygon2d-CGAL.h @@ -1,5 +1,4 @@ -#ifndef POLYGON2D_CGAL_H_ -#define POLYGON2D_CGAL_H_ +#pragma once #include "Polygon2d.h" #include "cgal.h" @@ -8,5 +7,3 @@ namespace Polygon2DCGAL { CGAL_Nef_polyhedron toNefPolyhedron(); }; - -#endif diff --git a/src/Preferences.h b/src/Preferences.h index 62e7ee5e6b..1ee7b856d7 100644 --- a/src/Preferences.h +++ b/src/Preferences.h @@ -1,5 +1,4 @@ -#ifndef PREFERENCES_H_ -#define PREFERENCES_H_ +#pragma once #include #include @@ -58,5 +57,3 @@ public slots: static Preferences *instance; static const char *featurePropertyName; }; - -#endif diff --git a/src/ProgressWidget.h b/src/ProgressWidget.h index f610279d9a..357e4c27dc 100644 --- a/src/ProgressWidget.h +++ b/src/ProgressWidget.h @@ -1,5 +1,4 @@ -#ifndef PROGRESSWIDGET_H_ -#define PROGRESSWIDGET_H_ +#pragma once #include "ui_ProgressWidget.h" #include @@ -27,5 +26,3 @@ public slots: bool wascanceled; QTime starttime; }; - -#endif diff --git a/src/QGLView.h b/src/QGLView.h index a2a4d49b41..e9ef0576e3 100644 --- a/src/QGLView.h +++ b/src/QGLView.h @@ -1,5 +1,4 @@ -#ifndef QGLVIEW_H_ -#define QGLVIEW_H_ +#pragma once #include "system-gl.h" #include @@ -79,5 +78,3 @@ private slots: signals: void doAnimateUpdate(); }; - -#endif diff --git a/src/Reindexer.h b/src/Reindexer.h index 8ae000e966..0dbfecaf42 100644 --- a/src/Reindexer.h +++ b/src/Reindexer.h @@ -1,5 +1,4 @@ -#ifndef REINDEXER_H_ -#define REINDEXER_H_ +#pragma once #include #include @@ -62,5 +61,3 @@ class Reindexer boost::unordered_map map; std::vector vec; }; - -#endif diff --git a/src/SparkleAutoUpdater.h b/src/SparkleAutoUpdater.h index 786a190bf5..928f8bb416 100644 --- a/src/SparkleAutoUpdater.h +++ b/src/SparkleAutoUpdater.h @@ -2,8 +2,7 @@ * Copyright (C) 2008 Remko Troncon. BSD license * Copyright (C) 2013 Marius Kintel. BSD license */ -#ifndef SPARKLEAUTOUPDATER_H -#define SPARKLEAUTOUPDATER_H +#pragma once #include @@ -28,5 +27,3 @@ class SparkleAutoUpdater : public AutoUpdater class Private; Private *d; }; - -#endif diff --git a/src/ThrownTogetherRenderer.h b/src/ThrownTogetherRenderer.h index 09d13f333c..7933f5b650 100644 --- a/src/ThrownTogetherRenderer.h +++ b/src/ThrownTogetherRenderer.h @@ -1,5 +1,4 @@ -#ifndef THROWNTOGETHERRENDERER_H_ -#define THROWNTOGETHERRENDERER_H_ +#pragma once #include "renderer.h" @@ -17,5 +16,3 @@ class ThrownTogetherRenderer : public Renderer CSGChain *highlights_chain; CSGChain *background_chain; }; - -#endif diff --git a/src/Tree.h b/src/Tree.h index 938353b7c1..9f81c9bf22 100644 --- a/src/Tree.h +++ b/src/Tree.h @@ -1,5 +1,4 @@ -#ifndef TREE_H_ -#define TREE_H_ +#pragma once #include "nodecache.h" @@ -26,5 +25,3 @@ class Tree mutable NodeCache nodecache; mutable NodeCache nodeidcache; }; - -#endif diff --git a/src/boost-utils.h b/src/boost-utils.h index 3678ecca7c..459a5b8168 100644 --- a/src/boost-utils.h +++ b/src/boost-utils.h @@ -1,5 +1,4 @@ -#ifndef BOOST_UTILS_H_ -#define BOOST_UTILS_H_ +#pragma once #include namespace fs = boost::filesystem; @@ -9,5 +8,3 @@ namespace fs = boost::filesystem; fs::path boostfs_relative_path(const fs::path &path, const fs::path &relative_to); fs::path boostfs_normalize(const fs::path &path); fs::path boostfs_uncomplete(fs::path const p, fs::path const base); - -#endif diff --git a/src/boosty.h b/src/boosty.h index 82c765bdd0..feefa68b63 100644 --- a/src/boosty.h +++ b/src/boosty.h @@ -2,8 +2,7 @@ // Clifford Wolf 2012. Released under the GPL 2, or later, as described in // the file named 'COPYING' in OpenSCAD's project root. -#ifndef boosty_h_ -#define boosty_h_ +#pragma once /* boosty is a wrapper around boost so that OpenSCAD can work with old @@ -140,5 +139,3 @@ inline fs::path canonical( fs::path p ) } // namespace - -#endif diff --git a/src/builtin.h b/src/builtin.h index 9397aa9320..880146c0e9 100644 --- a/src/builtin.h +++ b/src/builtin.h @@ -1,5 +1,4 @@ -#ifndef BUILTIN_H_ -#define BUILTIN_H_ +#pragma once #include #include @@ -28,5 +27,3 @@ class Builtins boost::unordered_map deprecations; }; - -#endif diff --git a/src/cache.h b/src/cache.h index ea20393a0d..e0e3104a40 100644 --- a/src/cache.h +++ b/src/cache.h @@ -42,8 +42,7 @@ ** ****************************************************************************/ -#ifndef CACHE_H -#define CACHE_H +#pragma once #include #include @@ -183,6 +182,3 @@ void Cache::trim(int m) unlink(*u); } } - -#endif - diff --git a/src/calc.h b/src/calc.h index 1ac9e17647..8ae95499c2 100644 --- a/src/calc.h +++ b/src/calc.h @@ -1,8 +1,5 @@ -#ifndef CALC_H_ -#define CALC_H_ +#pragma once namespace Calc { int get_fragments_from_r(double r, double fn, double fs, double fa); } - -#endif diff --git a/src/cgal.h b/src/cgal.h index 69c8c270bc..a3d1897282 100644 --- a/src/cgal.h +++ b/src/cgal.h @@ -1,5 +1,4 @@ -#ifndef CGAL_H_ -#define CGAL_H_ +#pragma once #ifdef ENABLE_CGAL @@ -75,5 +74,3 @@ typedef CGAL::Iso_rectangle_2 > CGAL_Iso_rectangle_2 #endif #endif /* ENABLE_CGAL */ - -#endif diff --git a/src/cgaladvnode.h b/src/cgaladvnode.h index 71cf683899..6794ae9072 100644 --- a/src/cgaladvnode.h +++ b/src/cgaladvnode.h @@ -1,5 +1,4 @@ -#ifndef CGALADVNODE_H_ -#define CGALADVNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -21,7 +20,7 @@ class CgaladvNode : public AbstractNode convexity = 1; } virtual ~CgaladvNode() { } - virtual Response accept(class State &state, Visitor &visitor) const { + virtual Response accept(class State &state, Visitor &visitor) const { return visitor.visit(state, *this); } virtual std::string toString() const; @@ -34,5 +33,3 @@ class CgaladvNode : public AbstractNode Eigen::Matrix autosize; cgaladv_type_e type; }; - -#endif diff --git a/src/cgalfwd.h b/src/cgalfwd.h index 3fad608d4b..fcce418afc 100644 --- a/src/cgalfwd.h +++ b/src/cgalfwd.h @@ -1,5 +1,4 @@ -#ifndef CGALFWD_H_ -#define CGALFWD_H_ +#pragma once #ifndef CGAL_FORWARD #include "cgal.h" @@ -41,5 +40,3 @@ typedef CGAL::Polyhedron_3 #include "polyset.h" @@ -69,6 +68,3 @@ class ZRemover { void visit( CGAL_Nef_polyhedron3::SFace_const_handle ) {} void visit( CGAL_Nef_polyhedron3::Halffacet_const_handle hfacet ); }; - - -#endif diff --git a/src/cgalworker.h b/src/cgalworker.h index bf17e20144..62127e6350 100644 --- a/src/cgalworker.h +++ b/src/cgalworker.h @@ -1,5 +1,4 @@ -#ifndef CGALWORKER_H_ -#define CGALWORKER_H_ +#pragma once #include #include "memory.h" @@ -25,5 +24,3 @@ protected slots: class QThread *thread; const class Tree *tree; }; - -#endif diff --git a/src/colornode.h b/src/colornode.h index 9323638721..b1c73eff76 100644 --- a/src/colornode.h +++ b/src/colornode.h @@ -1,5 +1,4 @@ -#ifndef COLORNODE_H_ -#define COLORNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -17,5 +16,3 @@ class ColorNode : public AbstractNode Color4f color; }; - -#endif diff --git a/src/context.h b/src/context.h index ac80a09743..aa4286da7a 100644 --- a/src/context.h +++ b/src/context.h @@ -1,5 +1,4 @@ -#ifndef CONTEXT_H_ -#define CONTEXT_H_ +#pragma once #include #include @@ -48,5 +47,3 @@ class Context virtual std::string dump(const class AbstractModule *mod, const ModuleInstantiation *inst); #endif }; - -#endif diff --git a/src/csgnode.h b/src/csgnode.h index 06b007781c..5db309f9e2 100644 --- a/src/csgnode.h +++ b/src/csgnode.h @@ -1,5 +1,4 @@ -#ifndef CSGNODE_H_ -#define CSGNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -16,5 +15,3 @@ class CsgNode : public AbstractNode virtual std::string toString() const; virtual std::string name() const; }; - -#endif diff --git a/src/csgterm.h b/src/csgterm.h index 32ea60f686..49a6434b14 100644 --- a/src/csgterm.h +++ b/src/csgterm.h @@ -1,5 +1,4 @@ -#ifndef CSGTERM_H_ -#define CSGTERM_H_ +#pragma once #include #include @@ -85,5 +84,3 @@ class CSGChain BoundingBox getBoundingBox() const; }; - -#endif diff --git a/src/csgtermnormalizer.h b/src/csgtermnormalizer.h index bb55141e95..0a3fdafc25 100644 --- a/src/csgtermnormalizer.h +++ b/src/csgtermnormalizer.h @@ -1,5 +1,4 @@ -#ifndef CSGTERMNORMALIZER_H_ -#define CSGTERMNORMALIZER_H_ +#pragma once #include "memory.h" @@ -23,5 +22,3 @@ class CSGTermNormalizer size_t nodecount; shared_ptr rootnode; }; - -#endif diff --git a/src/dxfdata.h b/src/dxfdata.h index 1f60e2ca73..7e712875c1 100644 --- a/src/dxfdata.h +++ b/src/dxfdata.h @@ -1,5 +1,4 @@ -#ifndef DXFDATA_H_ -#define DXFDATA_H_ +#pragma once #include "linalg.h" #include @@ -43,5 +42,3 @@ class DxfData std::string dump() const; class Polygon2d *toPolygon2d() const; }; - -#endif diff --git a/src/dxfdim.h b/src/dxfdim.h index bd42109cf1..d84d07ce72 100644 --- a/src/dxfdim.h +++ b/src/dxfdim.h @@ -1,10 +1,7 @@ -#ifndef DXFDIM_H_ -#define DXFDIM_H_ +#pragma once #include #include "value.h" extern boost::unordered_map dxf_dim_cache; extern boost::unordered_map dxf_cross_cache; - -#endif diff --git a/src/enums.h b/src/enums.h index 23a4c14230..20285233f0 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,5 +1,4 @@ -#ifndef ENUMS_H_ -#define ENUMS_H_ +#pragma once enum OpenSCADOperator { OPENSCAD_UNION, @@ -9,5 +8,3 @@ enum OpenSCADOperator { OPENSCAD_HULL, OPENSCAD_RESIZE }; - -#endif diff --git a/src/evalcontext.h b/src/evalcontext.h index 1e8de46364..928e96f65b 100644 --- a/src/evalcontext.h +++ b/src/evalcontext.h @@ -1,5 +1,4 @@ -#ifndef EVALCONTEXT_H_ -#define EVALCONTEXT_H_ +#pragma once #include "context.h" @@ -33,5 +32,3 @@ class EvalContext : public Context std::vector > eval_values; const LocalScope *const scope; }; - -#endif diff --git a/src/export.h b/src/export.h index f0945fb932..704f370f05 100644 --- a/src/export.h +++ b/src/export.h @@ -1,5 +1,4 @@ -#ifndef EXPORT_H_ -#define EXPORT_H_ +#pragma once #include #include "Tree.h" @@ -35,5 +34,3 @@ void export_png_with_throwntogether(Tree &tree, Camera &c, std::ostream &output) #ifdef DEBUG void export_stl(const class PolySet &ps, std::ostream &output); #endif - -#endif diff --git a/src/expression.h b/src/expression.h index 36297042e7..bf601d3e42 100644 --- a/src/expression.h +++ b/src/expression.h @@ -1,5 +1,4 @@ -#ifndef EXPRESSION_H_ -#define EXPRESSION_H_ +#pragma once #include #include @@ -45,5 +44,3 @@ class Expression }; std::ostream &operator<<(std::ostream &stream, const Expression &expr); - -#endif diff --git a/src/fbo.h b/src/fbo.h index 943862f156..d7b0319449 100644 --- a/src/fbo.h +++ b/src/fbo.h @@ -1,5 +1,4 @@ -#ifndef FBO_H_ -#define FBO_H_ +#pragma once #include "system-gl.h" #include // size_t @@ -21,5 +20,3 @@ GLuint fbo_bind(fbo_t *fbo); void fbo_unbind(fbo_t *fbo); bool REPORTGLERROR(const char * task); - -#endif diff --git a/src/feature.h b/src/feature.h index 20b4f16d49..1e888031ac 100644 --- a/src/feature.h +++ b/src/feature.h @@ -1,5 +1,4 @@ -#ifndef FEATURE_H_ -#define FEATURE_H_ +#pragma once #include #include @@ -40,5 +39,3 @@ class Feature Feature(const std::string &name, const std::string &description); virtual ~Feature(); }; - -#endif diff --git a/src/fileutils.h b/src/fileutils.h index 1f68cdb2cc..87911e6e68 100644 --- a/src/fileutils.h +++ b/src/fileutils.h @@ -1,9 +1,6 @@ -#ifndef FILEUTILS_H_ -#define FILEUTILS_H_ +#pragma once #include std::string lookup_file(const std::string &filename, const std::string &path, const std::string &fallbackpath); - -#endif diff --git a/src/function.h b/src/function.h index 8a78478f28..d8e3ad7748 100644 --- a/src/function.h +++ b/src/function.h @@ -1,5 +1,4 @@ -#ifndef FUNCTION_H_ -#define FUNCTION_H_ +#pragma once #include "value.h" #include "typedefs.h" @@ -50,5 +49,3 @@ class Function : public AbstractFunction virtual Value evaluate(const Context *ctx, const EvalContext *evalctx) const; virtual std::string dump(const std::string &indent, const std::string &name) const; }; - -#endif diff --git a/src/grid.h b/src/grid.h index ccaed476a0..23690b3fd7 100644 --- a/src/grid.h +++ b/src/grid.h @@ -1,5 +1,4 @@ -#ifndef GRID_H_ -#define GRID_H_ +#pragma once #include "mathc99.h" #ifdef WIN32 @@ -154,5 +153,3 @@ class Grid3d return align(x, y, z); } }; - -#endif diff --git a/src/handle_dep.h b/src/handle_dep.h index 1074a64ff0..0244d7c2f9 100644 --- a/src/handle_dep.h +++ b/src/handle_dep.h @@ -1,10 +1,7 @@ -#ifndef HANDLE_DEP_H_ -#define HANDLE_DEP_H_ +#pragma once #include extern const char *make_command; void handle_dep(const std::string &filename); bool write_deps(const std::string &filename, const std::string &output_file); - -#endif diff --git a/src/highlighter.h b/src/highlighter.h index 2c946c1776..692aa6a287 100644 --- a/src/highlighter.h +++ b/src/highlighter.h @@ -1,5 +1,4 @@ -#ifndef HIGHLIGHTER_H_ -#define HIGHLIGHTER_H_ +#pragma once #include #include @@ -28,5 +27,3 @@ class Highlighter : public QSyntaxHighlighter QMap typeformats; int lastDocumentPos(); }; - -#endif diff --git a/src/imageutils.h b/src/imageutils.h index c9bb8de0d7..3b659ee6ae 100644 --- a/src/imageutils.h +++ b/src/imageutils.h @@ -1,5 +1,4 @@ -#ifndef IMAGEUTILS_H_ -#define IMAGEUTILS_H_ +#pragma once #include #include @@ -7,5 +6,3 @@ bool write_png(const char *filename, unsigned char *pixels, int width, int height); bool write_png(std::ostream &output, unsigned char *pixels, int width, int height); void flip_image(const unsigned char *src, unsigned char *dst, size_t pixelsize, size_t width, size_t height); - -#endif diff --git a/src/importnode.h b/src/importnode.h index bde614e12b..86c2fd7b7d 100644 --- a/src/importnode.h +++ b/src/importnode.h @@ -1,5 +1,4 @@ -#ifndef IMPORTNODE_H_ -#define IMPORTNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -31,5 +30,3 @@ class ImportNode : public LeafNode virtual Geometry *evaluate_geometry(class PolySetEvaluator *) const { return createGeometry(); } virtual Geometry *createGeometry() const; }; - -#endif diff --git a/src/linalg.h b/src/linalg.h index 97d2100775..8cf193924f 100644 --- a/src/linalg.h +++ b/src/linalg.h @@ -1,5 +1,4 @@ -#ifndef LINALG_H_ -#define LINALG_H_ +#pragma once #include #include @@ -39,5 +38,3 @@ class Color4f : public Eigen::Vector4f bool isValid() const { return this->minCoeff() >= 0.0f; } }; - -#endif diff --git a/src/linearextrudenode.h b/src/linearextrudenode.h index ca5e32d133..27ab0a17b5 100644 --- a/src/linearextrudenode.h +++ b/src/linearextrudenode.h @@ -1,5 +1,4 @@ -#ifndef LINEAREXTRUDENODE_H_ -#define LINEAREXTRUDENODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -28,5 +27,3 @@ class LinearExtrudeNode : public AbstractPolyNode Filename filename; std::string layername; }; - -#endif diff --git a/src/localscope.h b/src/localscope.h index d81a27c7ed..83e4f10517 100644 --- a/src/localscope.h +++ b/src/localscope.h @@ -1,5 +1,4 @@ -#ifndef LOCALSCOPE_H_ -#define LOCALSCOPE_H_ +#pragma once #include "typedefs.h" #include @@ -16,11 +15,9 @@ class LocalScope void addChild(ModuleInstantiation *ch); AssignmentList assignments; - ModuleInstantiationList children; + ModuleInstantiationList children; typedef boost::unordered_map FunctionContainer; FunctionContainer functions; typedef boost::unordered_map AbstractModuleContainer; AbstractModuleContainer modules; }; - -#endif diff --git a/src/lodepng.h b/src/lodepng.h index 6057acc1e2..695fc17848 100644 --- a/src/lodepng.h +++ b/src/lodepng.h @@ -23,8 +23,7 @@ freely, subject to the following restrictions: distribution. */ -#ifndef LODEPNG_H -#define LODEPNG_H +#pragma once #include /*for size_t*/ @@ -878,8 +877,6 @@ unsigned compress(std::vector& out, const std::vector #endif - -#endif diff --git a/src/memory.h b/src/memory.h index 38d5d0baa7..1f54e4b310 100644 --- a/src/memory.h +++ b/src/memory.h @@ -1,9 +1,6 @@ -#ifndef MEMORY_H_ -#define MEMORY_H_ +#pragma once #include using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::static_pointer_cast; - -#endif diff --git a/src/modcontext.h b/src/modcontext.h index 8abf3d7e6f..f15aa6ccd0 100644 --- a/src/modcontext.h +++ b/src/modcontext.h @@ -1,5 +1,4 @@ -#ifndef FILECONTEXT_H_ -#define FILECONTEXT_H_ +#pragma once #include "context.h" #include "module.h" @@ -53,5 +52,3 @@ class FileContext : public ModuleContext private: const FileModule::ModuleContainer &usedlibs; }; - -#endif diff --git a/src/module.h b/src/module.h index 31661188ca..2c01820467 100644 --- a/src/module.h +++ b/src/module.h @@ -1,5 +1,4 @@ -#ifndef MODULE_H_ -#define MODULE_H_ +#pragma once #include #include @@ -127,5 +126,3 @@ class FileModule : public Module bool is_handling_dependencies; std::string path; }; - -#endif diff --git a/src/node.h b/src/node.h index f058c4093e..f4535e10a6 100644 --- a/src/node.h +++ b/src/node.h @@ -1,5 +1,4 @@ -#ifndef NODE_H_ -#define NODE_H_ +#pragma once #include #include @@ -94,5 +93,3 @@ class LeafNode : public AbstractPolyNode std::ostream &operator<<(std::ostream &stream, const AbstractNode &node); AbstractNode *find_root_tag(AbstractNode *n); - -#endif diff --git a/src/nodecache.h b/src/nodecache.h index 4acee2e1e6..7292a222a1 100644 --- a/src/nodecache.h +++ b/src/nodecache.h @@ -1,5 +1,4 @@ -#ifndef NODECACHE_H_ -#define NODECACHE_H_ +#pragma once #include #include @@ -48,5 +47,3 @@ class NodeCache std::vector cache; std::string nullvalue; }; - -#endif diff --git a/src/nodedumper.h b/src/nodedumper.h index aca17edb38..0063a2a59c 100644 --- a/src/nodedumper.h +++ b/src/nodedumper.h @@ -1,5 +1,4 @@ -#ifndef NODEDUMPER_H_ -#define NODEDUMPER_H_ +#pragma once #include #include @@ -32,5 +31,3 @@ class NodeDumper : public Visitor typedef std::list ChildList; std::map visitedchildren; }; - -#endif diff --git a/src/openscad.h b/src/openscad.h index 0d146c1830..0e9796590e 100644 --- a/src/openscad.h +++ b/src/openscad.h @@ -24,8 +24,7 @@ * */ -#ifndef OPENSCAD_H -#define OPENSCAD_H +#pragma once extern class FileModule *parse(const char *text, const char *path, int debug); @@ -35,6 +34,3 @@ extern std::string commandline_commands; // The CWD when application started. We shouldn't change CWD, but until we stop // doing this, use currentdir to get the original CWD. extern std::string currentdir; - -#endif - diff --git a/src/parsersettings.h b/src/parsersettings.h index 52172b6ff9..ab9d62bb42 100644 --- a/src/parsersettings.h +++ b/src/parsersettings.h @@ -1,5 +1,4 @@ -#ifndef PARSERSETTINGS_H_ -#define PARSERSETTINGS_H_ +#pragma once #include #include "boosty.h" @@ -10,7 +9,5 @@ void parser_init(const std::string &applicationpath); void add_librarydir(const std::string &libdir); fs::path search_libs(const fs::path &localpath); fs::path find_valid_path(const fs::path &sourcepath, - const fs::path &localpath, - const std::vector *openfilenames = NULL); - -#endif + const fs::path &localpath, + const std::vector *openfilenames = NULL); diff --git a/src/polyset.h b/src/polyset.h index f50199508a..c481d5aab6 100644 --- a/src/polyset.h +++ b/src/polyset.h @@ -1,5 +1,4 @@ -#ifndef POLYSET_H_ -#define POLYSET_H_ +#pragma once #include "Geometry.h" #include "system-gl.h" @@ -43,5 +42,3 @@ class PolySet : public Geometry Polygon2d polygon; unsigned int dim; }; - -#endif diff --git a/src/printutils.h b/src/printutils.h index 48f286be19..18eb79f15a 100644 --- a/src/printutils.h +++ b/src/printutils.h @@ -1,5 +1,4 @@ -#ifndef PRINTUTILS_H_ -#define PRINTUTILS_H_ +#pragma once #include #include @@ -72,5 +71,3 @@ class logstream return *this; } }; - -#endif diff --git a/src/progress.h b/src/progress.h index 33c340cfe8..db11fd1092 100644 --- a/src/progress.h +++ b/src/progress.h @@ -1,5 +1,4 @@ -#ifndef PROGRESS_H_ -#define PROGRESS_H_ +#pragma once // Reset to 0 in _prep() and increased for each Node instance in progress_prepare() extern int progress_report_count; @@ -12,5 +11,3 @@ void progress_report_fin(); void progress_update(const AbstractNode *node, int mark); class ProgressCancelException { }; - -#endif diff --git a/src/projectionnode.h b/src/projectionnode.h index cbed02098f..9ad1acd73c 100644 --- a/src/projectionnode.h +++ b/src/projectionnode.h @@ -1,5 +1,4 @@ -#ifndef PROJECTIONNODE_H_ -#define PROJECTIONNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -20,5 +19,3 @@ class ProjectionNode : public AbstractPolyNode int convexity; bool cut_mode; }; - -#endif diff --git a/src/renderer.h b/src/renderer.h index 7c7ab1239e..35b1845df3 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -1,5 +1,4 @@ -#ifndef RENDERER_H_ -#define RENDERER_H_ +#pragma once #include "system-gl.h" #include "linalg.h" @@ -46,6 +45,3 @@ class Renderer static void render_surface(shared_ptr geom, csgmode_e csgmode, const Transform3d &m, GLint *shaderinfo = NULL); static void render_edges(shared_ptr geom, csgmode_e csgmode); }; - -#endif // RENDERER_H - diff --git a/src/rendernode.h b/src/rendernode.h index 9138c2911c..3ef595776e 100644 --- a/src/rendernode.h +++ b/src/rendernode.h @@ -1,5 +1,4 @@ -#ifndef RENDERNODE_H_ -#define RENDERNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -17,5 +16,3 @@ class RenderNode : public AbstractNode int convexity; }; - -#endif diff --git a/src/rendersettings.h b/src/rendersettings.h index e4fa6c88dd..e0be817465 100644 --- a/src/rendersettings.h +++ b/src/rendersettings.h @@ -1,5 +1,4 @@ -#ifndef RENDERSETTINGS_H_ -#define RENDERSETTINGS_H_ +#pragma once #include #include "linalg.h" @@ -33,5 +32,3 @@ class RenderSettings std::map colors; }; - -#endif diff --git a/src/rotateextrudenode.h b/src/rotateextrudenode.h index f20786155d..0288ae31c5 100644 --- a/src/rotateextrudenode.h +++ b/src/rotateextrudenode.h @@ -1,5 +1,4 @@ -#ifndef ROTATEEXTRUDENODE_H_ -#define ROTATEEXTRUDENODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -25,5 +24,3 @@ class RotateExtrudeNode : public AbstractPolyNode Filename filename; std::string layername; }; - -#endif diff --git a/src/state.h b/src/state.h index df202aac1d..7739ed3722 100644 --- a/src/state.h +++ b/src/state.h @@ -1,5 +1,4 @@ -#ifndef STATE_H_ -#define STATE_H_ +#pragma once #include #include "linalg.h" @@ -38,5 +37,3 @@ class State Transform3d matrix_; Color4f color_; }; - -#endif diff --git a/src/stl-utils.h b/src/stl-utils.h index a48b7d5dcb..9d04d713c3 100644 --- a/src/stl-utils.h +++ b/src/stl-utils.h @@ -1,5 +1,4 @@ -#ifndef STLUTILS_H_ -#define STLUTILS_H_ +#pragma once template struct del_fun_t @@ -15,5 +14,3 @@ del_fun_t del_fun() { return del_fun_t(); } - -#endif diff --git a/src/svg.h b/src/svg.h index 828dc39107..2b95b9978f 100644 --- a/src/svg.h +++ b/src/svg.h @@ -1,5 +1,4 @@ -#ifndef SVG_H_ -#define SVG_H_ +#pragma once #include "cgal.h" #include @@ -23,6 +22,3 @@ std::string dump_svg( const CGAL_Nef_polyhedron2 &N ); std::string dump_svg( const CGAL_Nef_polyhedron3 &N ); } // namespace - -#endif - diff --git a/src/system-gl.h b/src/system-gl.h index 50eeb21be3..1cabafe55e 100644 --- a/src/system-gl.h +++ b/src/system-gl.h @@ -1,8 +1,6 @@ -#ifndef SYSTEMGL_H_ -#define SYSTEMGL_H_ +#pragma once #ifndef NULLGL - #include #ifdef __APPLE__ @@ -26,5 +24,3 @@ inline void glColor4fv( float *c ) {} std::string glew_dump(); std::string glew_extensions_dump(); bool report_glerror(const char * function); - -#endif // SYSTEMGL_H_ diff --git a/src/transformnode.h b/src/transformnode.h index 29c6d43f98..8fe5db5d07 100644 --- a/src/transformnode.h +++ b/src/transformnode.h @@ -1,5 +1,4 @@ -#ifndef TRANSFORMNODE_H_ -#define TRANSFORMNODE_H_ +#pragma once #include "node.h" #include "visitor.h" @@ -17,5 +16,3 @@ class TransformNode : public AbstractNode Transform3d matrix; }; - -#endif diff --git a/src/traverser.h b/src/traverser.h index 73078e7279..2235075a33 100644 --- a/src/traverser.h +++ b/src/traverser.h @@ -1,5 +1,4 @@ -#ifndef TRAVERSER_H_ -#define TRAVERSER_H_ +#pragma once enum Response {ContinueTraversal, AbortTraversal, PruneTraversal}; @@ -22,5 +21,3 @@ class Traverser const AbstractNode &root; TraversalType traversaltype; }; - -#endif diff --git a/src/typedefs.h b/src/typedefs.h index 9b11da1fb1..a7516ca6df 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,5 +1,4 @@ -#ifndef TYPEDEFS_H_ -#define TYPEDEFS_H_ +#pragma once #include #include @@ -14,5 +13,3 @@ class Assignment : public std::pair AssignmentList; typedef std::vector ModuleInstantiationList; - -#endif diff --git a/src/value.h b/src/value.h index e05ef9018b..d3204d31a1 100644 --- a/src/value.h +++ b/src/value.h @@ -1,5 +1,4 @@ -#ifndef VALUE_H_ -#define VALUE_H_ +#pragma once #include #include @@ -159,5 +158,3 @@ class Value Variant value; }; - -#endif diff --git a/src/visitor.h b/src/visitor.h index c847a0497c..ce649015cf 100644 --- a/src/visitor.h +++ b/src/visitor.h @@ -1,5 +1,4 @@ -#ifndef VISITOR_H_ -#define VISITOR_H_ +#pragma once #include "traverser.h" @@ -57,5 +56,3 @@ class Visitor } // Add visit() methods for new visitable subtypes of AbstractNode here }; - -#endif