From: stv Date: Wed, 3 Jun 2015 14:43:55 +0000 (+0300) Subject: Remove compilation warnings. X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c7cc74d3e714bc34c1d67e5f3314adcaac3f1ff1;p=occt-copy.git Remove compilation warnings. --- diff --git a/src/FSD/FSD_BinaryFile.cxx b/src/FSD/FSD_BinaryFile.cxx index 63bc80fbc1..4a19f3d0c8 100644 --- a/src/FSD/FSD_BinaryFile.cxx +++ b/src/FSD/FSD_BinaryFile.cxx @@ -168,7 +168,7 @@ void FSD_BinaryFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Si buffer.Clear(); while (!IsEnd() && (ccount < rsize)) { - Device()->Read(&c, sizeof(char)); + Device()->Read((Standard_Address)&c, sizeof(char)); buffer += c; ccount++; } @@ -1143,7 +1143,7 @@ void FSD_BinaryFile::WriteString(const TCollection_AsciiString& aString) PutInteger(size); if (size > 0) { - if ( Device().IsNull() || Device()->Write((Standard_Address)aString.ToCString(),size) != size ) + if ( Device().IsNull() || Device()->Write((Standard_Address)aString.ToCString(),size) != (Standard_Size)size ) Storage_StreamWriteError::Raise(); } } @@ -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((Standard_Address)c,size) != size ) + if ( Device().IsNull() || Device()->Read((Standard_Address)c,size) != (Standard_Size)size ) Storage_StreamReadError::Raise(); c[size] = '\0'; aString = c; @@ -1218,7 +1218,7 @@ void FSD_BinaryFile::ReadExtendedString(TCollection_ExtendedString& aString) if (size > 0) { Standard_ExtCharacter *c = (Standard_ExtCharacter *) Standard::Allocate((size+1) * sizeof(Standard_ExtCharacter)); - if ( Device().IsNull() || Device()->Read(c,size*sizeof(Standard_ExtCharacter)) != size*sizeof(Standard_ExtCharacter) ) + if ( Device().IsNull() || Device()->Read((Standard_Address)c,size*sizeof(Standard_ExtCharacter)) != size*sizeof(Standard_ExtCharacter) ) Storage_StreamWriteError::Raise(); c[size] = '\0'; #if DO_INVERSE diff --git a/src/FSD/FSD_CmpFile.cxx b/src/FSD/FSD_CmpFile.cxx index aa1c4e145c..3e669590cf 100644 --- a/src/FSD/FSD_CmpFile.cxx +++ b/src/FSD/FSD_CmpFile.cxx @@ -207,7 +207,7 @@ void FSD_CmpFile::WriteLine(const TCollection_AsciiString& aStr, const Standard_ if ( putNewLine ) buffer += TCollection_AsciiString("\n"); - if ( Device()->Write( (Standard_Address)buffer.ToCString(), buffer.Length() ) != buffer.Length() ) + if ( Device()->Write( (Standard_Address)buffer.ToCString(), buffer.Length() ) != (Standard_Size)buffer.Length() ) Storage_StreamWriteError::Raise(); } @@ -226,7 +226,7 @@ void FSD_CmpFile::ReadLine(TCollection_AsciiString& buffer) while (!IsEnd && !FSD_CmpFile::IsEnd()) { Standard_Character c; - Device()->Read( &c, 1 ); + Device()->Read( (Standard_Address)&c, 1 ); if ( c != '\n' && c != '\r') { buffer += c; @@ -291,7 +291,7 @@ void FSD_CmpFile::ReadChar(TCollection_AsciiString& buffer, const Standard_Size buffer.Clear(); while (!IsEnd() && (ccount < rsize)) { - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); buffer += c; ccount++; } @@ -311,7 +311,7 @@ void FSD_CmpFile::ReadString(TCollection_AsciiString& buffer) while (!IsEnd && !FSD_CmpFile::IsEnd()) { char c; - Device()->Read(&c, sizeof(c)); + Device()->Read((Standard_Address)&c, sizeof(c)); if (isFirstTime) { if (c == '\n' || c == ' ') @@ -353,7 +353,7 @@ void FSD_CmpFile::ReadWord(TCollection_AsciiString& buffer) buffer.Clear(); while (!IsEnd && !FSD_CmpFile::IsEnd()) { - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if ((c != ' ') && (c != '\n')) { IsEnd = Standard_True; @@ -372,7 +372,7 @@ void FSD_CmpFile::ReadWord(TCollection_AsciiString& buffer) } *tmpb = c; tmpb++; i++; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if ((c == '\n') || (c == ' ')) { IsEnd = Standard_True; @@ -423,7 +423,7 @@ void FSD_CmpFile::SkipObject() Storage_BaseDriver& FSD_CmpFile::PutReference(const Standard_Integer aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -437,7 +437,7 @@ Storage_BaseDriver& FSD_CmpFile::PutCharacter(const Standard_Character aValue) { Standard_Integer i = aValue; TCollection_AsciiString aStr = TCollection_AsciiString( i ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -452,7 +452,7 @@ Storage_BaseDriver& FSD_CmpFile::PutExtCharacter(const Standard_ExtCharacter aVa { Standard_Integer i = aValue; TCollection_AsciiString aStr = TCollection_AsciiString( i ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -466,7 +466,7 @@ Storage_BaseDriver& FSD_CmpFile::PutExtCharacter(const Standard_ExtCharacter aVa Storage_BaseDriver& FSD_CmpFile::PutInteger(const Standard_Integer aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -480,7 +480,7 @@ Storage_BaseDriver& FSD_CmpFile::PutInteger(const Standard_Integer aValue) Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( (Standard_Integer)aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -494,7 +494,7 @@ Storage_BaseDriver& FSD_CmpFile::PutBoolean(const Standard_Boolean aValue) Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -508,7 +508,7 @@ Storage_BaseDriver& FSD_CmpFile::PutReal(const Standard_Real aValue) Storage_BaseDriver& FSD_CmpFile::PutShortReal(const Standard_ShortReal aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -632,7 +632,7 @@ Storage_BaseDriver& FSD_CmpFile::GetShortReal(Standard_ShortReal& aValue) TCollection_AsciiString aStr; ReadWord( aStr ); if ( aStr.IsRealValue() ) - aValue = aStr.RealValue(); + aValue = (Standard_ShortReal)aStr.RealValue(); else Storage_StreamTypeMismatchError::Raise(); @@ -1243,24 +1243,24 @@ void FSD_CmpFile::ReadPersistentObjectHeader(Standard_Integer& aRef, { char c; - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); while (c != '#') { if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); } GetInteger (aRef); - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); while (c != '%') { if (IsEnd() || (c != ' ') || (c == '\r')|| (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); } GetInteger (aType); @@ -1302,15 +1302,15 @@ void FSD_CmpFile::EndReadPersistentObjectData() { char c; - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); while (c != '\n' && (c != '\r')) { if (IsEnd() || (c != ' ')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); } if (c == '\r') { - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); } } diff --git a/src/FSD/FSD_File.cxx b/src/FSD/FSD_File.cxx index 056712d6ee..d120154996 100644 --- a/src/FSD/FSD_File.cxx +++ b/src/FSD/FSD_File.cxx @@ -192,7 +192,7 @@ void FSD_File::WriteLine(const TCollection_AsciiString& aStr, const Standard_Boo if ( putNewLine ) buffer += TCollection_AsciiString("\n"); - if ( Device()->Write( (Standard_Address)buffer.ToCString(), buffer.Length() ) != buffer.Length() ) + if ( Device()->Write( (Standard_Address)buffer.ToCString(), buffer.Length() ) != (Standard_Size)buffer.Length() ) Storage_StreamWriteError::Raise(); } @@ -213,7 +213,7 @@ void FSD_File::ReadLine(TCollection_AsciiString& buffer) // Buffer[0] = '\0'; // myStream.getline(Buffer,8192,'\n'); Standard_Character c; - Device()->Read( &c, 1 ); + Device()->Read( (Standard_Address)&c, 1 ); if ( c != '\n') buffer += c; else @@ -265,7 +265,7 @@ void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer) buffer.Clear(); while (!fin && !IsEnd()) { - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if (c == tg[count]) count++; else count = 0; @@ -275,7 +275,7 @@ void FSD_File::ReadExtendedLine(TCollection_ExtendedString& buffer) if (c == '\0') fin = Standard_True; i = (i << 8); - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if (c == tg[count]) count++; else count = 0; if (count < SIZEOFNORMALEXTENDEDSECTION) { @@ -309,7 +309,7 @@ void FSD_File::ReadChar(TCollection_AsciiString& buffer, const Standard_Size rsi buffer.Clear(); while (!IsEnd() && (ccount < rsize)) { - Device()->Read( &c, sizeof( char ) ); + Device()->Read( (Standard_Address)&c, sizeof( char ) ); buffer += c; ccount++; } @@ -329,7 +329,7 @@ void FSD_File::ReadString(TCollection_AsciiString& buffer) while (!IsEnd && !FSD_File::IsEnd()) { char c; - Device()->Read(&c, sizeof(c)); + Device()->Read((Standard_Address)&c, sizeof(c)); if ( isFirstTime ) { if ( c == '\n' || c == ' ' ) @@ -365,7 +365,7 @@ void FSD_File::ReadWord(TCollection_AsciiString& buffer) buffer.Clear(); while (!IsEnd && !FSD_File::IsEnd()) { - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if ((c != ' ') && (c != '\n')) IsEnd = Standard_True; } @@ -382,7 +382,7 @@ void FSD_File::ReadWord(TCollection_AsciiString& buffer) } *tmpb = c; tmpb++; i++; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); if ((c == '\n') || (c == ' ')) IsEnd = Standard_True; } @@ -431,7 +431,7 @@ void FSD_File::SkipObject() Storage_BaseDriver& FSD_File::PutReference(const Standard_Integer aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; @@ -446,7 +446,7 @@ Storage_BaseDriver& FSD_File::PutCharacter(const Standard_Character aValue) { Standard_Integer i = aValue; TCollection_AsciiString aStr = TCollection_AsciiString( i ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -460,7 +460,7 @@ Storage_BaseDriver& FSD_File::PutExtCharacter(const Standard_ExtCharacter aValue { Standard_Integer i = aValue; TCollection_AsciiString aStr = TCollection_AsciiString( i ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -473,7 +473,7 @@ Storage_BaseDriver& FSD_File::PutExtCharacter(const Standard_ExtCharacter aValue Storage_BaseDriver& FSD_File::PutInteger(const Standard_Integer aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -486,7 +486,7 @@ Storage_BaseDriver& FSD_File::PutInteger(const Standard_Integer aValue) Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( (Standard_Integer)aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -499,7 +499,7 @@ Storage_BaseDriver& FSD_File::PutBoolean(const Standard_Boolean aValue) Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -512,7 +512,7 @@ Storage_BaseDriver& FSD_File::PutReal(const Standard_Real aValue) Storage_BaseDriver& FSD_File::PutShortReal(const Standard_ShortReal aValue) { TCollection_AsciiString aStr = TCollection_AsciiString( aValue ) + " "; - if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != aStr.Length() ) + if ( Device()->Write( (Standard_Address)aStr.ToCString(), aStr.Length() ) != (Standard_Size)aStr.Length() ) Storage_StreamWriteError::Raise(); return *this; } @@ -635,7 +635,7 @@ Storage_BaseDriver& FSD_File::GetShortReal(Standard_ShortReal& aValue) TCollection_AsciiString aStr; ReadWord( aStr ); if ( aStr.IsRealValue() ) - aValue = aStr.RealValue(); + aValue = (Standard_ShortReal)aStr.RealValue(); else Storage_StreamTypeMismatchError::Raise(); return *this; @@ -1235,34 +1235,34 @@ void FSD_File::ReadPersistentObjectHeader(Standard_Integer& aRef, { char c; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '#') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } GetInteger (aRef); - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '=') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '%') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } GetInteger (aType); @@ -1276,12 +1276,12 @@ void FSD_File::ReadPersistentObjectHeader(Standard_Integer& aRef, void FSD_File::BeginReadPersistentObjectData() { char c; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '(') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } } @@ -1294,12 +1294,12 @@ void FSD_File::BeginReadObjectData() { char c; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '(') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } } @@ -1312,12 +1312,12 @@ void FSD_File::EndReadObjectData() { char c; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != ')') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } } @@ -1331,20 +1331,20 @@ void FSD_File::EndReadPersistentObjectData() char c; - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != ')') { if (IsEnd() || (c != ' ') || (c == '\n')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); while (c != '\n') { if (IsEnd() || (c != ' ')) { Storage_StreamFormatError::Raise(); } - Device()->Read( &c, sizeof(char) ); + Device()->Read( (Standard_Address)&c, sizeof(char) ); } } diff --git a/src/Storage/Storage_IODevice.cxx b/src/Storage/Storage_IODevice.cxx index 515f75a15e..6f48f5275a 100644 --- a/src/Storage/Storage_IODevice.cxx +++ b/src/Storage/Storage_IODevice.cxx @@ -37,7 +37,7 @@ void Storage_IODevice::ReadLine( Standard_CString& aBuffer, const Standard_Integ while ( CanRead() && !IsEnd() && i < aSize && !aFin ) { Standard_Character c; - Read( &c, sizeof( Standard_Character ) ); + Read( (Standard_Address)&c, sizeof( Standard_Character ) ); aFin = ( c == anEndSymbol ); if ( aFin ) aBuf[i++] = '\0'; @@ -53,7 +53,7 @@ TCollection_AsciiString Storage_IODevice::ReadLine( const Standard_Character anE while ( CanRead() && !IsEnd() && !aFin ) { Standard_Character c; - Read( &c, sizeof( Standard_Character ) ); + Read( (Standard_Address)&c, sizeof( Standard_Character ) ); aFin = ( c == anEndSymbol ); if ( !aFin ) aLine += c;