From ea845478052c4af6aa7e8a1ac28aac8bfea5e53f Mon Sep 17 00:00:00 2001 From: WMOkiishi Date: Wed, 2 Aug 2023 08:17:24 +0200 Subject: [PATCH] general: Mark many constructors as `explicit` Closes #1514 Fixes #1431 --- dtool/src/prc/configVariableBool.h | 12 ++++-- dtool/src/prc/configVariableDouble.h | 14 ++++--- dtool/src/prc/configVariableFilename.h | 6 ++- dtool/src/prc/configVariableInt.h | 14 ++++--- dtool/src/prc/configVariableInt64.h | 14 ++++--- dtool/src/prc/configVariableList.h | 6 +-- dtool/src/prc/configVariableSearchPath.h | 22 +++++------ dtool/src/prc/configVariableString.h | 8 ++-- panda/src/bullet/bulletContactCallbackData.h | 8 ++-- panda/src/bullet/bulletTickCallbackData.h | 2 +- panda/src/chan/animChannelScalarTable.h | 2 +- panda/src/device/inputDeviceNode.h | 2 +- panda/src/downloader/httpEntityTag.h | 2 +- panda/src/gobj/geomVertexArrayFormat.h | 40 ++++++++++---------- panda/src/gobj/geomVertexReader.h | 20 +++++----- panda/src/gobj/geomVertexRewriter.h | 12 +++--- panda/src/gobj/geomVertexWriter.h | 18 ++++----- panda/src/gobj/paramTexture.h | 4 +- panda/src/gobj/transformBlend.h | 20 +++++----- panda/src/linmath/configVariableColor.h | 16 ++++---- panda/src/linmath/lmatrix4_src.h | 3 +- panda/src/linmath/lorientation_src.h | 6 +-- panda/src/linmath/lpoint3_src.h | 2 +- panda/src/linmath/lpoint4_src.h | 2 +- panda/src/linmath/lquaternion_src.h | 2 +- panda/src/linmath/lrotation_src.h | 8 ++-- panda/src/linmath/lvector3_src.h | 2 +- panda/src/linmath/lvector4_src.h | 2 +- panda/src/mathutil/boundingHexahedron.h | 12 +++--- panda/src/movies/movieVideo.h | 2 +- panda/src/movies/userDataAudio.h | 2 +- panda/src/ode/odeAMotorJoint.h | 4 +- panda/src/ode/odeBallJoint.h | 4 +- panda/src/ode/odeBody.h | 2 +- panda/src/ode/odeBoxGeom.h | 4 +- panda/src/ode/odeCappedCylinderGeom.h | 4 +- panda/src/ode/odeContactJoint.h | 4 +- panda/src/ode/odeCylinderGeom.h | 4 +- panda/src/ode/odeFixedJoint.h | 4 +- panda/src/ode/odeHinge2Joint.h | 4 +- panda/src/ode/odeHingeJoint.h | 4 +- panda/src/ode/odeLMotorJoint.h | 4 +- panda/src/ode/odeNullJoint.h | 4 +- panda/src/ode/odePlane2dJoint.h | 4 +- panda/src/ode/odePlaneGeom.h | 4 +- panda/src/ode/odeQuadTreeSpace.h | 14 +++---- panda/src/ode/odeRayGeom.h | 2 +- panda/src/ode/odeSliderJoint.h | 4 +- panda/src/ode/odeSphereGeom.h | 2 +- panda/src/ode/odeUniversalJoint.h | 4 +- panda/src/pgraphnodes/spotlight.h | 2 +- panda/src/physics/angularEulerIntegrator.cxx | 2 +- panda/src/pnmimage/pnmImageHeader.h | 6 +-- panda/src/text/dynamicTextFont.h | 2 +- 54 files changed, 197 insertions(+), 180 deletions(-) diff --git a/dtool/src/prc/configVariableBool.h b/dtool/src/prc/configVariableBool.h index 94ba8853bd..c6ea2194e6 100644 --- a/dtool/src/prc/configVariableBool.h +++ b/dtool/src/prc/configVariableBool.h @@ -23,10 +23,14 @@ class EXPCL_DTOOL_PRC ConfigVariableBool : public ConfigVariable { PUBLISHED: INLINE explicit ConfigVariableBool(const std::string &name); - INLINE ConfigVariableBool(const std::string &name, bool default_value, - const std::string &description = std::string(), int flags = 0); - INLINE ConfigVariableBool(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), int flags = 0); + INLINE explicit ConfigVariableBool(const std::string &name, + bool default_value, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableBool(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (bool value); ALWAYS_INLINE operator bool () const; diff --git a/dtool/src/prc/configVariableDouble.h b/dtool/src/prc/configVariableDouble.h index 6244ae8f15..258560c714 100644 --- a/dtool/src/prc/configVariableDouble.h +++ b/dtool/src/prc/configVariableDouble.h @@ -24,12 +24,14 @@ class EXPCL_DTOOL_PRC ConfigVariableDouble : public ConfigVariable { PUBLISHED: INLINE explicit ConfigVariableDouble(const std::string &name); - INLINE ConfigVariableDouble(const std::string &name, double default_value, - const std::string &description = std::string(), - int flags = 0); - INLINE ConfigVariableDouble(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), - int flags = 0); + INLINE explicit ConfigVariableDouble(const std::string &name, + double default_value, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableDouble(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (double value); INLINE operator double () const; diff --git a/dtool/src/prc/configVariableFilename.h b/dtool/src/prc/configVariableFilename.h index 1427b589f3..18ea1ddb8a 100644 --- a/dtool/src/prc/configVariableFilename.h +++ b/dtool/src/prc/configVariableFilename.h @@ -27,8 +27,10 @@ class EXPCL_DTOOL_PRC ConfigVariableFilename : public ConfigVariable { PUBLISHED: INLINE explicit ConfigVariableFilename(const std::string &name); - INLINE ConfigVariableFilename(const std::string &name, const Filename &default_value, - const std::string &description = std::string(), int flags = 0); + INLINE explicit ConfigVariableFilename(const std::string &name, + const Filename &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (const Filename &value); INLINE operator const Filename &() const; diff --git a/dtool/src/prc/configVariableInt.h b/dtool/src/prc/configVariableInt.h index 2183032ce6..5dd569a468 100644 --- a/dtool/src/prc/configVariableInt.h +++ b/dtool/src/prc/configVariableInt.h @@ -24,12 +24,14 @@ class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable { PUBLISHED: INLINE explicit ConfigVariableInt(const std::string &name); - INLINE ConfigVariableInt(const std::string &name, int default_value, - const std::string &description = std::string(), - int flags = 0); - INLINE ConfigVariableInt(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), - int flags = 0); + INLINE explicit ConfigVariableInt(const std::string &name, + int default_value, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableInt(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (int value); INLINE operator int () const; diff --git a/dtool/src/prc/configVariableInt64.h b/dtool/src/prc/configVariableInt64.h index a85876ba1d..16a685ee3d 100644 --- a/dtool/src/prc/configVariableInt64.h +++ b/dtool/src/prc/configVariableInt64.h @@ -25,12 +25,14 @@ class EXPCL_DTOOL_PRC ConfigVariableInt64 : public ConfigVariable { PUBLISHED: INLINE explicit ConfigVariableInt64(const std::string &name); - INLINE ConfigVariableInt64(const std::string &name, int64_t default_value, - const std::string &description = std::string(), - int flags = 0); - INLINE ConfigVariableInt64(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), - int flags = 0); + INLINE explicit ConfigVariableInt64(const std::string &name, + int64_t default_value, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableInt64(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (int64_t value); INLINE operator int64_t () const; diff --git a/dtool/src/prc/configVariableList.h b/dtool/src/prc/configVariableList.h index 188b33c5fb..c0128af374 100644 --- a/dtool/src/prc/configVariableList.h +++ b/dtool/src/prc/configVariableList.h @@ -30,9 +30,9 @@ */ class EXPCL_DTOOL_PRC ConfigVariableList : public ConfigVariableBase { PUBLISHED: - INLINE ConfigVariableList(const std::string &name, - const std::string &description = std::string(), - int flags = 0); + INLINE explicit ConfigVariableList(const std::string &name, + const std::string &description = std::string(), + int flags = 0); INLINE ~ConfigVariableList(); INLINE size_t get_num_values() const; diff --git a/dtool/src/prc/configVariableSearchPath.h b/dtool/src/prc/configVariableSearchPath.h index ca575c078a..dd55c6af26 100644 --- a/dtool/src/prc/configVariableSearchPath.h +++ b/dtool/src/prc/configVariableSearchPath.h @@ -35,17 +35,17 @@ */ class EXPCL_DTOOL_PRC ConfigVariableSearchPath : public ConfigVariableBase { PUBLISHED: - INLINE ConfigVariableSearchPath(const std::string &name, - const std::string &description = std::string(), - int flags = 0); - INLINE ConfigVariableSearchPath(const std::string &name, - const DSearchPath &default_value, - const std::string &description, - int flags = 0); - INLINE ConfigVariableSearchPath(const std::string &name, - const std::string &default_value, - const std::string &description, - int flags = 0); + INLINE explicit ConfigVariableSearchPath(const std::string &name, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableSearchPath(const std::string &name, + const DSearchPath &default_value, + const std::string &description, + int flags = 0); + INLINE explicit ConfigVariableSearchPath(const std::string &name, + const std::string &default_value, + const std::string &description, + int flags = 0); INLINE ~ConfigVariableSearchPath(); INLINE operator DSearchPath () const; diff --git a/dtool/src/prc/configVariableString.h b/dtool/src/prc/configVariableString.h index cb5249e6cf..1eb0c45fab 100644 --- a/dtool/src/prc/configVariableString.h +++ b/dtool/src/prc/configVariableString.h @@ -22,9 +22,11 @@ */ class EXPCL_DTOOL_PRC ConfigVariableString : public ConfigVariable { PUBLISHED: - INLINE ConfigVariableString(const std::string &name); - INLINE ConfigVariableString(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), int flags = 0); + INLINE explicit ConfigVariableString(const std::string &name); + INLINE explicit ConfigVariableString(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (const std::string &value); INLINE operator const std::string & () const; diff --git a/panda/src/bullet/bulletContactCallbackData.h b/panda/src/bullet/bulletContactCallbackData.h index 9ed17b8e1c..a1d14250c4 100644 --- a/panda/src/bullet/bulletContactCallbackData.h +++ b/panda/src/bullet/bulletContactCallbackData.h @@ -28,10 +28,10 @@ class EXPCL_PANDABULLET BulletContactCallbackData : public CallbackData { PUBLISHED: - INLINE BulletContactCallbackData(BulletManifoldPoint &mp, - PandaNode *node0, PandaNode *node1, - int id0, int id1, - int index0, int index1); + INLINE explicit BulletContactCallbackData(BulletManifoldPoint &mp, + PandaNode *node0, PandaNode *node1, + int id0, int id1, + int index0, int index1); INLINE BulletManifoldPoint &get_manifold() const; INLINE PandaNode *get_node0() const; diff --git a/panda/src/bullet/bulletTickCallbackData.h b/panda/src/bullet/bulletTickCallbackData.h index cb6014f6dd..6e9af63d9d 100644 --- a/panda/src/bullet/bulletTickCallbackData.h +++ b/panda/src/bullet/bulletTickCallbackData.h @@ -26,7 +26,7 @@ class EXPCL_PANDABULLET BulletTickCallbackData : public CallbackData { PUBLISHED: - INLINE BulletTickCallbackData(btScalar timestep); + INLINE explicit BulletTickCallbackData(btScalar timestep); INLINE PN_stdfloat get_timestep() const; diff --git a/panda/src/chan/animChannelScalarTable.h b/panda/src/chan/animChannelScalarTable.h index db92167f56..f9c626fc26 100644 --- a/panda/src/chan/animChannelScalarTable.h +++ b/panda/src/chan/animChannelScalarTable.h @@ -31,7 +31,7 @@ protected: AnimChannelScalarTable(AnimGroup *parent, const AnimChannelScalarTable ©); PUBLISHED: - AnimChannelScalarTable(AnimGroup *parent, const std::string &name); + explicit AnimChannelScalarTable(AnimGroup *parent, const std::string &name); public: virtual bool has_changed(int last_frame, double last_frac, diff --git a/panda/src/device/inputDeviceNode.h b/panda/src/device/inputDeviceNode.h index 7fad39e5ea..f2d5659781 100644 --- a/panda/src/device/inputDeviceNode.h +++ b/panda/src/device/inputDeviceNode.h @@ -28,7 +28,7 @@ */ class EXPCL_PANDA_DEVICE InputDeviceNode : public DataNode { PUBLISHED: - InputDeviceNode(InputDevice *device, const std::string &name); + explicit InputDeviceNode(InputDevice *device, const std::string &name); public: void set_device(InputDevice *device); diff --git a/panda/src/downloader/httpEntityTag.h b/panda/src/downloader/httpEntityTag.h index 7388b8621f..07b8a0196b 100644 --- a/panda/src/downloader/httpEntityTag.h +++ b/panda/src/downloader/httpEntityTag.h @@ -25,7 +25,7 @@ class EXPCL_PANDA_DOWNLOADER HTTPEntityTag { PUBLISHED: INLINE HTTPEntityTag(); HTTPEntityTag(const std::string &text); - INLINE HTTPEntityTag(bool weak, const std::string &tag); + INLINE explicit HTTPEntityTag(bool weak, const std::string &tag); INLINE HTTPEntityTag(const HTTPEntityTag ©); INLINE void operator = (const HTTPEntityTag ©); diff --git a/panda/src/gobj/geomVertexArrayFormat.h b/panda/src/gobj/geomVertexArrayFormat.h index 4c92abfe44..26eff8f21f 100644 --- a/panda/src/gobj/geomVertexArrayFormat.h +++ b/panda/src/gobj/geomVertexArrayFormat.h @@ -48,26 +48,26 @@ class EXPCL_PANDA_GOBJ GeomVertexArrayFormat final : public TypedWritableReferen PUBLISHED: GeomVertexArrayFormat(); GeomVertexArrayFormat(const GeomVertexArrayFormat ©); - GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, - NumericType numeric_type0, Contents contents0); - GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, - NumericType numeric_type0, Contents contents0, - CPT_InternalName name1, int num_components1, - NumericType numeric_type1, Contents contents1); - GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, - NumericType numeric_type0, Contents contents0, - CPT_InternalName name1, int num_components1, - NumericType numeric_type1, Contents contents1, - CPT_InternalName name2, int num_components2, - NumericType numeric_type2, Contents contents2); - GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, - NumericType numeric_type0, Contents contents0, - CPT_InternalName name1, int num_components1, - NumericType numeric_type1, Contents contents1, - CPT_InternalName name2, int num_components2, - NumericType numeric_type2, Contents contents2, - CPT_InternalName name3, int num_components3, - NumericType numeric_type3, Contents contents3); + explicit GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, + NumericType numeric_type0, Contents contents0); + explicit GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, + NumericType numeric_type0, Contents contents0, + CPT_InternalName name1, int num_components1, + NumericType numeric_type1, Contents contents1); + explicit GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, + NumericType numeric_type0, Contents contents0, + CPT_InternalName name1, int num_components1, + NumericType numeric_type1, Contents contents1, + CPT_InternalName name2, int num_components2, + NumericType numeric_type2, Contents contents2); + explicit GeomVertexArrayFormat(CPT_InternalName name0, int num_components0, + NumericType numeric_type0, Contents contents0, + CPT_InternalName name1, int num_components1, + NumericType numeric_type1, Contents contents1, + CPT_InternalName name2, int num_components2, + NumericType numeric_type2, Contents contents2, + CPT_InternalName name3, int num_components3, + NumericType numeric_type3, Contents contents3); void operator = (const GeomVertexArrayFormat ©); ~GeomVertexArrayFormat(); diff --git a/panda/src/gobj/geomVertexReader.h b/panda/src/gobj/geomVertexReader.h index a56d00f3ba..699d62b1a4 100644 --- a/panda/src/gobj/geomVertexReader.h +++ b/panda/src/gobj/geomVertexReader.h @@ -46,22 +46,22 @@ */ class EXPCL_PANDA_GOBJ GeomVertexReader : public GeomEnums { PUBLISHED: - INLINE GeomVertexReader(Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexReader(Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexReader(CPT(GeomVertexData) vertex_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexReader(CPT(GeomVertexData) vertex_data, - CPT_InternalName name, - Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexReader(CPT(GeomVertexData) vertex_data, + CPT_InternalName name, + Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexReader(CPT(GeomVertexArrayData) array_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexReader(CPT(GeomVertexArrayData) array_data, - int column, - Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexReader(CPT(GeomVertexArrayData) array_data, + int column, + Thread *current_thread = Thread::get_current_thread()); public: - INLINE GeomVertexReader(const GeomVertexDataPipelineReader *data_reader, - const InternalName *name, - bool force = true); + INLINE explicit GeomVertexReader(const GeomVertexDataPipelineReader *data_reader, + const InternalName *name, + bool force = true); PUBLISHED: INLINE GeomVertexReader(const GeomVertexReader ©); diff --git a/panda/src/gobj/geomVertexRewriter.h b/panda/src/gobj/geomVertexRewriter.h index 2ed1699522..2bddbb91d7 100644 --- a/panda/src/gobj/geomVertexRewriter.h +++ b/panda/src/gobj/geomVertexRewriter.h @@ -32,14 +32,14 @@ */ class EXPCL_PANDA_GOBJ GeomVertexRewriter : public GeomVertexWriter, public GeomVertexReader { PUBLISHED: - INLINE GeomVertexRewriter(Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexRewriter(Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexRewriter(GeomVertexData *vertex_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexRewriter(GeomVertexData *vertex_data, - CPT_InternalName name, - Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexRewriter(GeomVertexData *vertex_data, + CPT_InternalName name, + Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexRewriter(GeomVertexArrayData *array_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexRewriter(GeomVertexArrayData *array_data, - int column, Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexRewriter(GeomVertexArrayData *array_data, + int column, Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexRewriter(const GeomVertexRewriter ©); INLINE void operator = (const GeomVertexRewriter ©); INLINE ~GeomVertexRewriter(); diff --git a/panda/src/gobj/geomVertexWriter.h b/panda/src/gobj/geomVertexWriter.h index b0fab4609e..8347f1c325 100644 --- a/panda/src/gobj/geomVertexWriter.h +++ b/panda/src/gobj/geomVertexWriter.h @@ -54,21 +54,21 @@ */ class EXPCL_PANDA_GOBJ GeomVertexWriter : public GeomEnums { PUBLISHED: - INLINE GeomVertexWriter(Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexWriter(Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexWriter(PT(GeomVertexData) vertex_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexWriter(PT(GeomVertexData) vertex_data, - CPT_InternalName name, - Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexWriter(PT(GeomVertexData) vertex_data, + CPT_InternalName name, + Thread *current_thread = Thread::get_current_thread()); INLINE GeomVertexWriter(PT(GeomVertexArrayData) array_data, Thread *current_thread = Thread::get_current_thread()); - INLINE GeomVertexWriter(PT(GeomVertexArrayData) array_data, - int column, - Thread *current_thread = Thread::get_current_thread()); + INLINE explicit GeomVertexWriter(PT(GeomVertexArrayData) array_data, + int column, + Thread *current_thread = Thread::get_current_thread()); public: - INLINE GeomVertexWriter(GeomVertexDataPipelineWriter *data_writer, - const InternalName *name); + INLINE explicit GeomVertexWriter(GeomVertexDataPipelineWriter *data_writer, + const InternalName *name); PUBLISHED: INLINE GeomVertexWriter(const GeomVertexWriter ©); diff --git a/panda/src/gobj/paramTexture.h b/panda/src/gobj/paramTexture.h index fb9b2a5a81..cec521d2a7 100644 --- a/panda/src/gobj/paramTexture.h +++ b/panda/src/gobj/paramTexture.h @@ -28,7 +28,7 @@ protected: INLINE ParamTextureSampler() {}; PUBLISHED: - INLINE ParamTextureSampler(Texture *tex, const SamplerState &sampler); + INLINE explicit ParamTextureSampler(Texture *tex, const SamplerState &sampler); INLINE virtual TypeHandle get_value_type() const; INLINE Texture *get_texture() const; @@ -89,7 +89,7 @@ protected: }; PUBLISHED: - INLINE ParamTextureImage(Texture *tex, bool read, bool write, int z=-1, int n=0); + INLINE explicit ParamTextureImage(Texture *tex, bool read, bool write, int z=-1, int n=0); INLINE virtual TypeHandle get_value_type() const; diff --git a/panda/src/gobj/transformBlend.h b/panda/src/gobj/transformBlend.h index 3adcb73128..e52e896c92 100644 --- a/panda/src/gobj/transformBlend.h +++ b/panda/src/gobj/transformBlend.h @@ -32,16 +32,16 @@ class EXPCL_PANDA_GOBJ TransformBlend { PUBLISHED: INLINE TransformBlend(); - INLINE TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0); - INLINE TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, - const VertexTransform *transform1, PN_stdfloat weight1); - INLINE TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, - const VertexTransform *transform1, PN_stdfloat weight1, - const VertexTransform *transform2, PN_stdfloat weight2); - INLINE TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, - const VertexTransform *transform1, PN_stdfloat weight1, - const VertexTransform *transform2, PN_stdfloat weight2, - const VertexTransform *transform3, PN_stdfloat weight3); + INLINE explicit TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0); + INLINE explicit TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, + const VertexTransform *transform1, PN_stdfloat weight1); + INLINE explicit TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, + const VertexTransform *transform1, PN_stdfloat weight1, + const VertexTransform *transform2, PN_stdfloat weight2); + INLINE explicit TransformBlend(const VertexTransform *transform0, PN_stdfloat weight0, + const VertexTransform *transform1, PN_stdfloat weight1, + const VertexTransform *transform2, PN_stdfloat weight2, + const VertexTransform *transform3, PN_stdfloat weight3); INLINE TransformBlend(const TransformBlend ©); INLINE void operator = (const TransformBlend ©); INLINE ~TransformBlend(); diff --git a/panda/src/linmath/configVariableColor.h b/panda/src/linmath/configVariableColor.h index fba5330e26..a37f9b3955 100644 --- a/panda/src/linmath/configVariableColor.h +++ b/panda/src/linmath/configVariableColor.h @@ -34,13 +34,15 @@ */ class EXPCL_PANDA_LINMATH ConfigVariableColor : public ConfigVariable { PUBLISHED: - INLINE ConfigVariableColor(const std::string &name); - INLINE ConfigVariableColor(const std::string &name, const LColor &default_value, - const std::string &description = std::string(), - int flags = 0); - INLINE ConfigVariableColor(const std::string &name, const std::string &default_value, - const std::string &description = std::string(), - int flags = 0); + INLINE explicit ConfigVariableColor(const std::string &name); + INLINE explicit ConfigVariableColor(const std::string &name, + const LColor &default_value, + const std::string &description = std::string(), + int flags = 0); + INLINE explicit ConfigVariableColor(const std::string &name, + const std::string &default_value, + const std::string &description = std::string(), + int flags = 0); INLINE void operator = (const LColor &value); INLINE operator const LColor & () const; diff --git a/panda/src/linmath/lmatrix4_src.h b/panda/src/linmath/lmatrix4_src.h index 6dd07a9fbe..cb2fe2ec43 100644 --- a/panda/src/linmath/lmatrix4_src.h +++ b/panda/src/linmath/lmatrix4_src.h @@ -72,7 +72,8 @@ PUBLISHED: // Construct a 4x4 matrix given a 3x3 rotation matrix and an optional // translation component. INLINE_LINMATH FLOATNAME(LMatrix4)(const FLOATNAME(LMatrix3) &upper3); - INLINE_LINMATH FLOATNAME(LMatrix4)(const FLOATNAME(LMatrix3) &upper3,const FLOATNAME(LVecBase3) &trans); + INLINE_LINMATH explicit FLOATNAME(LMatrix4)(const FLOATNAME(LMatrix3) &upper3, + const FLOATNAME(LVecBase3) &trans); INLINE_LINMATH void fill(FLOATTYPE fill_value); INLINE_LINMATH void set(FLOATTYPE e00, FLOATTYPE e01, FLOATTYPE e02, FLOATTYPE e03, diff --git a/panda/src/linmath/lorientation_src.h b/panda/src/linmath/lorientation_src.h index 88921b8552..f40bdca93d 100644 --- a/panda/src/linmath/lorientation_src.h +++ b/panda/src/linmath/lorientation_src.h @@ -21,9 +21,9 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LOrientation)(); INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LQuaternion) &c); INLINE_LINMATH FLOATNAME(LOrientation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, FLOATTYPE twist); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix3) &m); - INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m); + INLINE_LINMATH explicit FLOATNAME(LOrientation)(const FLOATNAME(LVector3) &point_at, FLOATTYPE twist); + INLINE_LINMATH explicit FLOATNAME(LOrientation)(const FLOATNAME(LMatrix3) &m); + INLINE_LINMATH explicit FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m); INLINE_LINMATH FLOATNAME(LOrientation) operator * (const FLOATNAME(LRotation) &other) const; diff --git a/panda/src/linmath/lpoint3_src.h b/panda/src/linmath/lpoint3_src.h index b321a3ba35..81ba79a644 100644 --- a/panda/src/linmath/lpoint3_src.h +++ b/panda/src/linmath/lpoint3_src.h @@ -24,7 +24,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase3) ©); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); - INLINE_LINMATH FLOATNAME(LPoint3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); + INLINE_LINMATH explicit FLOATNAME(LPoint3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); PY_EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const std::string &attr_name) const); PY_EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const std::string &attr_name, PyObject *assign)); diff --git a/panda/src/linmath/lpoint4_src.h b/panda/src/linmath/lpoint4_src.h index 59184f7447..2593a9245f 100644 --- a/panda/src/linmath/lpoint4_src.h +++ b/panda/src/linmath/lpoint4_src.h @@ -20,7 +20,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LPoint4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); - INLINE_LINMATH FLOATNAME(LPoint4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); + INLINE_LINMATH explicit FLOATNAME(LPoint4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); PY_EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const std::string &attr_name) const); PY_EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const std::string &attr_name, PyObject *assign)); diff --git a/panda/src/linmath/lquaternion_src.h b/panda/src/linmath/lquaternion_src.h index 52bbc6fff7..43cd605101 100644 --- a/panda/src/linmath/lquaternion_src.h +++ b/panda/src/linmath/lquaternion_src.h @@ -18,7 +18,7 @@ class EXPCL_PANDA_LINMATH FLOATNAME(LQuaternion) : public FLOATNAME(LVecBase4) { PUBLISHED: INLINE_LINMATH FLOATNAME(LQuaternion)(); INLINE_LINMATH FLOATNAME(LQuaternion)(const FLOATNAME(LVecBase4) ©); - INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE r, const FLOATNAME(LVecBase3) ©); + INLINE_LINMATH explicit FLOATNAME(LQuaternion)(FLOATTYPE r, const FLOATNAME(LVecBase3) ©); INLINE_LINMATH FLOATNAME(LQuaternion)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); static FLOATNAME(LQuaternion) pure_imaginary(const FLOATNAME(LVector3) &v); diff --git a/panda/src/linmath/lrotation_src.h b/panda/src/linmath/lrotation_src.h index 4c844b98a1..7cf7f349d8 100644 --- a/panda/src/linmath/lrotation_src.h +++ b/panda/src/linmath/lrotation_src.h @@ -20,10 +20,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &c); INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE r, FLOATTYPE i, FLOATTYPE j, FLOATTYPE k); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVector3) &axis, FLOATTYPE angle); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix3) &m); - INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &m); - INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE h, FLOATTYPE p, FLOATTYPE r); + INLINE_LINMATH explicit FLOATNAME(LRotation)(const FLOATNAME(LVector3) &axis, FLOATTYPE angle); + INLINE_LINMATH explicit FLOATNAME(LRotation)(const FLOATNAME(LMatrix3) &m); + INLINE_LINMATH explicit FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &m); + INLINE_LINMATH explicit FLOATNAME(LRotation)(FLOATTYPE h, FLOATTYPE p, FLOATTYPE r); INLINE_LINMATH FLOATNAME(LRotation) operator * (FLOATTYPE scalar) const; INLINE_LINMATH FLOATNAME(LRotation) operator / (FLOATTYPE scalar) const; diff --git a/panda/src/linmath/lvector3_src.h b/panda/src/linmath/lvector3_src.h index cb8b54c315..2217384573 100644 --- a/panda/src/linmath/lvector3_src.h +++ b/panda/src/linmath/lvector3_src.h @@ -24,7 +24,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase3) ©); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector3)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z); - INLINE_LINMATH FLOATNAME(LVector3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); + INLINE_LINMATH explicit FLOATNAME(LVector3)(const FLOATNAME(LVecBase2) ©, FLOATTYPE z); PY_EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const std::string &attr_name) const); PY_EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const std::string &attr_name, PyObject *assign)); diff --git a/panda/src/linmath/lvector4_src.h b/panda/src/linmath/lvector4_src.h index a022d438a0..fe0733ded3 100644 --- a/panda/src/linmath/lvector4_src.h +++ b/panda/src/linmath/lvector4_src.h @@ -20,7 +20,7 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase4) ©); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE fill_value); INLINE_LINMATH FLOATNAME(LVector4)(FLOATTYPE x, FLOATTYPE y, FLOATTYPE z, FLOATTYPE w); - INLINE_LINMATH FLOATNAME(LVector4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); + INLINE_LINMATH explicit FLOATNAME(LVector4)(const FLOATNAME(LVecBase3) ©, FLOATTYPE w); PY_EXTENSION(INLINE_LINMATH PyObject *__getattr__(PyObject *self, const std::string &attr_name) const); PY_EXTENSION(INLINE_LINMATH int __setattr__(PyObject *self, const std::string &attr_name, PyObject *assign)); diff --git a/panda/src/mathutil/boundingHexahedron.h b/panda/src/mathutil/boundingHexahedron.h index 8b899001d2..349e57e6db 100644 --- a/panda/src/mathutil/boundingHexahedron.h +++ b/panda/src/mathutil/boundingHexahedron.h @@ -34,12 +34,12 @@ public: INLINE_MATHUTIL BoundingHexahedron(); PUBLISHED: - BoundingHexahedron(const LFrustum &frustum, bool is_ortho, - CoordinateSystem cs = CS_default); - BoundingHexahedron(const LPoint3 &fll, const LPoint3 &flr, - const LPoint3 &fur, const LPoint3 &ful, - const LPoint3 &nll, const LPoint3 &nlr, - const LPoint3 &nur, const LPoint3 &nul); + explicit BoundingHexahedron(const LFrustum &frustum, bool is_ortho, + CoordinateSystem cs = CS_default); + explicit BoundingHexahedron(const LPoint3 &fll, const LPoint3 &flr, + const LPoint3 &fur, const LPoint3 &ful, + const LPoint3 &nll, const LPoint3 &nlr, + const LPoint3 &nur, const LPoint3 &nul); public: ALLOC_DELETED_CHAIN(BoundingHexahedron); diff --git a/panda/src/movies/movieVideo.h b/panda/src/movies/movieVideo.h index 1e7da6288e..5b2ae0b464 100644 --- a/panda/src/movies/movieVideo.h +++ b/panda/src/movies/movieVideo.h @@ -37,7 +37,7 @@ class BamReader; */ class EXPCL_PANDA_MOVIES MovieVideo : public TypedWritableReferenceCount, public Namable { PUBLISHED: - MovieVideo(const std::string &name = "Blank Video"); + explicit MovieVideo(const std::string &name = "Blank Video"); virtual ~MovieVideo(); virtual PT(MovieVideoCursor) open(); static PT(MovieVideo) get(const Filename &name); diff --git a/panda/src/movies/userDataAudio.h b/panda/src/movies/userDataAudio.h index b0b6e3bfbc..e0cddde842 100644 --- a/panda/src/movies/userDataAudio.h +++ b/panda/src/movies/userDataAudio.h @@ -31,7 +31,7 @@ class UserDataAudioCursor; class EXPCL_PANDA_MOVIES UserDataAudio : public MovieAudio { PUBLISHED: - UserDataAudio(int rate, int channels, bool remove_after_read=true); + explicit UserDataAudio(int rate, int channels, bool remove_after_read=true); virtual ~UserDataAudio(); virtual PT(MovieAudioCursor) open(); diff --git a/panda/src/ode/odeAMotorJoint.h b/panda/src/ode/odeAMotorJoint.h index c12b48524e..d6726cb5db 100644 --- a/panda/src/ode/odeAMotorJoint.h +++ b/panda/src/ode/odeAMotorJoint.h @@ -33,8 +33,8 @@ public: OdeAMotorJoint(dJointID id); PUBLISHED: - OdeAMotorJoint(OdeWorld &world); - OdeAMotorJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeAMotorJoint(OdeWorld &world); + explicit OdeAMotorJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeAMotorJoint(); INLINE void set_num_axes(int num); diff --git a/panda/src/ode/odeBallJoint.h b/panda/src/ode/odeBallJoint.h index 480a815531..979be8f3b5 100644 --- a/panda/src/ode/odeBallJoint.h +++ b/panda/src/ode/odeBallJoint.h @@ -33,8 +33,8 @@ public: OdeBallJoint(dJointID id); PUBLISHED: - OdeBallJoint(OdeWorld &world); - OdeBallJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeBallJoint(OdeWorld &world); + explicit OdeBallJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeBallJoint(); INLINE void set_anchor(dReal x, dReal y, dReal z); diff --git a/panda/src/ode/odeBody.h b/panda/src/ode/odeBody.h index 3861fdb393..a03ef3f039 100644 --- a/panda/src/ode/odeBody.h +++ b/panda/src/ode/odeBody.h @@ -38,7 +38,7 @@ public: OdeBody(dBodyID id); PUBLISHED: - OdeBody(OdeWorld &world); + explicit OdeBody(OdeWorld &world); virtual ~OdeBody(); void destroy(); INLINE bool is_empty() const; diff --git a/panda/src/ode/odeBoxGeom.h b/panda/src/ode/odeBoxGeom.h index eadf84e534..53f62b5496 100644 --- a/panda/src/ode/odeBoxGeom.h +++ b/panda/src/ode/odeBoxGeom.h @@ -32,8 +32,8 @@ public: PUBLISHED: OdeBoxGeom(dReal lx, dReal ly, dReal lz); - OdeBoxGeom(OdeSpace &space, dReal lx, dReal ly, dReal lz); - OdeBoxGeom(OdeSpace &space, const LVecBase3f &size); + explicit OdeBoxGeom(OdeSpace &space, dReal lx, dReal ly, dReal lz); + explicit OdeBoxGeom(OdeSpace &space, const LVecBase3f &size); virtual ~OdeBoxGeom(); INLINE void set_lengths(dReal lx, dReal ly, dReal lz); diff --git a/panda/src/ode/odeCappedCylinderGeom.h b/panda/src/ode/odeCappedCylinderGeom.h index f48385ef7e..58c4098131 100644 --- a/panda/src/ode/odeCappedCylinderGeom.h +++ b/panda/src/ode/odeCappedCylinderGeom.h @@ -31,8 +31,8 @@ public: OdeCappedCylinderGeom(dGeomID id); PUBLISHED: - OdeCappedCylinderGeom(dReal radius, dReal length); - OdeCappedCylinderGeom(OdeSpace &space, dReal radius, dReal length); + explicit OdeCappedCylinderGeom(dReal radius, dReal length); + explicit OdeCappedCylinderGeom(OdeSpace &space, dReal radius, dReal length); virtual ~OdeCappedCylinderGeom(); INLINE void set_params(dReal radius, dReal length); diff --git a/panda/src/ode/odeContactJoint.h b/panda/src/ode/odeContactJoint.h index e31abb12ac..1f62f59a14 100644 --- a/panda/src/ode/odeContactJoint.h +++ b/panda/src/ode/odeContactJoint.h @@ -34,8 +34,8 @@ public: OdeContactJoint(dJointID id); PUBLISHED: - OdeContactJoint(OdeWorld &world, const OdeContact &contact); - OdeContactJoint(OdeWorld &world, OdeJointGroup &joint_group, const OdeContact &contact); + explicit OdeContactJoint(OdeWorld &world, const OdeContact &contact); + explicit OdeContactJoint(OdeWorld &world, OdeJointGroup &joint_group, const OdeContact &contact); virtual ~OdeContactJoint(); public: diff --git a/panda/src/ode/odeCylinderGeom.h b/panda/src/ode/odeCylinderGeom.h index 3c23a02336..bd5f9deae4 100644 --- a/panda/src/ode/odeCylinderGeom.h +++ b/panda/src/ode/odeCylinderGeom.h @@ -31,8 +31,8 @@ public: OdeCylinderGeom(dGeomID id); PUBLISHED: - OdeCylinderGeom(dReal radius, dReal length); - OdeCylinderGeom(OdeSpace &space, dReal radius, dReal length); + explicit OdeCylinderGeom(dReal radius, dReal length); + explicit OdeCylinderGeom(OdeSpace &space, dReal radius, dReal length); virtual ~OdeCylinderGeom(); INLINE void set_params(dReal radius, dReal length); diff --git a/panda/src/ode/odeFixedJoint.h b/panda/src/ode/odeFixedJoint.h index de4f8a90da..c48b57fdaf 100644 --- a/panda/src/ode/odeFixedJoint.h +++ b/panda/src/ode/odeFixedJoint.h @@ -33,8 +33,8 @@ public: OdeFixedJoint(dJointID id); PUBLISHED: - OdeFixedJoint(OdeWorld &world); - OdeFixedJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeFixedJoint(OdeWorld &world); + explicit OdeFixedJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeFixedJoint(); INLINE void set(); diff --git a/panda/src/ode/odeHinge2Joint.h b/panda/src/ode/odeHinge2Joint.h index 96606f9292..74388a93fb 100644 --- a/panda/src/ode/odeHinge2Joint.h +++ b/panda/src/ode/odeHinge2Joint.h @@ -32,8 +32,8 @@ public: OdeHinge2Joint(dJointID id); PUBLISHED: - OdeHinge2Joint(OdeWorld &world, OdeJointGroup &joint_group); - OdeHinge2Joint(OdeWorld &world); + explicit OdeHinge2Joint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeHinge2Joint(OdeWorld &world); virtual ~OdeHinge2Joint(); INLINE void set_anchor(dReal x, dReal y, dReal z); diff --git a/panda/src/ode/odeHingeJoint.h b/panda/src/ode/odeHingeJoint.h index 3c3c02b039..1799c34f80 100644 --- a/panda/src/ode/odeHingeJoint.h +++ b/panda/src/ode/odeHingeJoint.h @@ -32,8 +32,8 @@ public: OdeHingeJoint(dJointID id); PUBLISHED: - OdeHingeJoint(OdeWorld &world); - OdeHingeJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeHingeJoint(OdeWorld &world); + explicit OdeHingeJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeHingeJoint(); INLINE void set_anchor(dReal x, dReal y, dReal z); diff --git a/panda/src/ode/odeLMotorJoint.h b/panda/src/ode/odeLMotorJoint.h index d79d20d34d..ea1065dba2 100644 --- a/panda/src/ode/odeLMotorJoint.h +++ b/panda/src/ode/odeLMotorJoint.h @@ -32,8 +32,8 @@ public: OdeLMotorJoint(dJointID id); PUBLISHED: - OdeLMotorJoint(OdeWorld &world); - OdeLMotorJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeLMotorJoint(OdeWorld &world); + explicit OdeLMotorJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeLMotorJoint(); INLINE void set_num_axes(int num); diff --git a/panda/src/ode/odeNullJoint.h b/panda/src/ode/odeNullJoint.h index 1dbbf030c3..5ea67dcf80 100644 --- a/panda/src/ode/odeNullJoint.h +++ b/panda/src/ode/odeNullJoint.h @@ -33,8 +33,8 @@ public: OdeNullJoint(dJointID id); PUBLISHED: - OdeNullJoint(OdeWorld &world); - OdeNullJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeNullJoint(OdeWorld &world); + explicit OdeNullJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeNullJoint(); public: diff --git a/panda/src/ode/odePlane2dJoint.h b/panda/src/ode/odePlane2dJoint.h index a1b36588b3..0ce51ee9a4 100644 --- a/panda/src/ode/odePlane2dJoint.h +++ b/panda/src/ode/odePlane2dJoint.h @@ -32,8 +32,8 @@ public: OdePlane2dJoint(dJointID id); PUBLISHED: - OdePlane2dJoint(OdeWorld &world); - OdePlane2dJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdePlane2dJoint(OdeWorld &world); + explicit OdePlane2dJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdePlane2dJoint(); INLINE void set_x_param(int parameter, dReal value); diff --git a/panda/src/ode/odePlaneGeom.h b/panda/src/ode/odePlaneGeom.h index 9a3da02258..110e75d25b 100644 --- a/panda/src/ode/odePlaneGeom.h +++ b/panda/src/ode/odePlaneGeom.h @@ -32,8 +32,8 @@ public: PUBLISHED: OdePlaneGeom(dReal a, dReal b, dReal c, dReal d); OdePlaneGeom(const LVecBase4f ¶ms); - OdePlaneGeom(OdeSpace &space, dReal a, dReal b, dReal c, dReal d); - OdePlaneGeom(OdeSpace &space, const LVecBase4f ¶ms); + explicit OdePlaneGeom(OdeSpace &space, dReal a, dReal b, dReal c, dReal d); + explicit OdePlaneGeom(OdeSpace &space, const LVecBase4f ¶ms); virtual ~OdePlaneGeom(); INLINE void set_params(dReal a, dReal b, dReal c, dReal d); diff --git a/panda/src/ode/odeQuadTreeSpace.h b/panda/src/ode/odeQuadTreeSpace.h index d88e8a832b..973f1fa8fc 100644 --- a/panda/src/ode/odeQuadTreeSpace.h +++ b/panda/src/ode/odeQuadTreeSpace.h @@ -32,13 +32,13 @@ public: OdeQuadTreeSpace(dSpaceID id); PUBLISHED: - OdeQuadTreeSpace(const LPoint3f ¢er, - const LVecBase3f &extents, - const int depth); - OdeQuadTreeSpace(OdeSpace &space, - const LPoint3f ¢er, - const LVecBase3f &extents, - const int depth); + explicit OdeQuadTreeSpace(const LPoint3f ¢er, + const LVecBase3f &extents, + const int depth); + explicit OdeQuadTreeSpace(OdeSpace &space, + const LPoint3f ¢er, + const LVecBase3f &extents, + const int depth); virtual ~OdeQuadTreeSpace(); public: diff --git a/panda/src/ode/odeRayGeom.h b/panda/src/ode/odeRayGeom.h index 9f366320a7..712f0e8440 100644 --- a/panda/src/ode/odeRayGeom.h +++ b/panda/src/ode/odeRayGeom.h @@ -31,7 +31,7 @@ public: PUBLISHED: OdeRayGeom(dReal length); - OdeRayGeom(OdeSpace &space, dReal length); + explicit OdeRayGeom(OdeSpace &space, dReal length); virtual ~OdeRayGeom(); INLINE void set_length(dReal length); diff --git a/panda/src/ode/odeSliderJoint.h b/panda/src/ode/odeSliderJoint.h index 981ec33a80..fbf335cb5f 100644 --- a/panda/src/ode/odeSliderJoint.h +++ b/panda/src/ode/odeSliderJoint.h @@ -32,8 +32,8 @@ public: OdeSliderJoint(dJointID id); PUBLISHED: - OdeSliderJoint(OdeWorld &world); - OdeSliderJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeSliderJoint(OdeWorld &world); + explicit OdeSliderJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeSliderJoint(); INLINE void set_axis(dReal x, dReal y, dReal z); diff --git a/panda/src/ode/odeSphereGeom.h b/panda/src/ode/odeSphereGeom.h index 33ee3a8e3f..f17d6c476e 100644 --- a/panda/src/ode/odeSphereGeom.h +++ b/panda/src/ode/odeSphereGeom.h @@ -31,7 +31,7 @@ public: PUBLISHED: OdeSphereGeom(dReal radius); - OdeSphereGeom(OdeSpace &space, dReal radius); + explicit OdeSphereGeom(OdeSpace &space, dReal radius); OdeSphereGeom(OdeGeom &geom); virtual ~OdeSphereGeom(); diff --git a/panda/src/ode/odeUniversalJoint.h b/panda/src/ode/odeUniversalJoint.h index 00d2cd6c2a..a8ec774b7f 100644 --- a/panda/src/ode/odeUniversalJoint.h +++ b/panda/src/ode/odeUniversalJoint.h @@ -34,8 +34,8 @@ public: OdeUniversalJoint(dJointID id); PUBLISHED: - OdeUniversalJoint(OdeWorld &world); - OdeUniversalJoint(OdeWorld &world, OdeJointGroup &joint_group); + explicit OdeUniversalJoint(OdeWorld &world); + explicit OdeUniversalJoint(OdeWorld &world, OdeJointGroup &joint_group); virtual ~OdeUniversalJoint(); INLINE void set_anchor(dReal x, dReal y, dReal z); diff --git a/panda/src/pgraphnodes/spotlight.h b/panda/src/pgraphnodes/spotlight.h index a529f1479e..b548b92e8b 100644 --- a/panda/src/pgraphnodes/spotlight.h +++ b/panda/src/pgraphnodes/spotlight.h @@ -31,7 +31,7 @@ */ class EXPCL_PANDA_PGRAPHNODES Spotlight : public LightLensNode { PUBLISHED: - Spotlight(const std::string &name); + explicit Spotlight(const std::string &name); protected: Spotlight(const Spotlight ©); diff --git a/panda/src/physics/angularEulerIntegrator.cxx b/panda/src/physics/angularEulerIntegrator.cxx index 642c2c6b8b..daf9a7ce69 100644 --- a/panda/src/physics/angularEulerIntegrator.cxx +++ b/panda/src/physics/angularEulerIntegrator.cxx @@ -103,7 +103,7 @@ child_integrate(Physical *physical, // apply the accumulated torque vector to the object's inertial tensor. // this matrix represents how much force the object 'wants' applied to it // in any direction, among other things. - accum_quat = current_object->get_inertial_tensor() * accum_quat; + accum_quat = LRotation(current_object->get_inertial_tensor()) * accum_quat; // derive this into the angular velocity vector. LRotation rot_quat = current_object->get_rotation(); diff --git a/panda/src/pnmimage/pnmImageHeader.h b/panda/src/pnmimage/pnmImageHeader.h index 6e21ddca98..ce2a624aa5 100644 --- a/panda/src/pnmimage/pnmImageHeader.h +++ b/panda/src/pnmimage/pnmImageHeader.h @@ -118,12 +118,12 @@ PUBLISHED: INLINE PixelSpec() = default; PUBLISHED: - INLINE PixelSpec(xelval gray_value); - INLINE PixelSpec(xelval gray_value, xelval alpha); + INLINE explicit PixelSpec(xelval gray_value); + INLINE explicit PixelSpec(xelval gray_value, xelval alpha); INLINE PixelSpec(xelval red, xelval green, xelval blue); INLINE PixelSpec(xelval red, xelval green, xelval blue, xelval alpha); INLINE PixelSpec(const xel &rgb); - INLINE PixelSpec(const xel &rgb, xelval alpha); + INLINE explicit PixelSpec(const xel &rgb, xelval alpha); INLINE bool operator < (const PixelSpec &other) const; INLINE bool operator == (const PixelSpec &other) const; diff --git a/panda/src/text/dynamicTextFont.h b/panda/src/text/dynamicTextFont.h index d2643cffb1..0b0eedf719 100644 --- a/panda/src/text/dynamicTextFont.h +++ b/panda/src/text/dynamicTextFont.h @@ -41,7 +41,7 @@ typedef struct hb_font_t hb_font_t; class EXPCL_PANDA_TEXT DynamicTextFont : public TextFont, public FreetypeFont { PUBLISHED: DynamicTextFont(const Filename &font_filename, int face_index = 0); - DynamicTextFont(const char *font_data, int data_length, int face_index); + explicit DynamicTextFont(const char *font_data, int data_length, int face_index); DynamicTextFont(const DynamicTextFont ©); virtual ~DynamicTextFont();