Skip to content

Commit

Permalink
Try to correct some errors from new compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jun 28, 2017
1 parent 6059df5 commit 73840e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions io/GeotiffSupport.cpp
Expand Up @@ -99,21 +99,22 @@ GeotiffSrs::GeotiffSrs(const std::vector<uint8_t>& directoryRec,
};
#pragma pack(pop)

ShortKeyHeader *header = (ShortKeyHeader *)directoryRec.data();
const ShortKeyHeader *header = (ShortKeyHeader *)directoryRec.data();
size_t declaredSize = (header->numKeys + 1) * 4;
if (directoryRec.size() < declaredSize)
return;
ST_SetKey(ctx.tiff, GEOTIFF_DIRECTORY_RECORD_ID,
(1 + header->numKeys) * 4, STT_SHORT, (void *)directoryRec.data());
(1 + header->numKeys) * 4, STT_SHORT,
(const void *)directoryRec.data());

if (doublesRec.size())
ST_SetKey(ctx.tiff, GEOTIFF_DOUBLES_RECORD_ID,
doublesRec.size() / sizeof(double), STT_DOUBLE,
(void *)doublesRec.data());
(const void *)doublesRec.data());

if (asciiRec.size())
ST_SetKey(ctx.tiff, GEOTIFF_ASCII_RECORD_ID,
asciiRec.size(), STT_ASCII, (void *)asciiRec.data());
asciiRec.size(), STT_ASCII, (const void *)asciiRec.data());

ctx.gtiff = GTIFNewSimpleTags(ctx.tiff);

Expand Down
2 changes: 1 addition & 1 deletion vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl
Expand Up @@ -1087,7 +1087,7 @@ int Octree< Real >::_addIsoPolygons( Kazhdan::Mesh& mesh , std::vector< std::pai
if( addBarycenter )
for( int i=0 ; i<(int)polygon.size() ; i++ )
for( int j=0 ; j<i ; j++ )
if( (i+1)%polygon.size()!=j && (j+1)%polygon.size()!=i )
if( (i+1)%(int)polygon.size()!=j && (j+1)%(int)polygon.size()!=i )
{
Vertex v1 = polygon[i].second , v2 = polygon[j].second;
for( int k=0 ; k<3 ; k++ ) if( v1.point[k]==v2.point[k] ) isCoplanar = true;
Expand Down
2 changes: 1 addition & 1 deletion vendor/kazhdan/MultiGridOctreeData.inl
Expand Up @@ -425,7 +425,7 @@ SparseNodeData< ProjectiveData< Data , Real > > Octree< Real >::setDataField( co
const ProjectiveData< Data , Real >& data = sampleData[i];
Point3D< Real > p = sample.weight==0 ? sample.data.p : sample.data.p / sample.weight;
if( !_InBounds(p) ){ fprintf( stderr , "[WARNING] Point is out of bounds: %f %f %f <- %f %f %f [%f]\n" , p[0] , p[1] , p[2] , sample.data.p[0] , sample.data.p[1] , sample.data.p[2] , sample.weight ) ; continue; }
_multiSplatPointData< CreateNodes >( density , (TreeOctNode*)samples[i].node , p , data , dataField , densityKey , dataKey , 2 );
_multiSplatPointData< CreateNodes >( density , const_cast<TreeOctNode*>(samples[i].node), p , data , dataField , densityKey , dataKey , 2 );
}
memoryUsage();
return dataField;
Expand Down
10 changes: 5 additions & 5 deletions vendor/kazhdan/Octree.h
Expand Up @@ -8,14 +8,14 @@ are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer. Redistributions in binary form must reproduce
the above copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the distribution.
in the documentation and/or other materials provided with the distribution.
Neither the name of the Johns Hopkins University nor the names of its contributors
may be used to endorse or promote products derived from this software without specific
prior written permission.
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
Expand Down Expand Up @@ -67,7 +67,7 @@ class OctNode
~OctNode( void );
int initChildren( void (*Initializer)( OctNode& )=NULL );

void depthAndOffset( int& depth , int offset[DIMENSION] ) const;
void depthAndOffset( int& depth , int offset[DIMENSION] ) const;
void centerIndex( int index[DIMENSION] ) const;
int depth( void ) const;
static inline void DepthAndOffset( const long long& index , int& depth , int offset[DIMENSION] );
Expand Down Expand Up @@ -149,7 +149,7 @@ class OctNode
template< bool CreateNodes , unsigned int _LeftRadius , unsigned int _RightRadius > void getNeighbors( OctNode* node , Neighbors< _LeftRadius + _RightRadius + 1 >& neighbors , void (*Initializer)( OctNode& )=NULL );
template< bool CreateNodes > bool getChildNeighbors( int cIdx , int d , Neighbors< Width >& childNeighbors , void (*Initializer)( OctNode& )=NULL ) const;
template< bool CreateNodes , class Real > bool getChildNeighbors( Point3D< Real > p , int d , Neighbors< Width >& childNeighbors , void (*Initializer)( OctNode& )=NULL ) const;
typename OctNode< NodeData >::template Neighbors< LeftRadius+RightRadius+1 >& getNeighbors( const OctNode* node ) { return getNeighbors< false >( (OctNode*)node , NULL ); }
typename OctNode< NodeData >::template Neighbors< LeftRadius+RightRadius+1 >& getNeighbors( const OctNode* node ) { return getNeighbors< false >( const_cast<OctNode*>(node), NULL ); }
template< unsigned int _LeftRadius , unsigned int _RightRadius > void getNeighbors( const OctNode* node , Neighbors< _LeftRadius + _RightRadius + 1 >& neighbors ){ return getNeighbors< false , _LeftRadius , _RightRadius >( (OctNode*)node , NULL ); }
bool getChildNeighbors( int cIdx , int d , Neighbors< Width >& childNeighbors ) const { return getChildNeighbors< false >( cIdx , d , childNeighbors , NULL ); }
template< class Real > bool getChildNeighbors( Point3D< Real > p , int d , Neighbors< Width >& childNeighbors ) const { return getChildNeighbors< false , Real >( p , d , childNeighbors , NULL ); }
Expand Down

0 comments on commit 73840e2

Please sign in to comment.