From 164d68508e1d41258b3fd5e0bbe95b624954c504 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 17 Jun 2010 12:01:25 +0000 Subject: [PATCH] 0020907: Werror in GEOM: integrate patch from Erwan ADAM --- src/GEOMClient/GEOM_Client.cxx | 4 ++-- src/GEOMClient/GEOM_Client.hxx | 3 +++ src/GEOM_I/GEOM_Gen_i.cc | 5 ++--- src/GEOM_I/GEOM_Object_i.cc | 11 ++++------- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/GEOMClient/GEOM_Client.cxx b/src/GEOMClient/GEOM_Client.cxx index 7d0990466..0e07e69d3 100644 --- a/src/GEOMClient/GEOM_Client.cxx +++ b/src/GEOMClient/GEOM_Client.cxx @@ -30,7 +30,7 @@ #include -#include +#include #include "GEOM_Client.hxx" #include @@ -81,7 +81,7 @@ TopoDS_Shape GEOM_Client::Load( GEOM::GEOM_Gen_ptr geom, GEOM::GEOM_Object_ptr a int sizebuf = SeqFile->length(); char* buf; buf = (char*) &SeqFile[0]; - std::istrstream streamBrep(buf,sizebuf); + std::istringstream streamBrep(buf); BRep_Builder aBuilder; BRepTools::Read(S, streamBrep, aBuilder); return(S); diff --git a/src/GEOMClient/GEOM_Client.hxx b/src/GEOMClient/GEOM_Client.hxx index 5e5269504..f5f9cafc2 100644 --- a/src/GEOMClient/GEOM_Client.hxx +++ b/src/GEOMClient/GEOM_Client.hxx @@ -32,6 +32,9 @@ #include #include CORBA_SERVER_HEADER(GEOM_Gen) # +#ifdef HAVE_FINITE +#undef HAVE_FINITE // E.A. fix a warning about redefinition of HAVE_FINITE in re-inclusion of Standard_values.h +#endif #ifndef _TColStd_SequenceOfAsciiString_HeaderFile #include #endif diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index 76f133190..639d60159 100644 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -30,8 +30,7 @@ #include "GEOM_Object_i.hh" #include -#include -//#include +#include #include "Utils_CorbaException.hxx" #include "OpUtil.hxx" @@ -679,7 +678,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream, // Retrieve a TopoDS_Shape from byte stream TopoDS_Shape aTopology; - std::istrstream aStreamedBrep((char*) &theStream[0], theStream.length()); + std::istringstream aStreamedBrep((char*) &theStream[0]); BRep_Builder aBuilder; try { BRepTools::Read(aTopology, aStreamedBrep, aBuilder); diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 3d2534d2d..355ad32c8 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -28,8 +28,7 @@ #include "utilities.h" #include -#include -//#include +#include #include #include @@ -343,18 +342,16 @@ SALOMEDS::TMPFile* GEOM_Object_i::GetShapeStream() if(aShape.IsNull()) return NULL; - std::ostrstream streamShape; + std::ostringstream streamShape; //Write TopoDS_Shape in ASCII format to the stream BRepTools::Write(aShape, streamShape); //Returns the number of bytes that have been stored in the stream's buffer. - int size = streamShape.pcount(); + int size = streamShape.str().size(); char* buf = new char [size]; //Get pointer on internal character array in ostrstream - char* valueOfStream = streamShape.str(); + const char* valueOfStream = streamShape.str().c_str(); //Create copy of ostrstream content memcpy(buf, valueOfStream, size); - //Allow automatic deletion of ostrstream content - streamShape.rdbuf()->freeze(0); CORBA::Octet* OctetBuf = (CORBA::Octet*)buf; SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size,size,OctetBuf,1);