Skip to content

Commit

Permalink
Switch from #define guards to #pragma once
Browse files Browse the repository at this point in the history
As well as a few whitespace cleanups
  • Loading branch information
bgamari committed Apr 28, 2014
1 parent 065789e commit ff466c2
Show file tree
Hide file tree
Showing 91 changed files with 96 additions and 380 deletions.
5 changes: 1 addition & 4 deletions src/AboutDialog.h
@@ -1,5 +1,4 @@
#ifndef ABOUTDIALOG_H_
#define ABOUTDIALOG_H_
#pragma once

#include "ui_AboutDialog.h"

Expand All @@ -21,5 +20,3 @@ class AboutDialog : public QDialog, public Ui::AboutDialog
this->aboutText->setHtml(tmp);
}
};

#endif
5 changes: 1 addition & 4 deletions src/AppleEvents.h
@@ -1,6 +1,3 @@
#ifndef APPLEEVENTS_H_
#define APPLEEVENTS_H_
#pragma once

void installAppleEventHandlers();

#endif
5 changes: 1 addition & 4 deletions src/AutoUpdater.h
@@ -1,5 +1,4 @@
#ifndef AUTOUPDATER_H_
#define AUTOUPDATER_H_
#pragma once

#include <QString>

Expand All @@ -21,5 +20,3 @@ class AutoUpdater
protected:
static AutoUpdater *updater_instance;
};

#endif
5 changes: 1 addition & 4 deletions src/CGALCache.h
@@ -1,5 +1,4 @@
#ifndef CGALCACHE_H_
#define CGALCACHE_H_
#pragma once

#include "cache.h"
#include "memory.h"
Expand Down Expand Up @@ -33,5 +32,3 @@ class CGALCache

Cache<std::string, cache_entry> cache;
};

#endif
5 changes: 1 addition & 4 deletions src/CGALRenderer.h
@@ -1,5 +1,4 @@
#ifndef CGALRENDERER_H_
#define CGALRENDERER_H_
#pragma once

#include "renderer.h"

Expand All @@ -14,5 +13,3 @@ class CGALRenderer : public Renderer
class Polyhedron *polyhedron;
shared_ptr<const class PolySet> polyset;
};

#endif
9 changes: 1 addition & 8 deletions src/CGAL_Nef3_workaround.h
Expand Up @@ -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 <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h>
Expand Down Expand Up @@ -345,9 +344,3 @@ bool convert_to_Polyhedron( const CGAL::Nef_polyhedron_3<Kernel> &N, CGAL::Polyh


} //namespace nefworkaround




#endif

5 changes: 1 addition & 4 deletions 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"
Expand Down Expand Up @@ -31,5 +30,3 @@ class CGAL_Nef_polyhedron : public Geometry
void transform( const Transform3d &matrix );
shared_ptr<CGAL_Nef_polyhedron3> p3;
};

#endif
9 changes: 1 addition & 8 deletions src/CGAL_renderer.h
Expand Up @@ -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
Expand Down Expand Up @@ -119,8 +117,3 @@ class Polyhedron
};

#endif // NULLGL




#endif // CGAL_RENDERER_H
5 changes: 1 addition & 4 deletions src/CSGTermEvaluator.h
@@ -1,5 +1,4 @@
#ifndef CSGTERMEVALUATOR_H_
#define CSGTERMEVALUATOR_H_
#pragma once

#include <map>
#include <list>
Expand Down Expand Up @@ -46,5 +45,3 @@ class CSGTermEvaluator : public Visitor
const Tree &tree;
class GeometryEvaluator *geomevaluator;
};

#endif
6 changes: 1 addition & 5 deletions src/Camera.h
@@ -1,5 +1,4 @@
#ifndef OPENSCAD_CAMERA_H_
#define OPENSCAD_CAMERA_H_
#pragma once

/*
Expand Down Expand Up @@ -86,6 +85,3 @@ class Camera
unsigned int pixel_width;
unsigned int pixel_height;
};


#endif
5 changes: 1 addition & 4 deletions src/CocoaUtils.h
@@ -1,5 +1,4 @@
#ifndef COCOAUTILS_H_
#define COCOAUTILS_H_
#pragma once

#include <string>

Expand All @@ -9,5 +8,3 @@ class CocoaUtils
static void endApplication();
static void nslog(const std::string &str, void *userdata);
};

#endif
6 changes: 1 addition & 5 deletions src/CsgInfo.h
@@ -1,5 +1,4 @@
#ifndef __CSGINFO_H__
#define __CSGINFO_H__
#pragma once

#include "OffscreenView.h"
#include "csgterm.h"
Expand Down Expand Up @@ -87,6 +86,3 @@ class CsgInfo
return true;
}
};

#endif

5 changes: 1 addition & 4 deletions src/EventFilter.h
@@ -1,5 +1,4 @@
#ifndef FILTER_H_
#define FILTER_H_
#pragma once

#include <QObject>
#include <QFileOpenEvent>
Expand All @@ -24,5 +23,3 @@ class EventFilter : public QObject
}
}
};

#endif
5 changes: 1 addition & 4 deletions src/GLView.h
@@ -1,5 +1,4 @@
#ifndef GLVIEW_H_
#define GLVIEW_H_
#pragma once

/* GLView: A basic OpenGL rectangle for rendering images.
Expand Down Expand Up @@ -79,5 +78,3 @@ class GLView
int opencsg_id;
#endif
};

#endif
6 changes: 1 addition & 5 deletions src/GeometryEvaluator.h
@@ -1,5 +1,4 @@
#ifndef GEOMETRYEVALUATOR_H_
#define GEOMETRYEVALUATOR_H_
#pragma once

#include "visitor.h"
#include "enums.h"
Expand Down Expand Up @@ -73,6 +72,3 @@ class GeometryEvaluator : public Visitor

public:
};


#endif
5 changes: 1 addition & 4 deletions src/MainWindow.h
@@ -1,5 +1,4 @@
#ifndef MAINWINDOW_H_
#define MAINWINDOW_H_
#pragma once

#include <QMainWindow>
#include "ui_MainWindow.h"
Expand Down Expand Up @@ -237,5 +236,3 @@ class GuiLocker
private:
static unsigned int gui_locked;
};

#endif
2 changes: 2 additions & 0 deletions src/ModuleCache.h
@@ -1,3 +1,5 @@
#pragma once

#include <string>
#include <boost/unordered_map.hpp>

Expand Down
4 changes: 1 addition & 3 deletions src/OGL_helper.h
Expand Up @@ -17,8 +17,7 @@
//
// Author(s) : Peter Hachenberger <hachenberger@mpi-sb.mpg.de>

#ifndef CGAL_NEF_OPENGL_HELPER_H
#define CGAL_NEF_OPENGL_HELPER_H
#pragma once

#include <CGAL/Nef_S2/OGL_base_object.h>
#include <CGAL/Simple_cartesian.h>
Expand Down Expand Up @@ -702,4 +701,3 @@ namespace OGL {
} // namespace OGL

} //namespace CGAL
#endif // CGAL_NEF_OPENGL_HELPER_H
5 changes: 1 addition & 4 deletions 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
Expand All @@ -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
5 changes: 1 addition & 4 deletions src/OffscreenView.h
@@ -1,5 +1,4 @@
#ifndef OFFSCREENVIEW_H_
#define OFFSCREENVIEW_H_
#pragma once

#include "OffscreenContext.h"
#include <Eigen/Core>
Expand Down Expand Up @@ -27,5 +26,3 @@ class OffscreenView : public GLView
void display_opencsg_warning();
#endif
};

#endif
5 changes: 1 addition & 4 deletions src/OpenCSGRenderer.h
@@ -1,5 +1,4 @@
#ifndef OPENCSGRENDERER_H_
#define OPENCSGRENDERER_H_
#pragma once

#include "renderer.h"
#include "system-gl.h"
Expand All @@ -19,5 +18,3 @@ class OpenCSGRenderer : public Renderer
CSGChain *background_chain;
GLint *shaderinfo;
};

#endif
5 changes: 1 addition & 4 deletions src/OpenCSGWarningDialog.h
@@ -1,5 +1,4 @@
#ifndef OPENCSGWARNINGDIALOG_H_
#define OPENCSGWARNINGDIALOG_H_
#pragma once

#include "ui_OpenCSGWarningDialog.h"

Expand All @@ -12,5 +11,3 @@ class OpenCSGWarningDialog : public QDialog, public Ui::OpenCSGWarningDialog
public slots:
void setText(const QString &text);
};

#endif
5 changes: 1 addition & 4 deletions src/PlatformUtils.h
@@ -1,5 +1,4 @@
#ifndef PLATFORMUTILS_H_
#define PLATFORMUTILS_H_
#pragma once

#include <string>

Expand All @@ -21,5 +20,3 @@ namespace PlatformUtils {
*/
std::string pathSeparatorChar();
}

#endif
5 changes: 1 addition & 4 deletions src/Polygon2d-CGAL.h
@@ -1,5 +1,4 @@
#ifndef POLYGON2D_CGAL_H_
#define POLYGON2D_CGAL_H_
#pragma once

#include "Polygon2d.h"
#include "cgal.h"
Expand All @@ -8,5 +7,3 @@
namespace Polygon2DCGAL {
CGAL_Nef_polyhedron toNefPolyhedron();
};

#endif
5 changes: 1 addition & 4 deletions src/Preferences.h
@@ -1,5 +1,4 @@
#ifndef PREFERENCES_H_
#define PREFERENCES_H_
#pragma once

#include <QMainWindow>
#include <QSettings>
Expand Down Expand Up @@ -58,5 +57,3 @@ public slots:
static Preferences *instance;
static const char *featurePropertyName;
};

#endif
5 changes: 1 addition & 4 deletions src/ProgressWidget.h
@@ -1,5 +1,4 @@
#ifndef PROGRESSWIDGET_H_
#define PROGRESSWIDGET_H_
#pragma once

#include "ui_ProgressWidget.h"
#include <QTime>
Expand Down Expand Up @@ -27,5 +26,3 @@ public slots:
bool wascanceled;
QTime starttime;
};

#endif
5 changes: 1 addition & 4 deletions src/QGLView.h
@@ -1,5 +1,4 @@
#ifndef QGLVIEW_H_
#define QGLVIEW_H_
#pragma once

#include "system-gl.h"
#include <QGLWidget>
Expand Down Expand Up @@ -79,5 +78,3 @@ private slots:
signals:
void doAnimateUpdate();
};

#endif
5 changes: 1 addition & 4 deletions src/Reindexer.h
@@ -1,5 +1,4 @@
#ifndef REINDEXER_H_
#define REINDEXER_H_
#pragma once

#include <boost/unordered_map.hpp>
#include <boost/functional.hpp>
Expand Down Expand Up @@ -62,5 +61,3 @@ class Reindexer
boost::unordered_map<T, int> map;
std::vector<T> vec;
};

#endif
5 changes: 1 addition & 4 deletions src/SparkleAutoUpdater.h
Expand Up @@ -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 <QString>

Expand All @@ -28,5 +27,3 @@ class SparkleAutoUpdater : public AutoUpdater
class Private;
Private *d;
};

#endif

0 comments on commit ff466c2

Please sign in to comment.