From 7111e78f248f8ff4b38fa421a05803459f4b6e05 Mon Sep 17 00:00:00 2001 From: Garux Date: Thu, 30 Oct 2025 00:00:25 +0500 Subject: [PATCH] undo = default; constructors, they allow zero initialization, unlike constructors with empty body --- contrib/bobtoolz/DPlane.h | 3 ++- libs/generic/vector.h | 9 ++++++--- libs/math/matrix.h | 3 ++- libs/math/plane.h | 3 ++- libs/render.h | 3 ++- libs/transformlib.h | 3 ++- radiant/brush.h | 3 ++- tools/quake3/common/polylib.h | 3 ++- tools/quake3/q3map2/q3map2.h | 5 +++-- 9 files changed, 23 insertions(+), 12 deletions(-) diff --git a/contrib/bobtoolz/DPlane.h b/contrib/bobtoolz/DPlane.h index cefe719a..68eecfe7 100644 --- a/contrib/bobtoolz/DPlane.h +++ b/contrib/bobtoolz/DPlane.h @@ -50,7 +50,8 @@ public: vec_t DistanceToPoint( const vec3_t pnt ) const; DPlane( const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData ); - DPlane() = default; + DPlane(){ + } bool m_bChkOk; _QERFaceData texInfo; diff --git a/libs/generic/vector.h b/libs/generic/vector.h index cafd7f5f..54fc7c99 100644 --- a/libs/generic/vector.h +++ b/libs/generic/vector.h @@ -8,7 +8,8 @@ class BasicVector2 { Element m_elements[2]; public: - BasicVector2() = default; + BasicVector2(){ + } template BasicVector2( const BasicVector2& other ){ x() = static_cast( other.x() ); @@ -54,7 +55,8 @@ class BasicVector3 Element m_elements[3]; public: - BasicVector3() = default; + BasicVector3(){ + } template BasicVector3( const BasicVector3& other ){ x() = static_cast( other.x() ); @@ -124,7 +126,8 @@ class BasicVector4 Element m_elements[4]; public: - BasicVector4() = default; + BasicVector4(){ + } BasicVector4( Element x_, Element y_, Element z_, Element w_ ){ x() = x_; y() = y_; diff --git a/libs/math/matrix.h b/libs/math/matrix.h index 362758c2..43d56cd6 100644 --- a/libs/math/matrix.h +++ b/libs/math/matrix.h @@ -38,7 +38,8 @@ class Matrix4 { float m_elements[16]; public: - Matrix4() = default; + Matrix4(){ + } Matrix4( float xx_, float xy_, float xz_, float xw_, float yx_, float yy_, float yz_, float yw_, float zx_, float zy_, float zz_, float zw_, diff --git a/libs/math/plane.h b/libs/math/plane.h index 30f3092f..b066014e 100644 --- a/libs/math/plane.h +++ b/libs/math/plane.h @@ -32,7 +32,8 @@ class Plane3___ public: T a, b, c, d; - Plane3___() = default; + Plane3___(){ + } Plane3___( double _a, double _b, double _c, double _d ) : a( _a ), b( _b ), c( _c ), d( _d ){ } diff --git a/libs/render.h b/libs/render.h index c826acc5..a6e896c5 100644 --- a/libs/render.h +++ b/libs/render.h @@ -277,7 +277,8 @@ struct Colour4b { unsigned char r, g, b, a; - Colour4b() = default; + Colour4b(){ + } Colour4b( unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a ) : r( _r ), g( _g ), b( _b ), a( _a ){ diff --git a/libs/transformlib.h b/libs/transformlib.h index 8e74a9ec..1299418a 100644 --- a/libs/transformlib.h +++ b/libs/transformlib.h @@ -79,7 +79,8 @@ struct Skew std::size_t index; float amount; - Skew() = default; + Skew(){ + } Skew( std::size_t index_, float amount_ ) : index( index_ ), amount( amount_ ){ } bool operator!= ( const Skew& other ) const { diff --git a/radiant/brush.h b/radiant/brush.h index 718e0ac9..516f1585 100644 --- a/radiant/brush.h +++ b/radiant/brush.h @@ -271,7 +271,8 @@ typedef ReferencePair FaceShaderObserverPair; class ContentsFlagsValue { public: - ContentsFlagsValue() = default; + ContentsFlagsValue(){ + } ContentsFlagsValue( int surfaceFlags, int contentFlags, int value, bool specified ) : m_surfaceFlags( surfaceFlags ), m_contentFlags( contentFlags ), diff --git a/tools/quake3/common/polylib.h b/tools/quake3/common/polylib.h index 4e3ddc4b..9d141081 100644 --- a/tools/quake3/common/polylib.h +++ b/tools/quake3/common/polylib.h @@ -59,7 +59,8 @@ class ESide { bool m_value; public: - ESide() = default; + ESide(){ + } ESide( bool value ) : m_value( value ){} operator bool() const { return m_value; diff --git a/tools/quake3/q3map2/q3map2.h b/tools/quake3/q3map2/q3map2.h index 70638fb2..16c4bba3 100644 --- a/tools/quake3/q3map2/q3map2.h +++ b/tools/quake3/q3map2/q3map2.h @@ -386,7 +386,8 @@ struct image_t int width, height; byte *pixels = nullptr; - image_t() = default; + image_t(){ + } image_t( const char *name, const char *filename, int width, int height, byte *pixels ) : name( name ), filename( filename ), @@ -720,7 +721,7 @@ struct brush_t int lightmapSampleSize; /* jal : entity based _lightmapsamplesize */ float lightmapScale; float shadeAngleDegrees; /* jal : entity based _shadeangle */ - Vector3 ambientColor; + Vector3 ambientColor{ 0 }; MinMax eMinmax; indexMap_t *im;