1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

Remove compilation warnings.

This commit is contained in:
stv
2015-06-03 17:43:55 +03:00
parent 869af79658
commit 2de43bdee6
4 changed files with 59 additions and 59 deletions

View File

@@ -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

View File

@@ -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 ) );
}
}

View File

@@ -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) );
}
}

View File

@@ -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;