瀏覽代碼

Adding pragma once everywhere

Panagiotis Christopoulos Charitos 10 年之前
父節點
當前提交
da31c96900
共有 69 個文件被更改,包括 191 次插入337 次删除
  1. 1 3
      include/anki/AnKi.h
  2. 1 3
      include/anki/Collision.h
  3. 1 3
      include/anki/Event.h
  4. 1 3
      include/anki/Math.h
  5. 1 4
      include/anki/Resource.h
  6. 1 3
      include/anki/Util.h
  7. 1 5
      include/anki/collision/Common.h
  8. 1 4
      include/anki/collision/CompoundShape.h
  9. 1 4
      include/anki/collision/ContactPoint.h
  10. 1 4
      include/anki/collision/ConvexShape.h
  11. 1 3
      include/anki/collision/Forward.h
  12. 2 4
      include/anki/collision/Functions.h
  13. 1 4
      include/anki/collision/GjkEpa.h
  14. 4 7
      include/anki/collision/GjkEpaInternal.h
  15. 3 5
      include/anki/collision/LineSegment.h
  16. 3 5
      include/anki/collision/Sphere.h
  17. 1 4
      include/anki/collision/Tests.h
  18. 1 3
      include/anki/core/App.h
  19. 1 3
      include/anki/core/NativeWindow.h
  20. 1 4
      include/anki/core/NativeWindowAndroid.h
  21. 1 4
      include/anki/core/NativeWindowEglFbdev.h
  22. 1 4
      include/anki/core/NativeWindowSdl.h
  23. 1 3
      include/anki/core/StdinListener.h
  24. 1 3
      include/anki/core/Threadpool.h
  25. 1 3
      include/anki/core/Timestamp.h
  26. 1 3
      include/anki/event/Event.h
  27. 1 3
      include/anki/event/FollowPathEvent.h
  28. 1 3
      include/anki/event/JitterMoveEvent.h
  29. 1 3
      include/anki/event/MainRendererPpsHdrEvent.h
  30. 15 17
      include/anki/math/Axisang.h
  31. 4 7
      include/anki/math/Euler.h
  32. 2 4
      include/anki/math/F16.h
  33. 3 5
      include/anki/math/Forward.h
  34. 1 4
      include/anki/math/Functions.h
  35. 9 13
      include/anki/math/Mat.h
  36. 4 6
      include/anki/math/Mat3.h
  37. 20 22
      include/anki/math/Mat3x4.h
  38. 5 7
      include/anki/math/Mat4.h
  39. 11 14
      include/anki/math/Quat.h
  40. 1 3
      include/anki/math/Simd.h
  41. 1 1
      include/anki/math/Transform.h
  42. 7 10
      include/anki/math/Vec.h
  43. 5 8
      include/anki/math/Vec2.h
  44. 1 3
      include/anki/misc/Xml.h
  45. 1 4
      include/anki/physics/Forward.h
  46. 3 6
      include/anki/physics/PhysicsCollisionShape.h
  47. 1 3
      include/anki/resource/Path.h
  48. 2 4
      include/anki/scene/Grid.h
  49. 1 3
      include/anki/scene/Misc.h
  50. 2 4
      include/anki/scene/Octree.h
  51. 1 3
      include/anki/scene/Path.h
  52. 3 6
      include/anki/scene/SceneGraph.h
  53. 0 7
      include/anki/util/Allocator.h
  54. 3 5
      include/anki/util/Dictionary.h
  55. 2 11
      include/anki/util/File.h
  56. 1 3
      include/anki/util/Functions.h
  57. 1 0
      include/anki/util/List.h
  58. 1 3
      include/anki/util/NonCopyable.h
  59. 1 0
      include/anki/util/String.h
  60. 8 10
      include/anki/util/Visitor.h
  61. 14 14
      src/collision/CompoundShape.cpp
  62. 1 0
      src/gr/gl/RenderingThread.cpp
  63. 13 13
      src/util/File.cpp
  64. 1 0
      src/util/FilesystemPosix.cpp
  65. 1 0
      src/util/Logger.cpp
  66. 1 0
      src/util/String.cpp
  67. 1 3
      tests/framework/Framework.h
  68. 1 3
      tests/util/Foo.h
  69. 1 1
      thirdparty

+ 1 - 3
include/anki/AnKi.h

@@ -3,12 +3,10 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_ANKI_H
-#define ANKI_ANKI_H
+#pragma once
 
 #include <anki/Util.h>
 #include <anki/Math.h>
 #include <anki/Scene.h>
 #include <anki/Event.h>
 
-#endif

+ 1 - 3
include/anki/Collision.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_H
-#define ANKI_COLLISION_H
+#pragma once
 
 /// @defgroup collision Collision detection module
 
@@ -21,4 +20,3 @@
 #include <anki/collision/Functions.h>
 #include <anki/collision/Tests.h>
 
-#endif

+ 1 - 3
include/anki/Event.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_EVENT_H
-#define ANKI_EVENT_H
+#pragma once
 
 #include <anki/event/EventManager.h>
 
@@ -13,4 +12,3 @@
 #include <anki/event/JitterMoveEvent.h>
 #include <anki/event/AnimationEvent.h>
 
-#endif

+ 1 - 3
include/anki/Math.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_H
-#define ANKI_MATH_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/CommonSrc.h>
@@ -12,4 +11,3 @@
 
 /// @defgroup math Math library
 
-#endif

+ 1 - 4
include/anki/Resource.h

@@ -7,8 +7,7 @@
 /// This file contains the public resource headers and all the resource classes
 /// that the rest of AnKi should use
 
-#ifndef ANKI_RESOURCE_H
-#define ANKI_RESOURCE_H
+#pragma once
 
 /// @defgroup resource Collection of resources and management
 
@@ -18,5 +17,3 @@
 
 #include <anki/resource/ResourceManager.h>
 
-#endif
-

+ 1 - 3
include/anki/Util.h

@@ -38,8 +38,7 @@
 /// @defgroup util_private Private interfaces
 /// @ingroup util
 
-#ifndef ANKI_UTIL_H
-#define ANKI_UTIL_H
+#pragma once
 
 #include <anki/util/Allocator.h>
 #include <anki/util/Array.h>
@@ -68,4 +67,3 @@
 #include <anki/util/Thread.h>
 #include <anki/util/Visitor.h>
 
-#endif

+ 1 - 5
include/anki/collision/Common.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_COMMON_H
-#define ANKI_COLLISION_COMMON_H
+#pragma once
 
 #include <anki/collision/Forward.h>
 #include <anki/util/Allocator.h>
@@ -20,10 +19,7 @@ using CollisionTempAllocator = StackAllocator<T>;
 
 template<typename T>
 using CollisionAllocator = ChainAllocator<T>;
-
 /// @}
 
 } // end namespace anki
 
-#endif
-

+ 1 - 4
include/anki/collision/CompoundShape.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_COMPOUND_SHAPE_H
-#define ANKI_COLLISION_COMPOUND_SHAPE_H
+#pragma once
 
 #include <anki/collision/CollisionShape.h>
 #include <anki/util/NonCopyable.h>
@@ -94,5 +93,3 @@ Error CompoundShape::iterateShapes(TFunc f) const
 
 } // end namespace anki
 
-#endif
-

+ 1 - 4
include/anki/collision/ContactPoint.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_CONTACT_POINT_H
-#define ANKI_COLLISION_CONTACT_POINT_H
+#pragma once
 
 #include <anki/Math.h>
 
@@ -26,5 +25,3 @@ public:
 
 } // end namespace anki
 
-#endif
-

+ 1 - 4
include/anki/collision/ConvexShape.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_CONVEX_SHAPE_H
-#define ANKI_COLLISION_CONVEX_SHAPE_H
+#pragma once
 
 #include <anki/collision/CollisionShape.h>
 
@@ -48,5 +47,3 @@ public:
 
 } // end namespace anki
 
-#endif
-

+ 1 - 3
include/anki/collision/Forward.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_FORWARD_H
-#define ANKI_COLLISION_FORWARD_H
+#pragma once
 
 namespace anki {
 
@@ -23,4 +22,3 @@ class ContactPoint;
 
 } // end namespace anki
 
-#endif

+ 2 - 4
include/anki/collision/Functions.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_FUNCTIONS_H
-#define ANKI_COLLISION_FUNCTIONS_H
+#pragma once
 
 #include <anki/collision/Plane.h>
 #include <anki/collision/Frustum.h>
@@ -20,11 +19,10 @@ namespace anki {
 /// @param[out] planes Pointers to the planes. Elements can be nullptr
 ///
 /// @note plane_count * 8 muls, plane_count sqrt
-extern void extractClipPlanes(const Mat4& mvp, 
+extern void extractClipPlanes(const Mat4& mvp,
 	Plane* planes[(U)Frustum::PlaneType::COUNT]);
 
 /// @}
 
 } // end namespace anki
 
-#endif

+ 1 - 4
include/anki/collision/GjkEpa.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_GJK_EPA_H
-#define ANKI_COLLISION_GJK_EPA_H
+#pragma once
 
 #include <anki/Math.h>
 
@@ -62,5 +61,3 @@ private:
 
 } // end namespace anki
 
-#endif
-

+ 4 - 7
include/anki/collision/GjkEpaInternal.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_GJK_EPA_INTERNAL_H
-#define ANKI_COLLISION_GJK_EPA_INTERNAL_H
+#pragma once
 
 #include <anki/Math.h>
 #include <anki/collision/Common.h>
@@ -87,7 +86,7 @@ public:
 		m_idx[1] = j;
 		m_idx[2] = k;
 	}
-	
+
 	const Array<U32, 3>& idx() const
 	{
 		return m_idx;
@@ -138,8 +137,8 @@ class Polytope
 	friend class Face;
 
 public:
-	Polytope(CollisionTempAllocator<U8>& alloc, 
-		U32 maxSimplexSize, 
+	Polytope(CollisionTempAllocator<U8>& alloc,
+		U32 maxSimplexSize,
 		U32 maxFaceCount)
 	:	m_maxSimplexSize(maxSimplexSize),
 		m_maxFaceCount(maxFaceCount),
@@ -184,10 +183,8 @@ public: // XXX
 
 	Bool expand(Face& cface, U supportIdx);
 };
-
 /// @}
 
 } // end namesapce detail
 } // end namesapce anki
 
-#endif

+ 3 - 5
include/anki/collision/LineSegment.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_LINE_SEGMENT_H
-#define ANKI_COLLISION_LINE_SEGMENT_H
+#pragma once
 
 #include <anki/collision/CollisionShape.h>
 #include <anki/math/Vec3.h>
@@ -33,8 +32,8 @@ public:
 	{}
 
 	LineSegment(const Vec4& origin, const Vec4& direction)
-	:	Base(Type::LINE_SEG), 
-		m_origin(origin), 
+	:	Base(Type::LINE_SEG),
+		m_origin(origin),
 		m_dir(direction)
 	{}
 
@@ -115,4 +114,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 3 - 5
include/anki/collision/Sphere.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_SPHERE_H
-#define ANKI_COLLISION_SPHERE_H
+#pragma once
 
 #include <anki/collision/ConvexShape.h>
 #include <anki/Math.h>
@@ -39,8 +38,8 @@ public:
 
 	/// Constructor
 	Sphere(const Vec4& center, F32 radius)
-	:	Base(Type::SPHERE), 
-		m_center(center), 
+	:	Base(Type::SPHERE),
+		m_center(center),
 		m_radius(radius)
 	{}
 
@@ -126,4 +125,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 4
include/anki/collision/Tests.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_COLLISION_TESTS_H
-#define ANKI_COLLISION_TESTS_H
+#pragma once
 
 #include <anki/collision/Common.h>
 
@@ -19,5 +18,3 @@ Bool testCollisionShapes(const CollisionShape& a, const CollisionShape& b);
 
 } // end namespace anki
 
-#endif
-

+ 1 - 3
include/anki/core/App.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_APP_H
-#define ANKI_CORE_APP_H
+#pragma once
 
 #include <anki/util/Allocator.h>
 #include <anki/util/String.h>
@@ -173,4 +172,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/core/NativeWindow.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_NATIVE_WINDOW_H
-#define ANKI_CORE_NATIVE_WINDOW_H
+#pragma once
 
 #include <anki/util/StdTypes.h>
 #include <anki/util/Array.h>
@@ -103,4 +102,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 4
include/anki/core/NativeWindowAndroid.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_NATIVE_WINDOW_ANDROID_H
-#define ANKI_CORE_NATIVE_WINDOW_ANDROID_H
+#pragma once
 
 #include <anki/core/NativeWindow.h>
 #include <EGL/egl.h>
@@ -31,5 +30,3 @@ struct NativeWindowImpl
 
 } // end namespace anki
 
-#endif
-

+ 1 - 4
include/anki/core/NativeWindowEglFbdev.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_NATIVE_WINDOW_EGL_FBDEV_H
-#define ANKI_CORE_NATIVE_WINDOW_EGL_FBDEV_H
+#pragma once
 
 #include <anki/core/NativeWindow.h>
 #define EGL_FBDEV 1
@@ -32,5 +31,3 @@ struct NativeWindowImpl
 
 } // end namespace anki
 
-#endif
-

+ 1 - 4
include/anki/core/NativeWindowSdl.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_NATIVE_WINDOW_SDL_H
-#define ANKI_CORE_NATIVE_WINDOW_SDL_H
+#pragma once
 
 #include <anki/core/NativeWindow.h>
 #include <SDL.h>
@@ -23,5 +22,3 @@ public:
 
 } // end namespace anki
 
-#endif
-

+ 1 - 3
include/anki/core/StdinListener.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_STDIN_LISTENER_H
-#define ANKI_CORE_STDIN_LISTENER_H
+#pragma once
 
 #include <anki/util/String.h>
 #include <anki/util/Thread.h>
@@ -46,4 +45,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/core/Threadpool.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_THREADPOOL_H
-#define ANKI_CORE_THREADPOOL_H
+#pragma once
 
 #include <anki/util/Thread.h>
 #include <anki/util/Singleton.h>
@@ -16,4 +15,3 @@ typedef Singleton<ThreadPool> ThreadPoolSingleton;
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/core/Timestamp.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_CORE_TIMESTAMP_H
-#define ANKI_CORE_TIMESTAMP_H
+#pragma once
 
 #include <anki/util/StdTypes.h>
 
@@ -17,4 +16,3 @@ const U MAX_TIMESTAMP = MAX_U32;
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/event/Event.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_EVENT_EVENT_H
-#define ANKI_EVENT_EVENT_H
+#pragma once
 
 #include <anki/scene/Common.h>
 #include <anki/Math.h>
@@ -138,4 +137,3 @@ protected:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/event/FollowPathEvent.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_EVENT_FOLLOW_PATH_EVENT_H
-#define ANKI_EVENT_FOLLOW_PATH_EVENT_H
+#pragma once
 
 #include <anki/event/Event.h>
 #include <anki/scene/SceneNode.h>
@@ -38,4 +37,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/event/JitterMoveEvent.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_JITTER_EVENT_MOVE_EVENT_H
-#define ANKI_JITTER_EVENT_MOVE_EVENT_H
+#pragma once
 
 #include <anki/event/Event.h>
 #include <anki/Math.h>
@@ -39,4 +38,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/event/MainRendererPpsHdrEvent.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_EVENT_MAIN_RENDERER_PPS_HDR_EVENT_H
-#define ANKI_EVENT_MAIN_RENDERER_PPS_HDR_EVENT_H
+#pragma once
 
 #include <anki/event/Event.h>
 #include <cstdint>
@@ -46,4 +45,3 @@ private:
 
 } // end namespace
 
-#endif

+ 15 - 17
include/anki/math/Axisang.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_AXISANG_H
-#define ANKI_MATH_AXISANG_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 
@@ -20,18 +19,18 @@ class TAxisang
 public:
 	/// @name Constructors
 	/// @{
-	explicit TAxisang()
-	:	m_ang(0.0), 
+	TAxisang()
+	:	m_ang(0.0),
 		m_axis(0.0)
 	{}
-	
+
 	TAxisang(const TAxisang& b)
-	:	m_ang(b.m_ang), 
+	:	m_ang(b.m_ang),
 		m_axis(b.m_axis)
 	{}
 
-	explicit TAxisang(const T rad, const TVec3<T>& axis)
-	:	m_ang(rad), 
+	TAxisang(const T rad, const TVec3<T>& axis)
+	:	m_ang(rad),
 		m_axis(axis)
 	{}
 
@@ -53,13 +52,13 @@ public:
 	explicit TAxisang(const TMat3<T>& m3)
 	{
 		if(isZero<T>(m3(0, 1) - m3(1, 0))
-			&& isZero<T>(m3(0, 2) - m3(2, 0)) 
+			&& isZero<T>(m3(0, 2) - m3(2, 0))
 			&& isZero<T>(m3(1, 2) - m3(2, 1)))
 		{
 
-			if((fabs<T>(m3(0, 1) + m3(1, 0)) < 0.1) 
-				&& (fabs<T>(m3(0, 2) + m3(2, 0)) < 0.1) 
-				&& (fabs<T>(m3(1, 2) + m3(2, 1)) < 0.1) 
+			if((fabs<T>(m3(0, 1) + m3(1, 0)) < 0.1)
+				&& (fabs<T>(m3(0, 2) + m3(2, 0)) < 0.1)
+				&& (fabs<T>(m3(1, 2) + m3(2, 1)) < 0.1)
 				&& (fabs<T>(m3(0, 0) + m3(1, 1) + m3(2, 2)) - 3) < 0.1)
 			{
 				m_axis = TVec3<T>(1.0, 0.0, 0.0);
@@ -128,8 +127,8 @@ public:
 			return;
 		}
 
-		T s = sqrt((m3(2, 1) - m3(1, 2)) * (m3(2, 1) - m3(1, 2)) 
-			+ (m3(0, 2) - m3(2, 0)) * (m3(0, 2) - m3(2, 0)) 
+		T s = sqrt((m3(2, 1) - m3(1, 2)) * (m3(2, 1) - m3(1, 2))
+			+ (m3(0, 2) - m3(2, 0)) * (m3(0, 2) - m3(2, 0))
 			+ (m3(1, 0) - m3(0, 1)) * (m3(1, 0) - m3(0, 1)));
 
 		if(fabs(s) < 0.001)
@@ -140,7 +139,7 @@ public:
 		m_ang = acos<T>((m3(0, 0) + m3(1, 1) + m3(2, 2) - 1.0) / 2.0);
 		m_axis.x() = (m3(2, 1) - m3(1, 2)) / s;
 		m_axis.y() = (m3(0, 2) - m3(2, 0)) / s;
-		m_axis.z() = (m3(1, 0) - m3(0, 1)) / s;		
+		m_axis.z() = (m3(1, 0) - m3(0, 1)) / s;
 	}
 	/// @}
 
@@ -193,7 +192,7 @@ public:
 	String toString(TAlloc alloc) const
 	{
 		String s;
-		Error err = s.sprintf("axis: %f %f %f, angle: %f", 
+		Error err = s.sprintf("axis: %f %f %f, angle: %f",
 			m_axis[0], m_axis[1], m_axis[2], m_ang);
 		(void)err;
 		return s;
@@ -214,4 +213,3 @@ typedef TAxisang<F32> Axisang;
 
 } // end namespace anki
 
-#endif

+ 4 - 7
include/anki/math/Euler.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_EULER_H
-#define ANKI_MATH_EULER_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 
@@ -21,12 +20,12 @@ class TEuler
 public:
 	/// @name Constructors
 	/// @{
-	explicit TEuler()
+	TEuler()
 	{
 		x() = y() = z() = 0.0;
 	}
 
-	explicit TEuler(const T x_, const T y_, const T z_)
+	TEuler(const T x_, const T y_, const T z_)
 	{
 		x() = x_;
 		y() = y_;
@@ -183,10 +182,8 @@ private:
 };
 
 /// F32 Euler angles
-typedef TEuler<F32> Euler; 
-
+typedef TEuler<F32> Euler;
 /// @}
 
 } // end namespace anki
 
-#endif

+ 2 - 4
include/anki/math/F16.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_F16_H
-#define ANKI_MATH_F16_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 
@@ -27,7 +26,7 @@ class F16
 public:
 	/// @name Constructors
 	/// @{
-	explicit F16()
+	F16()
 	{}
 
 	F16(const F16& b)
@@ -220,4 +219,3 @@ static_assert(sizeof(F16) == 2, "Incorrect size");
 
 } // end namespace anki
 
-#endif

+ 3 - 5
include/anki/math/Forward.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_FORWARD_H
-#define ANKI_MATH_FORWARD_H
+#pragma once
 
 #include <anki/util/StdTypes.h>
 
@@ -12,13 +11,13 @@ namespace anki {
 
 class F16;
 
-template<typename T, U N, typename TSimd, typename TV> 
+template<typename T, U N, typename TSimd, typename TV>
 class TVec;
 template<typename T> class TVec2;
 template<typename T> class TVec3;
 template<typename T> class TVec4;
 
-template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ, 
+template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ,
 	typename TVI>
 class TMat;
 template<typename T> class TMat3;
@@ -32,4 +31,3 @@ template<typename T> class TEuler;
 
 } // end namespace anki
 
-#endif

+ 1 - 4
include/anki/math/Functions.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_FUNCTIONS_H
-#define ANKI_MATH_FUNCTIONS_H
+#pragma once
 
 #include <anki/util/StdTypes.h>
 #include <cmath>
@@ -233,9 +232,7 @@ static Type cubicInterpolate(
 
 	return(a0 * u * u2 + a1 * u2 + a2 * u + a3);
 }
-
 /// @}
 
 } // end namespace anki
 
-#endif

+ 9 - 13
include/anki/math/Mat.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_MAT_H
-#define ANKI_MATH_MAT_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec.h>
@@ -21,7 +20,7 @@ namespace anki {
 /// @tparam TM The type of the derived class. Eg TMat3.
 /// @tparam TVJ The vector type of the row.
 /// @tparam TVI The vector type of the column.
-template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ, 
+template<typename T, U J, U I, typename TSimd, typename TM, typename TVJ,
 	typename TVI>
 class TMat
 {
@@ -33,14 +32,14 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TMat() 
+	TMat()
 	{}
 
 	TMat(const TMat& b)
 	{
 		for(U i = 0; i < N; i++)
 		{
-			m_arr1[i] = b.m_arr1[i]; 
+			m_arr1[i] = b.m_arr1[i];
 		}
 	}
 
@@ -56,7 +55,7 @@ public:
 	{
 		for(U i = 0; i < N; i++)
 		{
-			m_arr1[i] = arr[i]; 
+			m_arr1[i] = arr[i];
 		}
 	}
 	/// @}
@@ -469,9 +468,9 @@ public:
 	void rotateXAxis(const T rad)
 	{
 		TMat& m = *this;
-		// If we analize the mat3 we can extract the 3 unit vectors rotated by 
-		// the mat3. The 3 rotated vectors are in mat's columns. This means 
-		// that: mat3.colomn[0] == i * mat3. rotateXAxis() rotates rad angle 
+		// If we analize the mat3 we can extract the 3 unit vectors rotated by
+		// the mat3. The 3 rotated vectors are in mat's columns. This means
+		// that: mat3.colomn[0] == i * mat3. rotateXAxis() rotates rad angle
 		// not from i vector (aka x axis) but from the vector from colomn 0
 		// NOTE: See the clean code from < r664
 
@@ -677,7 +676,7 @@ public:
 
 	void reorthogonalize()
 	{
-		// There are 2 methods, the standard and the Gram-Schmidt method with a 
+		// There are 2 methods, the standard and the Gram-Schmidt method with a
 		// twist for zAxis. This uses the 2nd. For the first see < r664
 		TVI xAxis, yAxis, zAxis;
 		getColumns(xAxis, yAxis, zAxis);
@@ -773,10 +772,7 @@ protected:
 	};
 	/// @}
 };
-
 /// @}
 
 } // end namespace anki
 
-#endif
-

+ 4 - 6
include/anki/math/Mat3.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_MAT3_H
-#define ANKI_MATH_MAT3_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Mat.h>
@@ -39,7 +38,7 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TMat3() 
+	TMat3()
 	:	Base()
 	{}
 
@@ -47,7 +46,7 @@ public:
 	:	Base(b)
 	{}
 
-	explicit TMat3(
+	TMat3(
 		T m00, T m01, T m02, T m10, T m11, T m12, T m20, T m21, T m22)
 	{
 		TMat3& m = *this;
@@ -127,7 +126,7 @@ public:
 		r(2, 1) = invDet * (m(0, 1) * m(2, 0) - m(0, 0) * m(2, 1));
 		r(2, 2) = invDet * (m(0, 0) * m(1, 1) - m(0, 1) * m(1, 0));
 
-		return r;		
+		return r;
 	}
 
 	void invert()
@@ -200,4 +199,3 @@ static_assert(sizeof(Mat3) == sizeof(F32) * 3 * 3, "Incorrect size");
 
 } // end namespace anki
 
-#endif

+ 20 - 22
include/anki/math/Mat3x4.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_MAT3X4_H
-#define ANKI_MATH_MAT3X4_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Mat.h>
@@ -35,18 +34,18 @@ public:
 /// 3x4 Matrix. Mainly used for transformations. It includes many helpful member
 /// functions. Its row major. The columns are the x,y,z axis
 template<typename T>
-class alignas(16) TMat3x4: public TMat<T, 3, 4, typename TMat3x4Simd<T>::Type, 
+class alignas(16) TMat3x4: public TMat<T, 3, 4, typename TMat3x4Simd<T>::Type,
 	  TMat3x4<T>, TVec4<T>, TVec3<T>>
 {
 public:
-	using Base = TMat<T, 3, 4, typename TMat3x4Simd<T>::Type, 
+	using Base = TMat<T, 3, 4, typename TMat3x4Simd<T>::Type,
 	  TMat3x4<T>, TVec4<T>, TVec3<T>>;
 
 	using Base::Base;
 
 	/// @name Constructors
 	/// @{
-	explicit TMat3x4()
+	TMat3x4()
 	:	Base()
 	{}
 
@@ -54,7 +53,7 @@ public:
 	:	Base(b)
 	{}
 
-	explicit TMat3x4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13, 
+	TMat3x4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13,
 		T m20, T m21, T m22, T m23)
 	{
 		TMat3x4& m = *this;
@@ -145,13 +144,13 @@ public:
 		Base::setTranslationPart(TVec3<T>(static_cast<T>(0)));
 	}
 
-	explicit TMat3x4(const TVec3<T>& transl, const TMat3<T>& rot)
+	TMat3x4(const TVec3<T>& transl, const TMat3<T>& rot)
 	{
 		Base::setRotationPart(rot);
 		Base::setTranslationPart(transl);
 	}
 
-	explicit TMat3x4(const TVec3<T>& transl, const TMat3<T>& rot, const T scale)
+	TMat3x4(const TVec3<T>& transl, const TMat3<T>& rot, const T scale)
 	{
 		if(isZero<T>(scale - static_cast<T>(1)))
 		{
@@ -180,32 +179,32 @@ public:
 		const TMat3x4& a = *static_cast<const TMat3x4*>(this);
 		TMat3x4 c;
 
-		c(0, 0) = 
+		c(0, 0) =
 			a(0, 0) * b(0, 0) + a(0, 1) * b(1, 0) + a(0, 2) * b(2, 0);
-		c(0, 1) = 
+		c(0, 1) =
 			a(0, 0) * b(0, 1) + a(0, 1) * b(1, 1) + a(0, 2) * b(2, 1);
-		c(0, 2) = 
+		c(0, 2) =
 			a(0, 0) * b(0, 2) + a(0, 1) * b(1, 2) + a(0, 2) * b(2, 2);
-		c(1, 0) = 
+		c(1, 0) =
 			a(1, 0) * b(0, 0) + a(1, 1) * b(1, 0) + a(1, 2) * b(2, 0);
-		c(1, 1) = 
+		c(1, 1) =
 			a(1, 0) * b(0, 1) + a(1, 1) * b(1, 1) + a(1, 2) * b(2, 1);
-		c(1, 2) = 
+		c(1, 2) =
 			a(1, 0) * b(0, 2) + a(1, 1) * b(1, 2) + a(1, 2) * b(2, 2);
 		c(2, 0) =
 			a(2, 0) * b(0, 0) + a(2, 1) * b(1, 0) + a(2, 2) * b(2, 0);
-		c(2, 1) = 
+		c(2, 1) =
 			a(2, 0) * b(0, 1) + a(2, 1) * b(1, 1) + a(2, 2) * b(2, 1);
 		c(2, 2) =
 			a(2, 0) * b(0, 2) + a(2, 1) * b(1, 2) + a(2, 2) * b(2, 2);
 
-		c(0, 3) = a(0, 0) * b(0, 3) + a(0, 1) * b(1, 3) 
+		c(0, 3) = a(0, 0) * b(0, 3) + a(0, 1) * b(1, 3)
 			+ a(0, 2) * b(2, 3) + a(0, 3);
 
-		c(1, 3) = a(1, 0) * b(0, 3) + a(1, 1) * b(1, 3) 
+		c(1, 3) = a(1, 0) * b(0, 3) + a(1, 1) * b(1, 3)
 			+ a(1, 2) * b(2, 3) + a(1, 3);
 
-		c(2, 3) = a(2, 0) * b(0, 3) + a(2, 1) * b(1, 3) 
+		c(2, 3) = a(2, 0) * b(0, 3) + a(2, 1) * b(1, 3)
 			+ a(2, 2) * b(2, 3) + a(2, 3);
 
 		return c;
@@ -219,12 +218,12 @@ public:
 	static const TMat3x4& getIdentity()
 	{
 		static const TMat3x4 ident(
-			1.0, 0.0, 0.0, 0.0, 
-			0.0, 1.0, 0.0, 0.0, 
+			1.0, 0.0, 0.0, 0.0,
+			0.0, 1.0, 0.0, 0.0,
 			0.0, 0.0, 1.0, 0.0);
 		return ident;
 	}
-	/// @}	
+	/// @}
 };
 
 #if ANKI_SIMD == ANKI_SIMD_SSE
@@ -258,4 +257,3 @@ static_assert(sizeof(Mat3x4) == sizeof(F32) * 3 * 4, "Incorrect size");
 
 #include <anki/math/Mat3x4.inl.h>
 
-#endif

+ 5 - 7
include/anki/math/Mat4.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_MAT4_H
-#define ANKI_MATH_MAT4_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 
@@ -61,7 +60,7 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TMat4()
+	TMat4()
 		: Base()
 	{}
 
@@ -69,7 +68,7 @@ public:
 		: Base(b)
 	{}
 
-	explicit TMat4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13,
+	TMat4(T m00, T m01, T m02, T m03, T m10, T m11, T m12, T m13,
 		T m20, T m21, T m22, T m23, T m30, T m31, T m32, T m33)
 	{
 		TMat4& m = *this;
@@ -158,7 +157,7 @@ public:
 		m(3, 3) = v.w();
 	}
 
-	explicit TMat4(const TVec4<T>& transl, const TMat3<T>& rot)
+	TMat4(const TVec4<T>& transl, const TMat3<T>& rot)
 	{
 		setRotationPart(rot);
 		setTranslationPart(transl);
@@ -166,7 +165,7 @@ public:
 		m(3, 0) = m(3, 1) = m(3, 2) = 0.0;
 	}
 
-	explicit TMat4(const TVec4<T>& transl, const TMat3<T>& rot, const T scale)
+	TMat4(const TVec4<T>& transl, const TMat3<T>& rot, const T scale)
 	{
 		if(isZero<T>(scale - 1.0))
 		{
@@ -446,4 +445,3 @@ static_assert(sizeof(Mat4) == sizeof(F32) * 4 * 4, "Incorrect size");
 
 #include <anki/math/Mat4.inl.h>
 
-#endif

+ 11 - 14
include/anki/math/Quat.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_QUAT_H
-#define ANKI_MATH_QUAT_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec4.h>
@@ -16,12 +15,12 @@ namespace anki {
 
 /// Quaternion. Used in rotations
 template<typename T>
-class alignas(16) TQuat: 
+class alignas(16) TQuat:
 	public TVec<T, 4, typename TVec4Simd<T>::Type, TQuat<T>>
 {
 public:
 	using Base = TVec<T, 4, typename TVec4Simd<T>::Type, TQuat<T>>;
-	
+
 	using Base::x;
 	using Base::y;
 	using Base::z;
@@ -31,7 +30,7 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TQuat()
+	TQuat()
 	:	Base()
 	{}
 
@@ -39,7 +38,7 @@ public:
 	:	Base(b)
 	{}
 
-	explicit TQuat(const T x_, const T y_, const T z_, const T w_)
+	TQuat(const T x_, const T y_, const T z_, const T w_)
 	:	Base(x_, y_, z_, w_)
 	{}
 
@@ -55,11 +54,11 @@ public:
 	:	Base(simd)
 	{}
 
-	explicit TQuat(const TVec2<T>& v, const T z_, const T w_)
+	TQuat(const TVec2<T>& v, const T z_, const T w_)
 	:	Base(v, z_, w_)
 	{}
 
-	explicit TQuat(const TVec3<T>& v, const T w_)
+	TQuat(const TVec3<T>& v, const T w_)
 	:	Base(v, w_)
 	{}
 
@@ -110,7 +109,7 @@ public:
 	explicit TQuat(const TMat3x4<T>& m)
 	:	TQuat(m.getRotationPart())
 	{
-		ANKI_ASSERT(isZero<T>(m(0, 3)) && isZero<T>(m(1, 3)) 
+		ANKI_ASSERT(isZero<T>(m(0, 3)) && isZero<T>(m(1, 3))
 			&& isZero<T>(m(2, 3)));
 	}
 
@@ -195,7 +194,7 @@ public:
 	{
 		(*this) = getInverted();
 	}
-	
+
 	void conjugate()
 	{
 		x() = -x();
@@ -244,7 +243,7 @@ public:
 	}
 
 	/// @note 16 muls, 12 adds
-	TQuat combineRotations(const TQuat& b) const 
+	TQuat combineRotations(const TQuat& b) const
 	{
 		// XXX See if this can be optimized
 		TQuat out;
@@ -261,7 +260,7 @@ public:
 	{
 		ANKI_ASSERT(isZero<T>(1.0 - Base::getLength())); // Not normalized quat
 		TVec3<T> qXyz(Base::xyz());
-		return 
+		return
 			v + qXyz.cross(qXyz.cross(v) + v * Base::w()) * 2.0;
 	}
 
@@ -279,9 +278,7 @@ public:
 
 /// F32 quaternion
 typedef TQuat<F32> Quat;
-
 /// @}
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/math/Simd.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_MATH_SIMD_H
-#define ANKI_MATH_MATH_SIMD_H
+#pragma once
 
 #include <anki/Config.h>
 
@@ -18,4 +17,3 @@
 #	error "See file"
 #endif
 
-#endif

+ 1 - 1
include/anki/math/Transform.h

@@ -19,7 +19,7 @@ class TTransform
 public:
 	/// @name Constructors
 	/// @{
-	explicit TTransform()
+	TTransform()
 	{}
 
 	TTransform(const TTransform& b)

+ 7 - 10
include/anki/math/Vec.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_VEC_H
-#define ANKI_MATH_VEC_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <type_traits>
@@ -26,7 +25,7 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TVec()
+	TVec()
 	{}
 
 	TVec(const TVec& b)
@@ -37,14 +36,14 @@ public:
 		}
 	}
 
-	explicit TVec(const T x_, const T y_)
+	TVec(const T x_, const T y_)
 	{
 		static_assert(N == 2, "Wrong vector");
 		x() = x_;
 		y() = y_;
 	}
 
-	explicit TVec(const T x_, const T y_, const T z_)
+	TVec(const T x_, const T y_, const T z_)
 	{
 		static_assert(N == 3, "Wrong vector");
 		x() = x_;
@@ -52,7 +51,7 @@ public:
 		z() = z_;
 	}
 
-	explicit TVec(const T x_, const T y_, const T z_, const T w_)
+	TVec(const T x_, const T y_, const T z_, const T w_)
 	{
 		static_assert(N == 4, "Wrong vector");
 		x() = x_;
@@ -1887,7 +1886,7 @@ public:
 	{
 		for(U i = 0; i < N; i++)
 		{
-			m_arr[i] = b.m_arr[i]; 
+			m_arr[i] = b.m_arr[i];
 		}
 		return *this;
 	}
@@ -1896,7 +1895,7 @@ public:
 	{
 		for(U i = 0; i < N; i++)
 		{
-			m_arr[i] = b.m_arr[i]; 
+			m_arr[i] = b.m_arr[i];
 		}
 		return static_cast<TV&>(*this);
 	}
@@ -2183,9 +2182,7 @@ protected:
 	};
 	/// @}
 };
-
 /// @}
 
 } // end namespace anki
 
-#endif

+ 5 - 8
include/anki/math/Vec2.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_MATH_VEC2_H
-#define ANKI_MATH_VEC2_H
+#pragma once
 
 #include <anki/math/CommonIncludes.h>
 #include <anki/math/Vec.h>
@@ -35,7 +34,7 @@ public:
 
 	/// @name Constructors
 	/// @{
-	explicit TVec2()
+	TVec2()
 		: Base()
 	{}
 
@@ -43,7 +42,7 @@ public:
 		: Base(b)
 	{}
 
-	explicit TVec2(const T x_, const T y_)
+	TVec2(const T x_, const T y_)
 		: Base(x_, y_)
 	{}
 
@@ -92,14 +91,12 @@ static_assert(sizeof(Vec2) == sizeof(F32) * 2, "Incorrect size");
 /// Half float 2D vector
 typedef TVec2<F16> HVec2;
 
-/// 32bit signed integer 2D vector 
+/// 32bit signed integer 2D vector
 typedef TVec2<I32> IVec2;
 
-/// 32bit unsigned integer 2D vector 
+/// 32bit unsigned integer 2D vector
 typedef TVec2<U32> UVec2;
-
 /// @}
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/misc/Xml.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_XML_H
-#define ANKI_XML_H
+#pragma once
 
 #include <anki/util/String.h>
 #include <anki/util/DArray.h>
@@ -120,4 +119,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 4
include/anki/physics/Forward.h

@@ -3,10 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_PHYSICS_FORWARD_H
-#define ANKI_PHYSICS_FORWARD_H
+#pragma once
 
 #include <anki/physics/Common.h>
 
-#endif
-

+ 3 - 6
include/anki/physics/PhysicsCollisionShape.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_PHYSICS_PHYSICS_COLLISION_SHAPE_H
-#define ANKI_PHYSICS_PHYSICS_COLLISION_SHAPE_H
+#pragma once
 
 #include <anki/physics/PhysicsObject.h>
 
@@ -97,7 +96,7 @@ public:
 	~PhysicsConvexHull()
 	{}
 
-	ANKI_USE_RESULT Error create(Initializer& init, 
+	ANKI_USE_RESULT Error create(Initializer& init,
 		const Vec3* positions, U32 positionsCount, U32 positionsStride);
 };
 
@@ -113,12 +112,10 @@ public:
 	{}
 
 	ANKI_USE_RESULT Error create(Initializer& init,
-		const Vec3* positions, U32 positionsStride, 
+		const Vec3* positions, U32 positionsStride,
 		const U16* indices, U32 indicesCount);
 };
 /// @}
 
 } // end namespace anki
 
-#endif
-

+ 1 - 3
include/anki/resource/Path.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_RESOURCE_PATH_H
-#define ANKI_RESOURCE_PATH_H
+#pragma once
 
 #include <anki/Math.h>
 
@@ -26,4 +25,3 @@ class Path
 
 } // end namespace anki
 
-#endif

+ 2 - 4
include/anki/scene/Grid.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SCENE_GRID_H
-#define ANKI_SCENE_GRID_H
+#pragma once
 
 #include <anki/Collision.h>
 #include <anki/scene/Common.h>
@@ -42,7 +41,7 @@ public:
 	Bool placeSceneNode(SceneNode* sn);
 
 	/// XXX
-	void getVisible(const Frustumable& cam, 
+	void getVisible(const Frustumable& cam,
 		SceneVector<SceneNode*>& nodes);
 
 private:
@@ -56,4 +55,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/scene/Misc.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SCENE_MISC_H
-#define ANKI_SCENE_MISC_H
+#pragma once
 
 #include <anki/scene/SpatialComponent.h>
 
@@ -28,4 +27,3 @@ public:
 
 } // end namespace anki
 
-#endif

+ 2 - 4
include/anki/scene/Octree.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SCENE_OCTREE_H
-#define ANKI_SCENE_OCTREE_H
+#pragma once
 
 #include <anki/collision/Aabb.h>
 #include <anki/util/Array.h>
@@ -140,7 +139,7 @@ public:
 		return maxDepth;
 	}
 
-	Sector& getSector() 
+	Sector& getSector()
 	{
 		return *sector;
 	}
@@ -192,4 +191,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 1 - 3
include/anki/scene/Path.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_SCENE_PATH_H
-#define ANKI_SCENE_PATH_H
+#pragma once
 
 #include <anki/scene/Common.h>
 #include <anki/scene/SceneNode.h>
@@ -77,4 +76,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 3 - 6
include/anki/scene/SceneGraph.h

@@ -279,14 +279,11 @@ Error SceneGraph::iterateSceneNodes(PtrSize begin, PtrSize end, Func func)
 	auto it = m_nodes.getBegin() + begin;
 
 	PtrSize count = end - begin;
-	while(count-- != 0)
+	Error err = ErrorCode::NONE;
+	while(count-- != 0 && !err)
 	{
 		ANKI_ASSERT(it != m_nodes.getEnd());
-		Error err = func(*it);
-		if(err)
-		{
-			return err;
-		}
+		err = func(*it);
 
 		++it;
 	}

+ 0 - 7
include/anki/util/Allocator.h

@@ -12,13 +12,6 @@
 #include <cstddef> // For ptrdiff_t
 #include <utility> // For forward
 
-#define ANKI_DEBUG_ALLOCATORS ANKI_DEBUG
-#define ANKI_PRINT_ALLOCATOR_MESSAGES 1
-
-#if ANKI_PRINT_ALLOCATOR_MESSAGES
-#	include <iostream> // Never include it on release
-#endif
-
 namespace anki {
 
 /// @addtogroup util_memory

+ 3 - 5
include/anki/util/Dictionary.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_UTIL_DICTIONARY_H
-#define ANKI_UTIL_DICTIONARY_H
+#pragma once
 
 #include <anki/util/Allocator.h>
 #include <anki/util/String.h>
@@ -45,9 +44,9 @@ public:
 /// char MUST NOT point to a temporary or the evaluation function will fail.
 /// Its template struct because C++ does not offer template typedefs
 template<
-	typename T, 
+	typename T,
 	typename TAlloc = HeapAllocator<std::pair<CString, T>>>
-using Dictionary = 
+using Dictionary =
 	std::unordered_map<
 		CString,
 		T,
@@ -59,4 +58,3 @@ using Dictionary =
 
 } // end namespace anki
 
-#endif

+ 2 - 11
include/anki/util/File.h

@@ -12,15 +12,6 @@
 
 namespace anki {
 
-// Undefine some flags because someone else is polluting the global namespace
-#if defined(LITTLE_ENDIAN)
-#	undef LITTLE_ENDIAN
-#endif
-
-#if defined(BIG_ENDIAN)
-#	undef BIG_ENDIAN
-#endif
-
 /// @addtogroup util_file
 /// @{
 
@@ -44,8 +35,8 @@ public:
 		WRITE = 1 << 1,
 		APPEND = WRITE | (1 << 3),
 		BINARY = 1 << 4,
-		LITTLE_ENDIAN = 1 << 5, ///< The default
-		BIG_ENDIAN = 1 << 6
+		ENDIAN_LITTLE = 1 << 5, ///< The default
+		ENDIAN_BIG = 1 << 6
 	};
 
 	ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(OpenFlag, friend);

+ 1 - 3
include/anki/util/Functions.h

@@ -6,8 +6,7 @@
 /// @file
 /// Contains misc functions
 
-#ifndef ANKI_UTIL_FUNCTIONS_H
-#define ANKI_UTIL_FUNCTIONS_H
+#pragma once
 
 #include <anki/util/StdTypes.h>
 #include <anki/util/Assert.h>
@@ -213,4 +212,3 @@ struct TypesAreTheSame<T, T>
 
 } // end namespace anki
 
-#endif

+ 1 - 0
include/anki/util/List.h

@@ -7,6 +7,7 @@
 
 #include <anki/util/Allocator.h>
 #include <anki/util/NonCopyable.h>
+#include <functional>
 
 namespace anki {
 

+ 1 - 3
include/anki/util/NonCopyable.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_UTIL_NON_COPYABLE_H
-#define ANKI_UTIL_NON_COPYABLE_H
+#pragma once
 
 namespace anki {
 
@@ -27,4 +26,3 @@ struct NonCopyable
 
 } // end namespace anki
 
-#endif

+ 1 - 0
include/anki/util/String.h

@@ -9,6 +9,7 @@
 #include <anki/util/Array.h>
 #include <anki/util/NonCopyable.h>
 #include <cstring>
+#include <cstdio>
 
 namespace anki {
 

+ 8 - 10
include/anki/util/Visitor.h

@@ -10,8 +10,7 @@
 /// @li Visitable: For non related types
 /// @li VisitableCommonBase: For types with common base
 
-#ifndef ANKI_UTIL_VISITOR_H
-#define ANKI_UTIL_VISITOR_H
+#pragma once
 
 #include <anki/util/Assert.h>
 #include <anki/util/Array.h>
@@ -166,7 +165,7 @@ private:
 		}
 	}
 
-	template<typename TVisitor, typename TFirst, typename TSecond, 
+	template<typename TVisitor, typename TFirst, typename TSecond,
 		typename... Types_>
 	void acceptVisitorInternal(TVisitor& v)
 	{
@@ -197,7 +196,7 @@ private:
 		}
 	}
 
-	template<typename TVisitor, typename TFirst, typename TSecond, 
+	template<typename TVisitor, typename TFirst, typename TSecond,
 		typename... Types_>
 	void acceptVisitorInternalConst(TVisitor& v) const
 	{
@@ -307,7 +306,7 @@ private:
 		return err;
 	}
 
-	template<typename TVisitor, typename TFirst, typename TSecond, 
+	template<typename TVisitor, typename TFirst, typename TSecond,
 		typename... Types_>
 	ANKI_USE_RESULT Error acceptVisitorInternal(TVisitor& v)
 	{
@@ -331,7 +330,7 @@ private:
 			err = acceptVisitorInternal<TVisitor, TFirst, Types_...>(v);
 			break;
 		}
-		
+
 		return err;
 	}
 
@@ -357,11 +356,11 @@ private:
 			ANKI_ASSERT(0 && "Wrong type ID");
 			break;
 		}
-		
+
 		return err;
 	}
 
-	template<typename TVisitor, typename TFirst, typename TSecond, 
+	template<typename TVisitor, typename TFirst, typename TSecond,
 		typename... Types_>
 	ANKI_USE_RESULT Error acceptVisitorInternalConst(TVisitor& v) const
 	{
@@ -385,7 +384,7 @@ private:
 			err = acceptVisitorInternalConst<TVisitor, TFirst, Types_...>(v);
 			break;
 		}
-		
+
 		return err;
 	}
 	/// @}
@@ -394,4 +393,3 @@ private:
 
 } // end namespace anki
 
-#endif

+ 14 - 14
src/collision/CompoundShape.cpp

@@ -19,27 +19,27 @@ CompoundShape::CompoundShape()
 //==============================================================================
 F32 CompoundShape::testPlane(const Plane& p) const
 {
-	F32 min = MAX_F32;
-	F32 max = MIN_F32;
+	F32 minv = MAX_F32;
+	F32 maxv = MIN_F32;
 
 	Error err = iterateShapes([&](const CollisionShape& cs) -> Error
 	{
 		F32 a = cs.testPlane(p);
-		min = std::min(min, a);
-		max = std::max(max, a);
+		minv = min(minv, a);
+		maxv = max(maxv, a);
 		return ErrorCode::NONE;
 	});
 	(void)err;
 
-	if(min > 0.0 && max > 0.0)
+	if(minv > 0.0 && maxv > 0.0)
 	{
-		return min;
+		return minv;
 	}
-	else if(min < 0.0 && max < 0.0)
+	else if(minv < 0.0 && maxv < 0.0)
 	{
-		return max;
+		return maxv;
 	}
-	
+
 	return 0.0;
 }
 
@@ -79,7 +79,7 @@ void CompoundShape::transform(const Transform& trf)
 //==============================================================================
 void CompoundShape::computeAabb(Aabb& out) const
 {
-	Vec4 min(Vec3(MAX_F32), 0.0), max(Vec3(MIN_F32), 0.0);
+	Vec4 minv(Vec3(MAX_F32), 0.0), maxv(Vec3(MIN_F32), 0.0);
 
 	Error err = iterateShapes([&](const CollisionShape& cs) -> Error
 	{
@@ -88,15 +88,15 @@ void CompoundShape::computeAabb(Aabb& out) const
 
 		for(U i = 0; i < 3; i++)
 		{
-			min[i] = std::min(min[i], aabb.getMin()[i]);
-			max[i] = std::max(max[i], aabb.getMax()[i]);
+			minv[i] = min(minv[i], aabb.getMin()[i]);
+			maxv[i] = max(maxv[i], aabb.getMax()[i]);
 		}
 		return ErrorCode::NONE;
 	});
 	(void)err;
 
-	out.setMin(min);
-	out.setMax(max);
+	out.setMin(minv);
+	out.setMax(maxv);
 }
 
 //==============================================================================

+ 1 - 0
src/gr/gl/RenderingThread.cpp

@@ -9,6 +9,7 @@
 #include <anki/gr/gl/GrManagerImpl.h>
 #include <anki/util/Logger.h>
 #include <anki/core/Trace.h>
+#include <cstdlib>
 
 namespace anki {
 

+ 13 - 13
src/util/File.cpp

@@ -57,8 +57,8 @@ Error File::open(const CString& filename, OpenFlag flags)
 
 	// Only these flags are accepted
 	ANKI_ASSERT((flags & (OpenFlag::READ | OpenFlag::WRITE | OpenFlag::APPEND
-		| OpenFlag::BINARY | OpenFlag::LITTLE_ENDIAN
-		| OpenFlag::BIG_ENDIAN)) != OpenFlag::NONE);
+		| OpenFlag::BINARY | OpenFlag::ENDIAN_LITTLE
+		| OpenFlag::ENDIAN_BIG)) != OpenFlag::NONE);
 
 	// Cannot be both
 	ANKI_ASSERT((flags & OpenFlag::READ) != (flags & OpenFlag::WRITE));
@@ -99,7 +99,7 @@ Error File::open(const CString& filename, OpenFlag flags)
 	if(!err)
 	{
 		// If the open() DIDN'T provided us the file endianess
-		if((flags & (OpenFlag::BIG_ENDIAN | OpenFlag::LITTLE_ENDIAN))
+		if((flags & (OpenFlag::ENDIAN_BIG | OpenFlag::ENDIAN_LITTLE))
 			== OpenFlag::NONE)
 		{
 			// Set the machine's endianness
@@ -108,8 +108,8 @@ Error File::open(const CString& filename, OpenFlag flags)
 		else
 		{
 			// Else just make sure that only one of the flags is set
-			ANKI_ASSERT((flags & OpenFlag::BIG_ENDIAN)
-				!= (flags & OpenFlag::LITTLE_ENDIAN));
+			ANKI_ASSERT((flags & OpenFlag::ENDIAN_BIG)
+				!= (flags & OpenFlag::ENDIAN_LITTLE));
 		}
 	}
 
@@ -403,7 +403,7 @@ Error File::readU32(U32& out)
 	ANKI_ASSERT((m_flags & OpenFlag::BINARY) != OpenFlag::NONE
 		&& "Should be binary file");
 	ANKI_ASSERT(
-		(m_flags & OpenFlag::BIG_ENDIAN) != (m_flags & OpenFlag::LITTLE_ENDIAN)
+		(m_flags & OpenFlag::ENDIAN_BIG) != (m_flags & OpenFlag::ENDIAN_LITTLE)
 		&& "One of those 2 should be active");
 
 	Error err = read(&out, sizeof(out));
@@ -412,16 +412,16 @@ Error File::readU32(U32& out)
 		// Copy it
 		OpenFlag machineEndianness = getMachineEndianness();
 		OpenFlag fileEndianness =
-			((m_flags & OpenFlag::BIG_ENDIAN) != OpenFlag::NONE)
-			? OpenFlag::BIG_ENDIAN
-			: OpenFlag::LITTLE_ENDIAN;
+			((m_flags & OpenFlag::ENDIAN_BIG) != OpenFlag::NONE)
+			? OpenFlag::ENDIAN_BIG
+			: OpenFlag::ENDIAN_LITTLE;
 
 		if(machineEndianness == fileEndianness)
 		{
 			// Same endianness between the file and the machine. Do nothing
 		}
-		else if(machineEndianness == OpenFlag::BIG_ENDIAN
-			&& fileEndianness == OpenFlag::LITTLE_ENDIAN)
+		else if(machineEndianness == OpenFlag::ENDIAN_BIG
+			&& fileEndianness == OpenFlag::ENDIAN_LITTLE)
 		{
 			U8* c = reinterpret_cast<U8*>(&out);
 			out = (c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24));
@@ -653,11 +653,11 @@ File::OpenFlag File::getMachineEndianness()
 	I32 num = 1;
 	if(*(char*)&num == 1)
 	{
-		return OpenFlag::LITTLE_ENDIAN;
+		return OpenFlag::ENDIAN_LITTLE;
 	}
 	else
 	{
-		return OpenFlag::BIG_ENDIAN;
+		return OpenFlag::ENDIAN_BIG;
 	}
 }
 

+ 1 - 0
src/util/FilesystemPosix.cpp

@@ -12,6 +12,7 @@
 #include <dirent.h>
 #include <cerrno>
 #include <ftw.h> // For walkDirectoryTree
+#include <cstdlib>
 
 // Define PATH_MAX if needed
 #ifndef PATH_MAX

+ 1 - 0
src/util/Logger.cpp

@@ -8,6 +8,7 @@
 #include <cstring>
 #include <cstdarg>
 #include <cstdio>
+#include <cstdlib>
 #if ANKI_OS == ANKI_OS_ANDROID
 #	include <android/log.h>
 #endif

+ 1 - 0
src/util/String.cpp

@@ -7,6 +7,7 @@
 #include <cmath> // For HUGE_VAL
 #include <climits> // For LLONG_MAX
 #include <cstdarg> // For var args
+#include <cstdlib> // For stdtod and strtol
 
 namespace anki {
 

+ 1 - 3
tests/framework/Framework.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_TESTS_FRAMEWORK_FRAMEWORK_H
-#define ANKI_TESTS_FRAMEWORK_FRAMEWORK_H
+#pragma once
 
 #include "anki/util/Singleton.h"
 #include <stdexcept>
@@ -215,4 +214,3 @@ extern void deleteTesterSingleton();
 
 } // end namespace anki
 
-#endif

+ 1 - 3
tests/util/Foo.h

@@ -3,8 +3,7 @@
 // Code licensed under the BSD License.
 // http://www.anki3d.org/LICENSE
 
-#ifndef ANKI_TESTS_UTIL_FOO_H
-#define ANKI_TESTS_UTIL_FOO_H
+#pragma once
 
 #include <cstdio>
 
@@ -90,4 +89,3 @@ struct Foo
 	}
 };
 
-#endif

+ 1 - 1
thirdparty

@@ -1 +1 @@
-Subproject commit 5eef03ab77372d30bc073f4b318453aba558239c
+Subproject commit a59faf8439abf96d049417645942fd4f31521d78