Merge pull request #560 from asmaloney/fixes/init_cleanup

Fix inits and a couple of empty checks
pull/563/head
Kim Kulling 2015-05-18 09:49:59 +02:00
commit 7cd8cc1b1f
7 changed files with 42 additions and 17 deletions

View File

@ -480,7 +480,9 @@ namespace Assimp
struct Assimp::BatchData
{
BatchData()
: next_id(0xffff)
: pIOSystem()
, pImporter()
, next_id(0xffff)
{}
// IO system to be used for all imports

View File

@ -145,7 +145,10 @@ protected:
{
bool exist;
float value;
Property() { exist = false; }
Property()
: exist(false)
, value(0.0f)
{}
};
// summarize a material in an convinient way.

View File

@ -47,7 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <map>
#include <vector>
#include <stdint.h>
#include "../include/assimp/types.h"
#include "../include/assimp/light.h"
#include "../include/assimp/mesh.h"
#include "../include/assimp/material.h"
@ -134,7 +134,8 @@ struct Camera
struct Light
{
Light()
: mAttConstant (1.f)
: mType (aiLightSource_UNDEFINED)
, mAttConstant (1.f)
, mAttLinear (0.f)
, mAttQuadratic (0.f)
, mFalloffAngle (180.f)
@ -172,13 +173,14 @@ struct Light
struct InputSemanticMapEntry
{
InputSemanticMapEntry()
: mSet (0)
: mSet(0)
, mType(IT_Invalid)
{}
//! Index of set, optional
unsigned int mSet;
//! Name of referenced vertex input
//! Type of referenced vertex input
InputType mType;
};
@ -609,7 +611,15 @@ struct ChannelEntry
const Collada::Accessor* mValueAccessor; ///> Collada accessor to the key value values
const Collada::Data* mValueData; ///> Source datat array for the key value values
ChannelEntry() { mChannel = NULL; mSubElement = 0; }
ChannelEntry()
: mChannel()
, mTransformIndex()
, mSubElement()
, mTimeAccessor()
, mTimeData()
, mValueAccessor()
, mValueData()
{}
};
} // end of namespace Collada

View File

@ -81,7 +81,10 @@ static const aiImporterDesc desc = {
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
ColladaLoader::ColladaLoader()
: noSkeletonMesh(), ignoreUpDirection(false), mNodeNameCounter()
: noSkeletonMesh()
, ignoreUpDirection(false)
, invertTransparency(false)
, mNodeNameCounter()
{}
// ------------------------------------------------------------------------------------------------

View File

@ -58,6 +58,7 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
FindInvalidDataProcess::FindInvalidDataProcess()
: configEpsilon(0.0f)
{
// nothing to do here
}

View File

@ -71,6 +71,10 @@ using namespace Assimp;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
OptimizeGraphProcess::OptimizeGraphProcess()
: mScene()
, nodes_in()
, nodes_out()
, count_merged()
{}
// ------------------------------------------------------------------------------------------------
@ -122,7 +126,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& no
++it;
}
if (nd->mNumMeshes || child_nodes.size()) {
if (nd->mNumMeshes || !child_nodes.empty()) {
nodes.push_back(nd);
}
else {
@ -172,7 +176,7 @@ void OptimizeGraphProcess::CollectNewChildren(aiNode* nd, std::list<aiNode*>& no
}
++it;
}
if (join_master && join.size()) {
if (join_master && !join.empty()) {
join_master->mName.length = sprintf(join_master->mName.data,"$MergedNode_%i",count_merged++);
unsigned int out_meshes = 0;

View File

@ -60,9 +60,11 @@ static const unsigned int DeadBeef = 0xdeadbeef;
// ------------------------------------------------------------------------------------------------
// Constructor to be privately used by Importer
OptimizeMeshesProcess::OptimizeMeshesProcess()
: pts (false)
, max_verts( NotSet )
, max_faces( NotSet ) {
: mScene()
, mesh()
, pts(false)
, max_verts( NotSet )
, max_faces( NotSet ) {
// empty
}