From 7f9c87713a2b318e15501da1b1d610d5abe445e6 Mon Sep 17 00:00:00 2001 From: Ignacio Date: Mon, 30 Mar 2020 10:07:15 -0700 Subject: [PATCH] Minor cleanups in nvmath. --- src/nvmath/Color.h | 4 ++-- src/nvmath/Fitting.cpp | 4 ++-- src/nvmath/Fitting.h | 5 ----- src/nvmath/SimdVector.h | 2 +- src/nvmath/SimdVector_SSE.h | 6 +----- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/nvmath/Color.h b/src/nvmath/Color.h index 5cdc374..178c765 100644 --- a/src/nvmath/Color.h +++ b/src/nvmath/Color.h @@ -96,12 +96,12 @@ namespace nv /// 16 bit 565 BGR color. - class NVMATH_CLASS Color16 + struct NVMATH_CLASS Color16 { - public: Color16() { } Color16(const Color16 & c) : u(c.u) { } explicit Color16(uint16 U) : u(U) { } + Color16(uint8 r, uint8 g, uint8 b) : r(r), g(g), b(b) { } union { struct { diff --git a/src/nvmath/Fitting.cpp b/src/nvmath/Fitting.cpp index 6ac2ab9..6954548 100644 --- a/src/nvmath/Fitting.cpp +++ b/src/nvmath/Fitting.cpp @@ -3,12 +3,12 @@ #include "Fitting.h" #include "Vector.inl" #include "Plane.inl" +#include "Matrix.inl" #include "nvcore/Array.inl" #include "nvcore/Utils.h" // max, swap #include // FLT_MAX -//#include #include using namespace nv; @@ -668,7 +668,7 @@ bool nv::Fit::eigenSolveSymmetric4(const float matrix[10], float eigenValues[4], return true; } -#include "nvmath/Matrix.inl" + inline float signNonzero(float x) { diff --git a/src/nvmath/Fitting.h b/src/nvmath/Fitting.h index 7a88cd2..7728f10 100644 --- a/src/nvmath/Fitting.h +++ b/src/nvmath/Fitting.h @@ -1,8 +1,5 @@ // This code is in the public domain -- Ignacio Castaño - #pragma once -#ifndef NV_MATH_FITTING_H -#define NV_MATH_FITTING_H #include "Vector.h" #include "Plane.h" @@ -46,5 +43,3 @@ namespace nv } } // nv namespace - -#endif // NV_MATH_FITTING_H diff --git a/src/nvmath/SimdVector.h b/src/nvmath/SimdVector.h index 94e5186..38a06ef 100644 --- a/src/nvmath/SimdVector.h +++ b/src/nvmath/SimdVector.h @@ -1,8 +1,8 @@ // This code is in the public domain -- Ignacio Castaño +#pragma once #include "Vector.h" // Vector3, Vector4 - #if NV_USE_ALTIVEC # include "SimdVector_VE.h" #endif diff --git a/src/nvmath/SimdVector_SSE.h b/src/nvmath/SimdVector_SSE.h index c816de2..dc900c8 100644 --- a/src/nvmath/SimdVector_SSE.h +++ b/src/nvmath/SimdVector_SSE.h @@ -22,9 +22,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------- */ - -#ifndef NV_SIMD_VECTOR_SSE_H -#define NV_SIMD_VECTOR_SSE_H +#pragma once #include "nvcore/Memory.h" @@ -212,5 +210,3 @@ namespace nv { } } // namespace nv - -#endif // NV_SIMD_VECTOR_SSE_H