]> OCCT Git - occt-copy.git/commitdiff
Fixes for compilation type conversion errors on Linux.
authorstv <stv@opencascade.com>
Wed, 3 Jun 2015 14:08:32 +0000 (17:08 +0300)
committerstv <stv@opencascade.com>
Wed, 3 Jun 2015 14:08:32 +0000 (17:08 +0300)
src/BinDrivers/BinDrivers_DocumentRetrievalDriver.cxx
src/BinLDrivers/BinLDrivers_DocumentSection.cxx
src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx
src/BinObjMgt/BinObjMgt_Persistent.cxx
src/FSD/FSD_BinaryFile.cxx
src/FSD/FSD_CmpFile.cxx
src/FSD/FSD_File.cxx

index 144f060ef5a47616141f26af8e5ed2129d677636..5615d4648e8835c845b02e830d78f07035ee9dd5 100644 (file)
@@ -66,7 +66,7 @@ void BinDrivers_DocumentRetrievalDriver::ReadShapeSection( BinLDrivers_DocumentS
       OCC_CATCH_SIGNALS
 
       aBuf = (Standard_Character*)malloc( theSection.Length() + 1 );
-      Standard_Size aSize = theDevice->Read( aBuf, theSection.Length() );
+      Standard_Size aSize = theDevice->Read( (Standard_Address)aBuf, theSection.Length() );
       if ( aSize == theSection.Length() )
       {
           Standard_SStream aStrStream( std::string( aBuf, aSize ), Standard_SStream::in | Standard_SStream::binary );
index 91006bd3f5cfb9a6beb1c3d48e3a691cae9945d9..7172921ddc07908051aeae086b4434b4f981f104 100644 (file)
@@ -137,7 +137,7 @@ void BinLDrivers_DocumentSection::WriteTOC (const Handle(Storage_IODevice)& theD
 #else
     aBufSz[0] = (Standard_Integer)aBufSize;
 #endif
-    theDevice->Write( &aBuf[0], aBufSize + sizeof(Standard_Integer) );
+    theDevice->Write( (Standard_Address)&aBuf[0], aBufSize + sizeof(Standard_Integer) );
 
     // Store the address of Offset word in the file
     myValue[0] = (Standard_Size) theDevice->Tell();
@@ -148,7 +148,7 @@ void BinLDrivers_DocumentSection::WriteTOC (const Handle(Storage_IODevice)& theD
     aBufSz[0] = 0;
     aBufSz[1] = 0;
     aBufSz[2] = 0;
-    theDevice->Write(&aBuf[0], 3*sizeof(Standard_Integer));
+    theDevice->Write( (Standard_Address)&aBuf[0], 3*sizeof(Standard_Integer));
   }
 }
 
@@ -175,7 +175,7 @@ void BinLDrivers_DocumentSection::Write (const Handle(Storage_IODevice)& theDevi
   aVal[2] = InverseSize(aVal[2]);
 #endif
 
-  theDevice->Write((char*)&aVal[0], 3*sizeof(Standard_Integer));
+  theDevice->Write((Standard_Address)&aVal[0], 3*sizeof(Standard_Integer));
   theDevice->Seek(aSectionEnd);
 }
 
@@ -189,7 +189,7 @@ void BinLDrivers_DocumentSection::ReadTOC( BinLDrivers_DocumentSection& theSecti
 {
   char aBuf[512];
   Standard_Integer aNameBufferSize;
-  theDevice->Read( (char*)&aNameBufferSize, sizeof(Standard_Integer) );
+  theDevice->Read( (Standard_Address)&aNameBufferSize, sizeof(Standard_Integer) );
 #if DO_INVERSE
   aNameBufferSize = InverseSize(aNameBufferSize);
 #endif
index 78a0a35dd564a9b59f48d4d38f8c61203a6c49fb..f4aeece7e51b9b0639a89a3554b8ca0a58b06937 100644 (file)
@@ -245,7 +245,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree(const TDF_Label&          t
 #if DO_INVERSE
   anEndLabel = (BinLDrivers_Marker) InverseInt (anEndLabel);
 #endif
-  theDevice->Write((char*)&anEndLabel, sizeof(anEndLabel));
+  theDevice->Write( (Standard_Address)&anEndLabel, sizeof(anEndLabel));
 }
 
 //=======================================================================
index c5e49cf34d3d6c706731c8dcd44bcf7c869dabce..f8579aa949cf9ed649eccd7605dbc377297ebcf5 100644 (file)
@@ -123,7 +123,7 @@ void BinObjMgt_Persistent::Write (const Handle(Storage_IODevice)& theDevice)
   for (Standard_Integer i=1; theDevice->CanWrite() && nbWritten < mySize && i <= myData.Length(); i++)
   {
     Standard_Integer nbToWrite = Min(mySize - nbWritten, BP_PIECESIZE);
-    theDevice->Write( (char*)myData(i), nbToWrite );
+    theDevice->Write( (Standard_Address)myData(i), nbToWrite );
     nbWritten += nbToWrite;
   }
   myIndex = 1;
index 94cf39a20f998cda63a719e670ac4ea8f79dbe1b..63bc80fbc15fc36933facec49db8fd06208c112b 100644 (file)
@@ -200,7 +200,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutReference(const Standard_Integer aValue)
   Standard_Integer t = aValue;
 #endif
 
-  if ( Device()->Write( &t, sizeof(Standard_Integer) ) != sizeof(Standard_Integer) )
+  if ( Device()->Write( (Standard_Address)&t, sizeof(Standard_Integer) ) != sizeof(Standard_Integer) )
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -237,7 +237,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutExtCharacter(const Standard_ExtCharacter
   Standard_ExtCharacter t = aValue;
 #endif
 
-  if ( Device()->Write(&t, sizeof(Standard_ExtCharacter)) != sizeof(Standard_ExtCharacter) )
+  if ( Device()->Write((Standard_Address)&t, sizeof(Standard_ExtCharacter)) != sizeof(Standard_ExtCharacter) )
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -259,7 +259,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutInteger(const Standard_Integer aValue)
   Standard_Integer t = aValue;
 #endif
   
-  if ( Device()->Write(&t,sizeof(Standard_Integer)) != sizeof(Standard_Integer))
+  if ( Device()->Write((Standard_Address)&t,sizeof(Standard_Integer)) != sizeof(Standard_Integer))
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -281,7 +281,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutBoolean(const Standard_Boolean aValue)
   Standard_Integer t = (Standard_Integer)aValue;
 #endif
   
-  if ( Device()->Write(&t,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
+  if ( Device()->Write((Standard_Address)&t,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -303,7 +303,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutReal(const Standard_Real aValue)
   Standard_Real t = aValue;
 #endif
   
-  if ( Device()->Write(&t,sizeof(Standard_Real)) != sizeof(Standard_Real) )
+  if ( Device()->Write((Standard_Address)&t,sizeof(Standard_Real)) != sizeof(Standard_Real) )
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -325,7 +325,7 @@ Storage_BaseDriver& FSD_BinaryFile::PutShortReal(const Standard_ShortReal aValue
   Standard_ShortReal t = aValue;
 #endif
 
-  if ( Device()->Write(&t,sizeof(Standard_ShortReal)) != sizeof(Standard_ShortReal) )
+  if ( Device()->Write((Standard_Address)&t,sizeof(Standard_ShortReal)) != sizeof(Standard_ShortReal) )
     Storage_StreamWriteError::Raise();
 
   return *this;
@@ -341,7 +341,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetReference(Standard_Integer& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
+  if ( Device()->Read( (Standard_Address)&aValue,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseInt (aValue);
@@ -359,7 +359,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetCharacter(Standard_Character& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_Character)) != sizeof(Standard_Character) )
+  if ( Device()->Read( (Standard_Address)&aValue,sizeof(Standard_Character)) != sizeof(Standard_Character) )
     Storage_StreamTypeMismatchError::Raise();
 
   return *this;
@@ -375,7 +375,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetExtCharacter(Standard_ExtCharacter& aValu
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_ExtCharacter)) != sizeof(Standard_ExtCharacter) )
+  if ( Device()->Read( (Standard_Address)&aValue,sizeof(Standard_ExtCharacter)) != sizeof(Standard_ExtCharacter) )
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseExtChar (aValue);
@@ -393,7 +393,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetInteger(Standard_Integer& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
+  if ( Device()->Read((Standard_Address)&aValue,sizeof(Standard_Integer)) != sizeof(Standard_Integer) )
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseInt (aValue);
@@ -411,7 +411,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetBoolean(Standard_Boolean& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_Boolean)) != sizeof(Standard_Boolean) )
+  if ( Device()->Read((Standard_Address)&aValue,sizeof(Standard_Boolean)) != sizeof(Standard_Boolean) )
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseInt ((Standard_Integer) aValue);
@@ -429,7 +429,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetReal(Standard_Real& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_Real)) != sizeof(Standard_Real))
+  if ( Device()->Read((Standard_Address)&aValue,sizeof(Standard_Real)) != sizeof(Standard_Real))
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseReal (aValue);
@@ -447,7 +447,7 @@ Storage_BaseDriver& FSD_BinaryFile::GetShortReal(Standard_ShortReal& aValue)
   if ( Device().IsNull() )
     Storage_StreamReadError::Raise();
 
-  if ( Device()->Read(&aValue,sizeof(Standard_ShortReal)) != sizeof(Standard_ShortReal))
+  if ( Device()->Read((Standard_Address)&aValue,sizeof(Standard_ShortReal)) != sizeof(Standard_ShortReal))
     Storage_StreamTypeMismatchError::Raise();
 #if DO_INVERSE
   aValue = InverseShortReal (aValue);
@@ -1160,7 +1160,7 @@ void FSD_BinaryFile::ReadString(TCollection_AsciiString& aString)
   GetInteger(size);
   if (size > 0) {
     Standard_Character *c = (Standard_Character *)Standard::Allocate((size+1) * sizeof(Standard_Character));
-    if ( Device().IsNull() || Device()->Read(c,size) != size )
+    if ( Device().IsNull() || Device()->Read((Standard_Address)c,size) != size )
       Storage_StreamReadError::Raise();
     c[size] = '\0';
     aString = c;
index f7ef5ba87c220068e6f9c2947f7451ae5da0477b..aa1c4e145c690de9335792a94b47857509e29ee4 100644 (file)
@@ -255,7 +255,7 @@ void FSD_CmpFile::WriteExtendedLine(const TCollection_ExtendedString& buffer)
     PutExtCharacter(extBuffer[i]);
   }
 
-  Device()->Write("\n", 1);
+  Device()->Write((Standard_Address)"\n", 1);
 }
 
 //=======================================================================
index de9b87ab87fbcedbe9ab144ac190afe0e3d7d48a..056712d6eee97fb29a286f9cece21ec6f8de7183 100644 (file)
@@ -243,11 +243,11 @@ void FSD_File::WriteExtendedLine(const TCollection_ExtendedString& buffer)
     char cc = (char)c;
     char cd = (char)d;
 
-    Device()->Write( &cc, sizeof(char) );
-    Device()->Write( &cd, sizeof(char) );
+    Device()->Write( (Standard_Address)&cc, sizeof(char) );
+    Device()->Write( (Standard_Address)&cd, sizeof(char) );
   }
 
-  Device()->Write("\0\n", 2);
+  Device()->Write((Standard_Address)"\0\n", 2);
 }
 
 //=======================================================================