From a4e4d4fa7c449dbe9b560e122fd2a19fb444f731 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 14 Dec 2001 10:02:27 +0000 Subject: [PATCH] Removed all references to using namespace std to help solve compilation problems under Windows and IRIX. Also integrated small change to lib3ds from Drew for IRIX compilation. --- include/osgDB/FieldReader | 2 +- include/osgDB/Output | 2 +- include/osgGLUT/Viewer | 3 ++- src/osgDB/DynamicLibrary.cpp | 5 ----- src/osgPlugins/flt/Input.cpp | 12 ------------ src/osgPlugins/flt/Record.cpp | 7 ------- src/osgPlugins/flt/Registry.cpp | 10 ---------- src/osgPlugins/lib3ds/quat.cpp | 2 +- src/osgPlugins/pfb/ConvertFromPerformer.cpp | 7 ------- src/osgPlugins/pfb/ConvertToPerformer.cpp | 7 ------- src/osgText/FTGLTextureFont.cpp | 2 -- src/osgText/Makefile | 3 ++- src/osgUtil/CullVisitor.cpp | 5 ----- src/osgUtil/IntersectVisitor.cpp | 5 ----- 14 files changed, 7 insertions(+), 65 deletions(-) diff --git a/include/osgDB/FieldReader b/include/osgDB/FieldReader index d72921406..375afa7ca 100644 --- a/include/osgDB/FieldReader +++ b/include/osgDB/FieldReader @@ -14,7 +14,7 @@ #include #else #include -using namespace std; +using std::istream; #endif namespace osgDB { diff --git a/include/osgDB/Output b/include/osgDB/Output index 3219c2f5a..dd3c3ae1a 100644 --- a/include/osgDB/Output +++ b/include/osgDB/Output @@ -16,7 +16,7 @@ #include #else #include -using namespace std; +using std::ofstream; #endif namespace osgDB { diff --git a/include/osgGLUT/Viewer b/include/osgGLUT/Viewer index 46585391c..5f692e527 100644 --- a/include/osgGLUT/Viewer +++ b/include/osgGLUT/Viewer @@ -22,13 +22,14 @@ #include +/* #ifdef OSG_USE_IO_DOT_H #include #else #include using namespace std; #endif - +*/ namespace osgGLUT{ /** A basic viewer base class which provides a window, simple keyboard and mouse interaction. diff --git a/src/osgDB/DynamicLibrary.cpp b/src/osgDB/DynamicLibrary.cpp index 03fc5e0eb..992844135 100644 --- a/src/osgDB/DynamicLibrary.cpp +++ b/src/osgDB/DynamicLibrary.cpp @@ -7,11 +7,6 @@ #include #endif -#ifndef OSG_USE_IO_DOT_H -#include -using namespace std; -#endif - #include #include diff --git a/src/osgPlugins/flt/Input.cpp b/src/osgPlugins/flt/Input.cpp index a4e7e75c5..c50db387a 100644 --- a/src/osgPlugins/flt/Input.cpp +++ b/src/osgPlugins/flt/Input.cpp @@ -10,20 +10,8 @@ #include "Record.h" #include "Registry.h" -#ifdef __sgi -using std::string; -#endif - -#ifdef OSG_USE_IO_DOT_H -#include -#else -#include -using namespace std; -#endif - using namespace flt; - FileInput::FileInput() { _init(); diff --git a/src/osgPlugins/flt/Record.cpp b/src/osgPlugins/flt/Record.cpp index 783d4a536..22122b141 100644 --- a/src/osgPlugins/flt/Record.cpp +++ b/src/osgPlugins/flt/Record.cpp @@ -15,13 +15,6 @@ #include "Input.h" #include "RecordVisitor.h" -#ifdef OSG_USE_IO_DOT_H -#include -#else -#include -using namespace std; -#endif - using namespace flt; //////////////////////////////////////////////////////////////////// diff --git a/src/osgPlugins/flt/Registry.cpp b/src/osgPlugins/flt/Registry.cpp index 2564fe6fe..bdc5dbfab 100644 --- a/src/osgPlugins/flt/Registry.cpp +++ b/src/osgPlugins/flt/Registry.cpp @@ -10,19 +10,9 @@ #include "Input.h" #include "FltFile.h" #include "Registry.h" -/* -#ifdef OSG_USE_IO_DOT_H -//#include -#else -#include -using namespace std; -#endif -*/ -//#include using namespace flt; - // static Registry* Registry::instance() { diff --git a/src/osgPlugins/lib3ds/quat.cpp b/src/osgPlugins/lib3ds/quat.cpp index 17bb02b78..f6e8e3275 100644 --- a/src/osgPlugins/lib3ds/quat.cpp +++ b/src/osgPlugins/lib3ds/quat.cpp @@ -244,7 +244,7 @@ lib3ds_quat_ln(Lib3dsQuat c) Lib3dsDouble om,s,t; s=sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]); - om=atan2(s,c[3]); + om=atan2(s,(Lib3dsDouble)c[3]); if (fabs(s) #include -#ifdef OSG_USE_IO_DOT_H -#include -#else -#include -using namespace std; -#endif - extern "C" { diff --git a/src/osgPlugins/pfb/ConvertToPerformer.cpp b/src/osgPlugins/pfb/ConvertToPerformer.cpp index dbb8faca6..61cdd57f2 100644 --- a/src/osgPlugins/pfb/ConvertToPerformer.cpp +++ b/src/osgPlugins/pfb/ConvertToPerformer.cpp @@ -29,13 +29,6 @@ #include #include -#ifdef OSG_USE_IO_DOT_H -#include -#else -#include -using namespace std; -#endif - extern "C" { diff --git a/src/osgText/FTGLTextureFont.cpp b/src/osgText/FTGLTextureFont.cpp index 226e95d8d..858ec3d4f 100644 --- a/src/osgText/FTGLTextureFont.cpp +++ b/src/osgText/FTGLTextureFont.cpp @@ -2,8 +2,6 @@ #include "FTGlyphContainer.h" #include "FTTextureGlyph.h" -using namespace std; - inline GLuint NextPowerOf2( GLuint in) { in -= 1; diff --git a/src/osgText/Makefile b/src/osgText/Makefile index fe2b368eb..254d6fe80 100644 --- a/src/osgText/Makefile +++ b/src/osgText/Makefile @@ -42,7 +42,8 @@ TARGET_INCLUDE_FILES = \ osgText/Text\ osgText/Version -C++FLAGS += -I../../include -I/usr/include/freetype2 -I/usr/local/include/freetype2 +C++FLAGS += -I../../include -I/usr/include/freetype2 -I/usr/local/include -I/usr/local/include/freetype2 +LDFLAGS += -L/usr/local/lib include ../../Make/makerules diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 80138fada..4a7b38971 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -15,11 +15,6 @@ #include #include -#ifndef OSG_USE_IO_DOT_H -#include -using namespace std; -#endif - using namespace osg; using namespace osgUtil; diff --git a/src/osgUtil/IntersectVisitor.cpp b/src/osgUtil/IntersectVisitor.cpp index fda3fd8f9..b14ed4c9b 100644 --- a/src/osgUtil/IntersectVisitor.cpp +++ b/src/osgUtil/IntersectVisitor.cpp @@ -9,11 +9,6 @@ #include #include -#ifndef OSG_USE_IO_DOT_H -#include -using namespace std; -#endif - using namespace osg; using namespace osgUtil;