Updated OSG so that the old OSG_USE_IO_DOT_H has be removed from all headers

that used it, all references to the Standard C++ stream classes use the
std::ostream etc convention, all references to "using namespace std" and
"using namespace std::ostream etc" have been removed.
This commit is contained in:
Robert Osfield 2001-12-14 21:49:04 +00:00
parent 6070a9e1b1
commit b1f478e5d2
16 changed files with 36 additions and 107 deletions

View File

@ -116,6 +116,10 @@ Compiling under IRIX
under previous versions but has yet to be tested. It is recommended
to use MIPSPro7.3.1.1m.
When compiling with MIPSPro7.2.1 you will need to use STLport for its
proper implementation of Standard C++ iostreams which are missing
from compiler own implementation.
To compile, from the OSG root directory, type :
make

View File

@ -8,8 +8,8 @@ DEPFILES = $(OBJS:.o=.d)
C++ = CC
YFLAGS = -d
#CFLAGS = -O2 -n32 -MDupdate $(MAKEDEPEND) -DOSG_USE_IO_DOT_H -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303
CFLAGS = -O2 -n32 -DOSG_USE_IO_DOT_H -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303
#CFLAGS = -O2 -n32 -MDupdate $(MAKEDEPEND) -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303
CFLAGS = -O2 -n32 --OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303
C++FLAGS = ${CFLAGS}
CPPFLAGS = ${CFLAGS}

View File

@ -9,13 +9,7 @@
#include <osg/Vec3>
#include <osg/Vec4>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using std::ostream;
using std::endl;
#endif
namespace osg {
@ -277,14 +271,14 @@ inline Vec4 Matrix::operator* (const Vec4& v) const
return postMult(v);
}
inline ostream& operator<< (ostream& os, const Matrix& m )
inline std::ostream& operator<< (std::ostream& os, const Matrix& m )
{
os << "{"<<endl;
os << "{"<<std::endl;
for(int row=0; row<4; ++row) {
os << "\t";
for(int col=0; col<4; ++col)
os << m(row,col) << " ";
os << endl;
os << std::endl;
}
os << "}" << endl;
return os;

View File

@ -7,19 +7,8 @@
#include <osg/Export>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#include <fstream.h>
#else
#include <iostream>
#include <fstream>
using std::ostream;
using std::ofstream;
using std::endl;
using std::cout;
using std::cerr;
#endif
namespace osg {
@ -43,7 +32,7 @@ enum NotifySeverity {
SG_EXPORT extern NotifySeverity g_NotifyLevel;
/** global notify nul stream. added for Mac OSX */
SG_EXPORT extern ofstream *g_NotifyNulStream;
SG_EXPORT extern std::ofstream *g_NotifyNulStream;
/** global notify nul stream. added for Mac OSX */
SG_EXPORT extern bool g_NotifyInit;
@ -79,19 +68,20 @@ SG_EXPORT extern bool initNotifyLevel();
// previous implementation was causing Mac OSX to misbehave. This version
// places less stress on compiler and runs on Mac
inline ostream& notify(const NotifySeverity severity)
inline std::ostream& notify(const NotifySeverity severity)
{
if (!g_NotifyInit) initNotifyLevel();
if (severity<=g_NotifyLevel)
{
if (severity<=osg::WARN) return cerr;
else return cout;
if (severity<=osg::WARN) return std::cerr;
else return std::cout;
}
return *osg::g_NotifyNulStream;
}
inline ostream& notify(void) { return notify(osg::INFO); }
inline std::ostream& notify(void) { return notify(osg::INFO); }
};
#endif

View File

@ -7,12 +7,7 @@
#include <osg/Math>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using std::ostream;
#endif
namespace osg {
@ -152,7 +147,7 @@ class Vec2
return( norm );
}
friend inline ostream& operator << (ostream& output, const Vec2& vec)
friend inline std::ostream& operator << (std::ostream& output, const Vec2& vec)
{
output << vec._v[0] << " "
<< vec._v[1];

View File

@ -7,12 +7,7 @@
#include <osg/Math>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using std::ostream;
#endif
namespace osg {
@ -178,7 +173,7 @@ class Vec3
}; // end of class Vec3
inline ostream& operator << (ostream& output, const Vec3& vec)
inline std::ostream& operator << (std::ostream& output, const Vec3& vec)
{
output << vec._v[0] << " "
<< vec._v[1] << " "

View File

@ -7,12 +7,7 @@
#include <osg/Math>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using std::ostream;
#endif
namespace osg {
@ -182,7 +177,7 @@ class Vec4
return( norm );
}
friend inline ostream& operator << (ostream& output, const Vec4& vec)
friend inline std::ostream& operator << (std::ostream& output, const Vec4& vec)
{
output << vec._v[0] << " "
<< vec._v[1] << " "

View File

@ -10,13 +10,7 @@
#include <string.h>
#include <stdlib.h>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using std::istream;
using std::ifstream;
#endif
namespace osgDB {
@ -32,7 +26,7 @@ class OSGDB_EXPORT FieldReader
virtual FieldReader& operator = (const FieldReader& ic);
void attach(istream* input);
void attach(std::istream* input);
void detach();
virtual bool eof() const;
@ -51,7 +45,7 @@ class OSGDB_EXPORT FieldReader
void _free();
void _copy(const FieldReader& ic);
istream* _fin;
std::istream* _fin;
bool _eof;
bool findStartOfNextField();

View File

@ -12,18 +12,13 @@
#include <string>
#include <map>
#ifdef OSG_USE_IO_DOT_H
#include <fstream.h>
#else
#include <fstream>
using std::ofstream;
#endif
namespace osgDB {
/** ofstream wrapper class for adding support for indenting.
Used in output of .osg ASCII files to improve their readability.*/
class OSGDB_EXPORT Output : public ofstream
class OSGDB_EXPORT Output : public std::ofstream
{
public:

View File

@ -22,14 +22,6 @@
#include <string>
/*
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
*/
namespace osgGLUT{
/** A basic viewer base class which provides a window, simple keyboard and mouse interaction.

View File

@ -149,8 +149,8 @@ int main( int argc, char **argv )
osgGLUT::Viewer viewer;
viewer.addViewport( rootnode );
//osgUtil::SceneView* sceneview = viewer.getViewportSceneView(0);
//sceneview->setStereoMode(osgUtil::SceneView::ANAGLYPHIC_STEREO);
// osgUtil::SceneView* sceneview = viewer.getViewportSceneView(0);
// sceneview->setStereoMode(osgUtil::SceneView::ANAGLYPHIC_STEREO);
// register trackball, flight and drive.
viewer.registerCameraManipulator(new osgUtil::TrackballManipulator);

View File

@ -8,13 +8,7 @@
#include "RecordVisitor.h"
#include <map>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
namespace flt {
@ -46,7 +40,7 @@ class OldVertexRecord : public PrimNodeRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv);
virtual SOldVertex* getData() const { return (SOldVertex*)_pData; }
// friend ostream& operator << (ostream& output, const OldVertexRecord& rec);
// friend std::ostream& operator << (std::ostream& output, const OldVertexRecord& rec);
protected:
virtual ~OldVertexRecord();
@ -87,7 +81,7 @@ class OldVertexColorRecord : public PrimNodeRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv);
virtual SOldVertexColor* getData() const { return (SOldVertexColor*)_pData; }
// friend ostream& operator << (ostream& output, const OldVertexColorRecord& rec);
// friend std::ostream& operator << (std::ostream& output, const OldVertexColorRecord& rec);
protected:
virtual ~OldVertexColorRecord();
@ -128,7 +122,7 @@ class OldVertexColorNormalRecord : public PrimNodeRecord
virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv);
virtual SOldVertexColorNormal* getData() const { return (SOldVertexColorNormal*)_pData; }
// friend ostream& operator << (ostream& output, const OldVertexColorNormalRecord& rec);
// friend std::ostream& operator << (std::ostream& output, const OldVertexColorNormalRecord& rec);
protected:
virtual ~OldVertexColorNormalRecord();

View File

@ -42,10 +42,6 @@
#include <iostream>
#include <fstream>
#ifndef OSG_USE_IO_DOT_H
using std::ios;
#endif
typedef signed char int8;
typedef unsigned char uint8;
typedef signed short int16;
@ -161,7 +157,7 @@ class Attr
Attr(int version) : _flt_version(version) { init(); }
void init();
void readField(ifstream& file, void* buf, size_t size);
void readField(std::ifstream& file, void* buf, size_t size);
bool readAttrFile(const char* szName);
StateSet* createOsgStateSet();
@ -456,7 +452,7 @@ void Attr::init()
}
void Attr::readField(ifstream& file, void* buf, size_t size)
void Attr::readField(std::ifstream& file, void* buf, size_t size)
{
if (file.eof()) return;
file.read((char*)buf, size);
@ -468,9 +464,9 @@ void Attr::readField(ifstream& file, void* buf, size_t size)
bool Attr::readAttrFile(const char* szName)
{
int n;
ifstream file;
std::ifstream file;
file.open (szName, ios::in | ios::binary);
file.open (szName, std::ios::in | std::ios::binary);
READ( texels_u );
READ( textel_v );

View File

@ -9,12 +9,7 @@
#include "FltRecords.h"
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
namespace flt {
@ -70,7 +65,7 @@ class Record : public osg::Referenced
int getFlightVersion();
friend ostream& operator << (ostream& output, const Record& rec);
friend std::ostream& operator << (std::ostream& output, const Record& rec);
protected:

View File

@ -9,12 +9,7 @@
#include "Record.h"
#include "RecordVisitor.h"
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
namespace flt {
@ -48,7 +43,7 @@ class VertexPaletteRecord : public AncillaryRecord
virtual size_t sizeofData() const { return sizeof(SVertexTableHeader); }
virtual void accept(RecordVisitor& rv) { rv.apply(*this); }
// virtual void traverse(RecordVisitor& rv);
friend ostream& operator << (ostream& output, const VertexPaletteRecord& rec);
friend std::ostream& operator << (std::ostream& output, const VertexPaletteRecord& rec);
protected:
virtual ~VertexPaletteRecord();

View File

@ -4,12 +4,7 @@
#include <osg/Vec4>
#ifdef OSG_USE_IO_DOT_H
#include <iostream.h>
#else
#include <iostream>
using namespace std;
#endif
namespace flt {
@ -81,7 +76,7 @@ struct float32x2
ENDIAN( _v[1] );
}
friend inline ostream& operator << (ostream& output, const float32x2& f)
friend inline std::ostream& operator << (std::ostream& output, const float32x2& f)
{
output << f._v[0] << " "
<< f._v[1];
@ -103,7 +98,7 @@ struct float32x3
ENDIAN( _v[2] );
}
friend inline ostream& operator << (ostream& output, const float32x3& f)
friend inline std::ostream& operator << (std::ostream& output, const float32x3& f)
{
output << f._v[0] << " "
<< f._v[1] << " "
@ -124,7 +119,7 @@ struct float64x2
ENDIAN( _v[1] );
}
friend inline ostream& operator << (ostream& output, const float64x2& f)
friend inline std::ostream& operator << (std::ostream& output, const float64x2& f)
{
output << f._v[0] << " "
<< f._v[1];
@ -147,7 +142,7 @@ struct float64x3
ENDIAN( _v[2] );
}
friend inline ostream& operator << (ostream& output, const float64x3& f)
friend inline std::ostream& operator << (std::ostream& output, const float64x3& f)
{
output << f._v[0] << " "
<< f._v[1] << " "