From 73840e2ff0c8004b3ce8d52a3c15833f20b65c8c Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Wed, 28 Jun 2017 11:05:54 -0400 Subject: [PATCH] Try to correct some errors from new compiler. --- io/GeotiffSupport.cpp | 9 +++++---- vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl | 2 +- vendor/kazhdan/MultiGridOctreeData.inl | 2 +- vendor/kazhdan/Octree.h | 10 +++++----- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/io/GeotiffSupport.cpp b/io/GeotiffSupport.cpp index bf117d3828..42029ae99f 100644 --- a/io/GeotiffSupport.cpp +++ b/io/GeotiffSupport.cpp @@ -99,21 +99,22 @@ GeotiffSrs::GeotiffSrs(const std::vector& 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); diff --git a/vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl b/vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl index 1abc7c77e8..81b32b8ab2 100644 --- a/vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl +++ b/vendor/kazhdan/MultiGridOctreeData.IsoSurface.inl @@ -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 > 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(samples[i].node), p , data , dataField , densityKey , dataKey , 2 ); } memoryUsage(); return dataField; diff --git a/vendor/kazhdan/Octree.h b/vendor/kazhdan/Octree.h index 837339655e..31b4d69740 100644 --- a/vendor/kazhdan/Octree.h +++ b/vendor/kazhdan/Octree.h @@ -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 @@ -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] ); @@ -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(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 ); }