From 7be19cc18f6748a881cbfb36ebd4de822bb4ef7e Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 2 Nov 2020 11:56:47 +0200
Subject: [PATCH] Remove some compile warnings

---
 SDK/C++/private/system.cpp             | 4 ----
 components/calibration/CMakeLists.txt  | 7 ++++++-
 components/codecs/src/depth_convert.cu | 2 +-
 components/renderers/cpp/src/touch.cu  | 2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/SDK/C++/private/system.cpp b/SDK/C++/private/system.cpp
index 3f25035da..dd18eef25 100644
--- a/SDK/C++/private/system.cpp
+++ b/SDK/C++/private/system.cpp
@@ -23,10 +23,6 @@ EXTERN_DLL_EXPORT voltu::System* voltu_initialise()
 	{
 		return new SystemImpl();
 	}
-	else
-	{
-		throw voltu::exceptions::AlreadyInit();
-	}
 	return nullptr;
 }
 
diff --git a/components/calibration/CMakeLists.txt b/components/calibration/CMakeLists.txt
index 1f619a6e0..90978a040 100644
--- a/components/calibration/CMakeLists.txt
+++ b/components/calibration/CMakeLists.txt
@@ -9,7 +9,12 @@ set(CALIBSRC
 
 if (WITH_CERES)
 	list(APPEND CALIBSRC src/optimize.cpp)
-	set_source_files_properties(src/optimize.cpp PROPERTIES COMPILE_FLAGS -O3)
+
+	if(WIN32)
+		set_source_files_properties(src/optimize.cpp PROPERTIES COMPILE_FLAGS /O2)
+	else()
+		set_source_files_properties(src/optimize.cpp PROPERTIES COMPILE_FLAGS -O3)
+	endif()
 endif()
 
 add_library(ftlcalibration ${CALIBSRC})
diff --git a/components/codecs/src/depth_convert.cu b/components/codecs/src/depth_convert.cu
index 239e9b05e..b71913b7b 100644
--- a/components/codecs/src/depth_convert.cu
+++ b/components/codecs/src/depth_convert.cu
@@ -309,7 +309,7 @@ void ftl::cuda::vuya_to_depth(const cv::cuda::PtrStepSz<float> &depth, const cv:
 	const dim3 gridSize((depth.cols/2 + THREADS_X - 1)/THREADS_X, (depth.rows/2 + THREADS_Y - 1)/THREADS_Y);
     const dim3 blockSize(THREADS_X, THREADS_Y);
 
-	vuya_to_depth_kernel<ushort,THREADS_X,THREADS_Y><<<gridSize, blockSize, 0, cv::cuda::StreamAccessor::getStream(stream)>>>(depth, luminance.data, chroma.data, luminance.step/sizeof(ushort), maxdepth);
+	vuya_to_depth_kernel<ushort,THREADS_X,THREADS_Y><<<gridSize, blockSize, 0, cv::cuda::StreamAccessor::getStream(stream)>>>(depth, luminance.data, chroma.data, int(luminance.step/sizeof(ushort)), maxdepth);
 	cudaSafeCall( cudaGetLastError() );
 }
 
diff --git a/components/renderers/cpp/src/touch.cu b/components/renderers/cpp/src/touch.cu
index e81d90180..8490622e0 100644
--- a/components/renderers/cpp/src/touch.cu
+++ b/components/renderers/cpp/src/touch.cu
@@ -5,7 +5,7 @@ using ftl::cuda::TextureObject;
 using ftl::cuda::warpSum;
 
 __device__ inline ftl::cuda::Collision pack_collision(int cx, int cy, int num, float cd) {
-    return ftl::cuda::Collision{(num << 24) | (cx << 12) | (cy), cd};
+    return ftl::cuda::Collision{((unsigned int)num << 24) | ((unsigned int)cx << 12) | ((unsigned int)cy), cd};
 }
 
  __global__ void touch_kernel(TextureObject<float> depth_in, TextureObject<float> depth_out, ftl::cuda::Collision *collisions, int max_collisions, float dist) {
-- 
GitLab