stl const correctness

This commit is contained in:
alemuntoni 2021-03-18 18:30:54 +01:00
parent 0a2ed11ac2
commit 3d0e74e472
2 changed files with 7 additions and 7 deletions

View File

@ -259,8 +259,8 @@ inline static Color4 ColorRamp(const float &minf,const float &maxf ,float v )
return rc;
}
inline static unsigned short ToUnsignedB5G5R5(Color4 &) { return 0;}
inline static unsigned short ToUnsignedR5G5B5(Color4 &) { return 0;}
inline static unsigned short ToUnsignedB5G5R5(const Color4 &) { return 0;}
inline static unsigned short ToUnsignedR5G5B5(const Color4 &) { return 0;}
inline static Color4 FromUnsignedB5G5R5(unsigned short)
{
@ -420,7 +420,7 @@ typedef Color4<double> Color4d;
template<>
inline unsigned short Color4<unsigned char>::ToUnsignedB5G5R5(Color4<unsigned char> &cc)
inline unsigned short Color4<unsigned char>::ToUnsignedB5G5R5(const Color4<unsigned char> &cc)
{
unsigned short r = cc[0]/8;
unsigned short g = cc[1]/8;
@ -430,7 +430,7 @@ inline unsigned short Color4<unsigned char>::ToUnsignedB5G5R5(Color4<unsigned ch
}
template<>
inline unsigned short Color4<unsigned char>::ToUnsignedR5G5B5(Color4<unsigned char> &cc)
inline unsigned short Color4<unsigned char>::ToUnsignedR5G5B5(const Color4<unsigned char> &cc)
{
unsigned short r = cc[0]/8;
unsigned short g = cc[1]/8;

View File

@ -75,14 +75,14 @@ public:
typedef typename SaveMeshType::FaceType FaceType;
typedef unsigned short CallBackSTLFaceAttribute(const SaveMeshType &m, const FaceType &f);
static int Save(SaveMeshType &m, const char * filename, const int &mask, CallBackPos *)
static int Save(const SaveMeshType &m, const char * filename, const int &mask, CallBackPos *)
{
return Save(m,filename,true,mask);
}
static int Save(SaveMeshType &m, const char * filename , bool binary =true, int mask=0, const char *objectname=0, bool magicsMode=0)
static int Save(const SaveMeshType &m, const char * filename , bool binary =true, int mask=0, const char *objectname=0, bool magicsMode=0)
{
typedef typename SaveMeshType::FaceIterator FaceIterator;
typedef typename SaveMeshType::ConstFaceIterator FaceIterator;
FILE *fp;
fp = fopen(filename,"wb");