File OpenSceneGraph-1.2-type-qualifiers.patch of Package OpenSceneGraph1
Index: OpenSceneGraph-1.2/OpenSceneGraph/examples/osgcluster/osgcluster.cpp
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/examples/osgcluster/osgcluster.cpp
+++ OpenSceneGraph-1.2/OpenSceneGraph/examples/osgcluster/osgcluster.cpp
@@ -52,7 +52,7 @@ class CameraPacket {
void writeEventQueue(osgProducer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
- const bool getMasterKilled() const { return _masterKilled; }
+ const bool& getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;
Index: OpenSceneGraph-1.2/OpenSceneGraph/include/osg/Uniform
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/include/osg/Uniform
+++ OpenSceneGraph-1.2/OpenSceneGraph/include/osg/Uniform
@@ -182,7 +182,7 @@ class OSG_EXPORT Uniform : public Object
bool setType( Type t );
/** Get the type of glUniform as enum. */
- const Type getType() const { return _type; }
+ const Type& getType() const { return _type; }
/** Set the name of the glUniform, ensuring it is only set once.*/
void setName( const std::string& name );
Index: OpenSceneGraph-1.2/OpenSceneGraph/include/osgParticle/Particle
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/include/osgParticle/Particle
+++ OpenSceneGraph-1.2/OpenSceneGraph/include/osgParticle/Particle
@@ -141,7 +141,7 @@ namespace osgParticle
inline float getCurrentAlpha() const { return _current_alpha; }
/// Get the s texture coordinate of the bottom left of the particle
- inline const float getSTexCoord() const { return _s_coord; }
+ inline const float& getSTexCoord() const { return _s_coord; }
/// Get the t texture coordinate of the bottom left of the particle
inline float getTCoord() const { return _t_coord; }
Index: OpenSceneGraph-1.2/OpenSceneGraph/include/osgSim/DOFTransform
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/include/osgSim/DOFTransform
+++ OpenSceneGraph-1.2/OpenSceneGraph/include/osgSim/DOFTransform
@@ -101,7 +101,7 @@ class OSGSIM_EXPORT DOFTransform : publi
};
void setHPRMultOrder(const MultOrder order) {_multOrder = order;}
- inline const MultOrder getHPRMultOrder() const { return _multOrder;}
+ inline const MultOrder& getHPRMultOrder() const { return _multOrder;}
inline void setAnimationOn(bool do_animate) {_animationOn = do_animate;}
inline bool getAnimationOn() const {return _animationOn;}
Index: OpenSceneGraph-1.2/OpenSceneGraph/include/osgUtil/Tesselator
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/include/osgUtil/Tesselator
+++ OpenSceneGraph-1.2/OpenSceneGraph/include/osgUtil/Tesselator
@@ -60,15 +60,15 @@ class OSGUTIL_EXPORT Tesselator : public
/** Set and get tesselation request boundary only on/off */
void setBoundaryOnly (const bool tt) { _boundaryOnly=tt;}
- inline const bool getBoundaryOnly ( ) { return _boundaryOnly;}
+ inline const bool& getBoundaryOnly ( ) { return _boundaryOnly;}
/** Set and get tesselation windong rule */
void setWindingType (const WindingType wt) { _wtype=wt;}
- inline const WindingType getWindingType ( ) { return _wtype;}
+ inline const WindingType& getWindingType ( ) { return _wtype;}
/** Set and get tesselation type */
void setTesselationType (const TesselationType tt) { _ttype=tt;}
- inline const TesselationType getTesselationType ( ) { return _ttype;}
+ inline const TesselationType& getTesselationType ( ) { return _ttype;}
/** Change the contours lists of the geometry into tesselated primitives (the
* list of primitives in the original geometry is stored in the tesselator for
Index: OpenSceneGraph-1.2/OpenSceneGraph/include/osgUtil/TriStripVisitor
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/include/osgUtil/TriStripVisitor
+++ OpenSceneGraph-1.2/OpenSceneGraph/include/osgUtil/TriStripVisitor
@@ -61,7 +61,7 @@ class OSGUTIL_EXPORT TriStripVisitor : p
return _cacheSize;
}
- inline const unsigned int getCacheSize() const
+ inline const unsigned int& getCacheSize() const
{
return _cacheSize;
}
@@ -76,7 +76,7 @@ class OSGUTIL_EXPORT TriStripVisitor : p
return _minStripSize;
}
- inline const unsigned int getMinStripSize() const
+ inline const unsigned int& getMinStripSize() const
{
return _minStripSize;
}
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/ac3d/Geode.cpp
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/ac3d/Geode.cpp
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/ac3d/Geode.cpp
@@ -639,7 +639,7 @@ void Geode::OutputPolygonDelsUInt(const
}
-const int Geode::ProcessMaterial(ostream& fout, const unsigned int igeode)
+const int& Geode::ProcessMaterial(ostream& fout, const unsigned int& igeode)
{
// outputs materials from one geode
// extended for multiple geode models, GWM 2003.
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/dw/ReaderWriterDW.cpp
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/dw/ReaderWriterDW.cpp
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/dw/ReaderWriterDW.cpp
@@ -330,7 +330,7 @@ public:
void tesselate(const std::vector<Vec3> verts, const dwmaterial *themat,
GLUtesselator *ts, _dwobj *dwob, const Matrix *tmat) const;
void link(const int idop, const _face *f2, const int idop2,const std::vector<Vec3> verts, const dwmaterial *themat) const; // to join up opposed faces of a hole
- inline const int getidx(int i) const { return idx[i];}
+ inline const int& getidx(int i) const { return idx[i];}
private:
void linkholes(const std::vector<Vec3> verts, const dwmaterial *themat, const _face *f2) const;
void reverse() { // reverse order of the vertices
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/dxf/dxfEntity.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/dxf/dxfEntity.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/dxf/dxfEntity.h
@@ -147,10 +147,10 @@ public:
virtual void assign(dxfFile* dxf, codeValue& cv);
void getVertex(double &x, double &y, double &z) { x=_vertex.x();y=_vertex.y();z=_vertex.z(); }
const osg::Vec3d& getVertex() const { return _vertex; }
- const unsigned short getIndice1() const { return _indice1; }
- const unsigned short getIndice2() const { return _indice2; }
- const unsigned short getIndice3() const { return _indice3; }
- const unsigned short getIndice4() const { return _indice4; }
+ const unsigned short& getIndice1() const { return _indice1; }
+ const unsigned short& getIndice2() const { return _indice2; }
+ const unsigned short& getIndice3() const { return _indice3; }
+ const unsigned short& getIndice4() const { return _indice4; }
protected:
osg::Vec3d _vertex;
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoAction.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/geo/osgGeoAction.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoAction.h
@@ -159,9 +159,9 @@ public:
inline void setMin(const float v) { min.set(v);}
inline void setMax(const float v) { max.set(v);}
inline void setVal(const float v) { val.set(v);}
- const double getMin(void) const { return min.get();}
- const double getMax(void) const { return max.get();}
- const double getVal(void) const { return val.get();}
+ const double& getMin(void) const { return min.get();}
+ const double& getMax(void) const { return max.get();}
+ const double& getVal(void) const { return val.get();}
private:
geoArithConstant min,max,val;
};
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoNodes.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/geo/osgGeoNodes.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoNodes.h
@@ -21,7 +21,7 @@ public:
inline unsigned int getFID() const { return fid;}
inline double *getVar() {
return &(val.d);} // address of variable
- inline const double getVal() const { return (val.d);}
+ inline const double& getVal() const { return (val.d);}
void setVal(double v) { val.d=v;
if (constrained) {
if (v>vmax) val.d=vmax;
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoStructs.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/geo/osgGeoStructs.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/geo/osgGeoStructs.h
@@ -434,7 +434,7 @@ public:
typedef std::vector< geoField > geoFieldList;
georecord() {id=0; parent=NULL; instance=NULL; nod=NULL; }
~georecord() {;}
- inline const uint getType(void) const {return id;}
+ inline const uint& getType(void) const {return id;}
typedef std::vector<osg::ref_ptr<osg::MatrixTransform> > instancelist; // list 0f unused instance matrices
void addInstance(osg::MatrixTransform *mtr) { mtrlist.push_back(mtr);}
inline void setNode(osg::Node *n) {
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/txp/TXPParser.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/txp/TXPParser.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/txp/TXPParser.h
@@ -180,7 +180,7 @@ public:
// Returns true if we are under billboard subgraph
- inline const bool underBillboardSubgraph() const
+ inline const bool& underBillboardSubgraph() const
{
return _underBillboardSubgraph;
}
@@ -216,7 +216,7 @@ public:
DeferredLightAttribute& getLightAttribute(int ix);
// Returns if we are under layer subgraph
- inline const bool underLayerSubgraph() const
+ inline const bool& underLayerSubgraph() const
{
return _underLayerSubgraph;
}
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgUtil/DelaunayTriangulator.cpp
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgUtil/DelaunayTriangulator.cpp
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgUtil/DelaunayTriangulator.cpp
@@ -195,7 +195,7 @@ public:
// GWM July 2005 add test for triangle intersected by p1-p2.
// return true for unused edge
- const bool intersected(const unsigned int ip1,const unsigned int ip2,const osg::Vec2 p1 ,const osg::Vec2 p2,const int iedge, osg::Vec3Array *points) const
+ const bool& intersected(const unsigned int ip1,const unsigned int ip2,const osg::Vec2 p1 ,const osg::Vec2 p2,const int iedge, osg::Vec3Array *points) const
{
// return true if edge iedge of triangle is intersected by ip1,ip2
Vertex_index ie1,ie2;
Index: OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/ac3d/Geode.h
===================================================================
--- OpenSceneGraph-1.2.orig/OpenSceneGraph/src/osgPlugins/ac3d/Geode.h
+++ OpenSceneGraph-1.2/OpenSceneGraph/src/osgPlugins/ac3d/Geode.h
@@ -9,7 +9,7 @@ namespace ac3d
class Geode : public osg::Geode
{
public:
- const int ProcessMaterial(std::ostream& fout, const unsigned int igeode);
+ const int& ProcessMaterial(std::ostream& fout, const unsigned int& igeode);
void ProcessGeometry(std::ostream& fout, const unsigned int igeode);
private:
void OutputTriangle(const int iCurrentMaterial,const unsigned int surfaceFlags,