Browse Source

Fix compiler warnings

Panagiotis Christopoulos Charitos 5 years ago
parent
commit
3adbf5a97c
3 changed files with 8 additions and 8 deletions
  1. 1 1
      src/anki/core/NativeWindowSdl.cpp
  2. 1 1
      src/anki/physics/Common.h
  3. 6 6
      src/anki/util/Memory.h

+ 1 - 1
src/anki/core/NativeWindowSdl.cpp

@@ -21,7 +21,7 @@ Error NativeWindow::init(NativeWindowInitInfo& init, HeapAllocator<U8>& alloc)
 
 	if(SDL_Init(INIT_SUBSYSTEMS) != 0)
 	{
-		ANKI_CORE_LOGE("SDL_Init() failed");
+		ANKI_CORE_LOGE("SDL_Init() failed: %s", SDL_GetError());
 		return Error::FUNCTION_FAILED;
 	}
 

+ 1 - 1
src/anki/physics/Common.h

@@ -15,7 +15,7 @@
 #	pragma GCC diagnostic ignored "-Wall"
 #	pragma GCC diagnostic ignored "-Wconversion"
 #	pragma GCC diagnostic ignored "-Wfloat-conversion"
-#	if ANKI_COMPILER_GCC && __GNUC__ >= 9
+#	if(ANKI_COMPILER_GCC && __GNUC__ >= 9) || (ANKI_COMPILER_CLANG && __clang_major__ >= 10)
 #		pragma GCC diagnostic ignored "-Wdeprecated-copy"
 #	endif
 #endif

+ 6 - 6
src/anki/util/Memory.h

@@ -132,14 +132,14 @@ private:
 
 /// A dummy interface to match the StackMemoryPool and ChainMemoryPool interfaces in order to be used by the same
 /// allocator template.
-class HeapMemoryPool : public BaseMemoryPool
+class HeapMemoryPool final : public BaseMemoryPool
 {
 public:
 	/// Default constructor.
 	HeapMemoryPool();
 
 	/// Destroy
-	~HeapMemoryPool() final;
+	~HeapMemoryPool();
 
 	/// The real constructor.
 	/// @param allocCb The allocation function callback
@@ -163,7 +163,7 @@ private:
 
 /// Thread safe memory pool. It's a preallocated memory pool that is used for memory allocations on top of that
 /// preallocated memory. It is mainly used by fast stack allocators
-class StackMemoryPool : public BaseMemoryPool
+class StackMemoryPool final : public BaseMemoryPool
 {
 public:
 	/// The type of the pool's snapshot
@@ -173,7 +173,7 @@ public:
 	StackMemoryPool();
 
 	/// Destroy
-	~StackMemoryPool() final;
+	~StackMemoryPool();
 
 	/// Create with parameters
 	/// @param allocCb The allocation function callback
@@ -269,14 +269,14 @@ private:
 };
 
 /// Chain memory pool. Almost similar to StackMemoryPool but more flexible and at the same time a bit slower.
-class ChainMemoryPool : public BaseMemoryPool
+class ChainMemoryPool final : public BaseMemoryPool
 {
 public:
 	/// Default constructor
 	ChainMemoryPool();
 
 	/// Destroy
-	~ChainMemoryPool() final;
+	~ChainMemoryPool();
 
 	/// Creates the pool.
 	/// @param allocCb The allocation function callback.