]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0020907: Werror in GEOM: integrate patch from Erwan ADAM
authorvsr <vsr@opencascade.com>
Thu, 17 Jun 2010 12:01:25 +0000 (12:01 +0000)
committervsr <vsr@opencascade.com>
Thu, 17 Jun 2010 12:01:25 +0000 (12:01 +0000)
src/GEOMClient/GEOM_Client.cxx
src/GEOMClient/GEOM_Client.hxx
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_Object_i.cc

index 7d09904663716d3430497fa6245f5c695d62ffa0..0e07e69d3bbd9a8ae93aeff9206695e316728869 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <Standard_Stream.hxx>
 
 
 #include <Standard_Stream.hxx>
 
-#include <strstream>
+#include <sstream>
 
 #include "GEOM_Client.hxx"
 #include <SALOMEconfig.h>
 
 #include "GEOM_Client.hxx"
 #include <SALOMEconfig.h>
@@ -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];
     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);
     BRep_Builder aBuilder;
     BRepTools::Read(S, streamBrep, aBuilder);
     return(S);
index 5e5269504fb326acf2589521e0f89f2d8e658aa6..f5f9cafc2727aa3d774da36ad0397d85375ee57d 100644 (file)
@@ -32,6 +32,9 @@
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(GEOM_Gen)
 #
 #include <SALOMEconfig.h>
 #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 <TColStd_SequenceOfAsciiString.hxx>
 #endif
 #ifndef _TColStd_SequenceOfAsciiString_HeaderFile
 #include <TColStd_SequenceOfAsciiString.hxx>
 #endif
index 76f133190a950d5fd09f95c23da7a46c08bd585b..639d60159e3bb8af73cff45b28b12fad803f06bf 100644 (file)
@@ -30,8 +30,7 @@
 #include "GEOM_Object_i.hh"
 
 #include <set>
 #include "GEOM_Object_i.hh"
 
 #include <set>
-#include <strstream>
-//#include <sstream>
+#include <sstream>
 
 #include "Utils_CorbaException.hxx"
 #include "OpUtil.hxx"
 
 #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;
 
   // 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);
   BRep_Builder aBuilder;
   try {
     BRepTools::Read(aTopology, aStreamedBrep, aBuilder);
index 3d2534d2dc6e82883364daf2f2ea2692b5146ad8..355ad32c848e8da9b91b75838066f9608c0a7a8c 100644 (file)
@@ -28,8 +28,7 @@
 
 #include "utilities.h"
 #include <fstream>
 
 #include "utilities.h"
 #include <fstream>
-#include <strstream>
-//#include <sstream>
+#include <sstream>
 
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
@@ -343,18 +342,16 @@ SALOMEDS::TMPFile* GEOM_Object_i::GetShapeStream()
 
   if(aShape.IsNull()) return NULL;
 
 
   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.
   //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* 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);
   //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);
 
   CORBA::Octet* OctetBuf =  (CORBA::Octet*)buf;
   SALOMEDS::TMPFile_var SeqFile = new SALOMEDS::TMPFile(size,size,OctetBuf,1);