fix some compile warnings:

- passing NULL to non-pointer
- unused vars
- unused function
- order of init
- parentheses
pull/332/head
abma 2014-08-17 23:28:00 +02:00
parent aafc8d5f3f
commit 56ddb4f4af
8 changed files with 34 additions and 30 deletions

View File

@ -147,7 +147,7 @@ namespace {
void ExportScene3DS(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene)
{
boost::shared_ptr<IOStream> outfile (pIOSystem->Open(pFile, "wb"));
if(outfile == NULL) {
if(!outfile) {
throw DeadlyExportError("Could not open output .3ds file: " + std::string(pFile));
}

View File

@ -728,7 +728,7 @@ inline size_t WriteArray(IOStream * stream, const T* in, unsigned int size)
// is compressed using standard DEFLATE from zlib.
if (compressed)
{
AssbinChunkWriter uncompressedStream( NULL, NULL );
AssbinChunkWriter uncompressedStream( NULL, 0 );
WriteBinaryScene( &uncompressedStream, pScene );
uLongf uncompressedSize = uncompressedStream.Tell();

View File

@ -195,7 +195,7 @@ template <typename T> void ReadBounds( IOStream * stream, T* p, unsigned int n )
void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODE);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
*node = new aiNode();
@ -226,7 +226,7 @@ void AssbinImporter::ReadBinaryNode( IOStream * stream, aiNode** node )
void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIBONE );
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
b->mName = Read<aiString>(stream);
b->mNumWeights = Read<unsigned int>(stream);
@ -249,7 +249,7 @@ void AssbinImporter::ReadBinaryBone( IOStream * stream, aiBone* b )
void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMESH);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
mesh->mPrimitiveTypes = Read<unsigned int>(stream);
mesh->mNumVertices = Read<unsigned int>(stream);
@ -373,7 +373,7 @@ void AssbinImporter::ReadBinaryMesh( IOStream * stream, aiMesh* mesh )
void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialProperty* prop)
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIALPROPERTY);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
prop->mKey = Read<aiString>(stream);
prop->mSemantic = Read<unsigned int>(stream);
@ -389,7 +389,7 @@ void AssbinImporter::ReadBinaryMaterialProperty(IOStream * stream, aiMaterialPro
void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIMATERIAL);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
mat->mNumAllocated = mat->mNumProperties = Read<unsigned int>(stream);
if (mat->mNumProperties)
@ -410,7 +410,7 @@ void AssbinImporter::ReadBinaryMaterial(IOStream * stream, aiMaterial* mat)
void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AINODEANIM);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
nd->mNodeName = Read<aiString>(stream);
nd->mNumPositionKeys = Read<unsigned int>(stream);
@ -458,7 +458,7 @@ void AssbinImporter::ReadBinaryNodeAnim(IOStream * stream, aiNodeAnim* nd)
void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AIANIMATION);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
anim->mName = Read<aiString> (stream);
anim->mDuration = Read<double> (stream);
@ -478,7 +478,7 @@ void AssbinImporter::ReadBinaryAnim( IOStream * stream, aiAnimation* anim )
void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AITEXTURE);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
tex->mWidth = Read<unsigned int>(stream);
tex->mHeight = Read<unsigned int>(stream);
@ -501,7 +501,7 @@ void AssbinImporter::ReadBinaryTexture(IOStream * stream, aiTexture* tex)
void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AILIGHT);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
l->mName = Read<aiString>(stream);
l->mType = (aiLightSourceType)Read<unsigned int>(stream);
@ -527,7 +527,7 @@ void AssbinImporter::ReadBinaryLight( IOStream * stream, aiLight* l )
void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AICAMERA);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
cam->mName = Read<aiString>(stream);
cam->mPosition = Read<aiVector3D>(stream);
@ -542,7 +542,7 @@ void AssbinImporter::ReadBinaryCamera( IOStream * stream, aiCamera* cam )
void AssbinImporter::ReadBinaryScene( IOStream * stream, aiScene* scene )
{
ai_assert( Read<uint32_t>(stream) == ASSBIN_CHUNK_AISCENE);
uint32_t size = Read<uint32_t>(stream);
/*uint32_t size =*/ Read<uint32_t>(stream);
scene->mFlags = Read<unsigned int>(stream);
scene->mNumMeshes = Read<unsigned int>(stream);
@ -626,10 +626,10 @@ void AssbinImporter::InternReadFile( const std::string& pFile, aiScene* pScene,
stream->Seek( 44, aiOrigin_CUR ); // signature
unsigned int versionMajor = Read<unsigned int>(stream);
unsigned int versionMinor = Read<unsigned int>(stream);
unsigned int versionRevision = Read<unsigned int>(stream);
unsigned int compileFlags = Read<unsigned int>(stream);
/*unsigned int versionMajor =*/ Read<unsigned int>(stream);
/*unsigned int versionMinor =*/ Read<unsigned int>(stream);
/*unsigned int versionRevision =*/ Read<unsigned int>(stream);
/*unsigned int compileFlags =*/ Read<unsigned int>(stream);
shortened = Read<uint16_t>(stream) > 0;
compressed = Read<uint16_t>(stream) > 0;

View File

@ -120,7 +120,7 @@ Exporter::ExportFormatEntry gExporters[] =
#endif
#ifndef ASSIMP_BUILD_NO_ASSBIN_EXPORTER
Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, NULL),
Exporter::ExportFormatEntry( "assbin", "Assimp Binary", "assbin" , &ExportSceneAssbin, 0),
#endif
};

View File

@ -93,7 +93,7 @@ namespace {
}
// ------------------------------------------------------------------------------------------------
void ParseWarning(const std::string& message, const Element* element = NULL)
/* void ParseWarning(const std::string& message, const Element* element = NULL)
{
if(element) {
ParseWarning(message,element->KeyToken());
@ -103,7 +103,7 @@ namespace {
DefaultLogger::get()->warn("FBX-Parser: " + message);
}
}
*/
// ------------------------------------------------------------------------------------------------
void ParseError(const std::string& message, TokenPtr token)
{

View File

@ -404,9 +404,9 @@ size_t IndexData::FaceSize() const
// Mesh
Mesh::Mesh() :
sharedVertexData(0),
skeleton(0),
hasSkeletalAnimations(false)
hasSkeletalAnimations(false),
skeleton(NULL),
sharedVertexData(NULL)
{
}
@ -712,8 +712,8 @@ aiMesh *SubMesh::ConvertToAssimpMesh(Mesh *parent)
// MeshXml
MeshXml::MeshXml() :
sharedVertexData(0),
skeleton(0)
skeleton(0),
sharedVertexData(0)
{
}
@ -797,8 +797,8 @@ void MeshXml::ConvertToAssimpScene(aiScene* dest)
// SubMeshXml
SubMeshXml::SubMeshXml() :
vertexData(0),
indexData(new IndexDataXml())
indexData(new IndexDataXml()),
vertexData(0)
{
}
@ -912,8 +912,8 @@ aiMesh *SubMeshXml::ConvertToAssimpMesh(MeshXml *parent)
// Animation
Animation::Animation(Skeleton *parent) :
parentMesh(NULL),
parentSkeleton(parent),
parentMesh(0),
length(0.0f),
baseTime(-1.0f)
{
@ -1124,8 +1124,8 @@ aiBone *Bone::ConvertToAssimpBone(Skeleton *parent, const std::vector<aiVertexWe
// VertexAnimationTrack
VertexAnimationTrack::VertexAnimationTrack() :
target(0),
type(VAT_NONE)
type(VAT_NONE),
target(0)
{
}

View File

@ -73,11 +73,13 @@ static const aiImporterDesc desc = {
namespace Assimp {
/*
static void getSupportedExtensions(std::vector<std::string> &supportedExtensions) {
supportedExtensions.push_back( ".jpg" );
supportedExtensions.push_back( ".png" );
supportedExtensions.push_back( ".tga" );
}
*/
using namespace Q3BSP;

View File

@ -2124,11 +2124,13 @@ void Clipper::AddOutPt(TEdge *e, const IntPoint &pt)
{
//check for 'rounding' artefacts ...
if (outRec->sides == esNeither && pt.Y == op->pt.Y)
{
if (ToFront)
{
if (pt.X == op->pt.X +1) return; //ie wrong side of bottomPt
}
else if (pt.X == op->pt.X -1) return; //ie wrong side of bottomPt
}
outRec->sides = (EdgeSide)(outRec->sides | e->side);
if (outRec->sides == esBoth)