1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023072: Eliminate compiler warnings (level 3) on Windows / MSVC++

This commit is contained in:
dbv
2012-06-25 11:31:40 +04:00
parent 9d091ec153
commit 60be1f9b1d
47 changed files with 126 additions and 121 deletions

View File

@@ -37,7 +37,7 @@ LDOMBasicString::LDOMBasicString (const char * aValue)
myVal.ptr = NULL;
} else {
myType = LDOM_AsciiFree;
Standard_Integer aLen = strlen (aValue) + 1;
Standard_Size aLen = strlen (aValue) + 1;
myVal.ptr = new char [aLen];
memcpy (myVal.ptr, aValue, aLen);
}
@@ -56,7 +56,7 @@ LDOMBasicString::LDOMBasicString (const char * aValue,
myVal.ptr = NULL;
} else {
myType = LDOM_AsciiDoc;
Standard_Integer aLen = strlen (aValue) + 1;
Standard_Integer aLen = (Standard_Integer) strlen (aValue) + 1;
myVal.ptr = aDoc -> Allocate (aLen);
memcpy (myVal.ptr, aValue, aLen);
}
@@ -93,7 +93,7 @@ LDOMBasicString::LDOMBasicString (const LDOMBasicString& anOther)
switch (myType) {
case LDOM_AsciiFree:
if (anOther.myVal.ptr) {
Standard_Integer aLen = strlen ((const char *)anOther.myVal.ptr) + 1;
Standard_Size aLen = strlen ((const char *)anOther.myVal.ptr) + 1;
myVal.ptr = new char [aLen];
memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
break;
@@ -149,7 +149,7 @@ LDOMBasicString& LDOMBasicString::operator = (const LDOMBasicString& anOther)
switch (myType) {
case LDOM_AsciiFree:
if (anOther.myVal.ptr) {
Standard_Integer aLen = strlen ((const char *)anOther.myVal.ptr) + 1;
Standard_Size aLen = strlen ((const char *)anOther.myVal.ptr) + 1;
myVal.ptr = new char [aLen];
memcpy (myVal.ptr, anOther.myVal.ptr, aLen);
break;
@@ -269,7 +269,7 @@ LDOMBasicString::operator TCollection_ExtendedString () const
// convert Unicode to Extended String
ptr += 2;
Standard_Integer aLength = (strlen(ptr) / 4), j = 0;
Standard_Size aLength = (strlen(ptr) / 4), j = 0;
Standard_ExtCharacter * aResult = new Standard_ExtCharacter[aLength--];
while (aLength--) {
ptr += 4;

View File

@@ -138,7 +138,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
// Read the full buffer and reset start and end buffer pointers
myPtr = &myBuffer[0];
Standard_Integer aNBytes;
Standard_Size aNBytes;
if (myFileDes != FILE_NONVALUE)
aNBytes = read (myFileDes, &myBuffer[aBytesRest],
XML_BUFFER_SIZE - aBytesRest);

View File

@@ -232,7 +232,7 @@ inline LDOM_XmlWriter& LDOM_XmlWriter::operator <<
{
const char * str = aString.GetString();
if (str) {
const Standard_Integer aLen = strlen (str);
const Standard_Size aLen = strlen (str);
if (aLen > 0) fwrite (str, aLen, 1, myFile);
}
}
@@ -259,7 +259,7 @@ inline LDOM_XmlWriter& LDOM_XmlWriter::operator <<
//=======================================================================
inline LDOM_XmlWriter& LDOM_XmlWriter::operator << (const LXMLCh * aString)
{
unsigned int aLength = strlen (aString);
Standard_Size aLength = strlen (aString);
if (aLength > 0) fwrite ((void *) aString, aLength, 1, myFile);
return * this;
}
@@ -288,7 +288,7 @@ void LDOM_XmlWriter::WriteAttribute (const LDOM_Node& theAtt)
if (aValueStr.Type() == LDOMBasicString::LDOM_Integer) {
Standard_Integer anIntValue;
aValueStr.GetInteger (anIntValue);
aLength = 20 + strlen (aName);
aLength = (Standard_Integer) (20 + strlen (aName));
if (aLength > myABufferLen) {
if (myABuffer != NULL) delete [] myABuffer;
myABuffer = new char [aLength+1];
@@ -296,7 +296,7 @@ void LDOM_XmlWriter::WriteAttribute (const LDOM_Node& theAtt)
}
sprintf (myABuffer, "%c%s%c%c%d%c", chSpace, aName,
chEqual, chDoubleQuote, anIntValue, chDoubleQuote);
aLength = strlen (myABuffer);
aLength = (Standard_Integer) strlen (myABuffer);
// String attribute value
} else {
@@ -304,10 +304,10 @@ void LDOM_XmlWriter::WriteAttribute (const LDOM_Node& theAtt)
char * encStr;
if (aValueStr.Type() == LDOMBasicString::LDOM_AsciiDocClear) {
encStr = (char *) aValue;
aLength = 4 + strlen (aValue) + strlen (aName);
aLength = (Standard_Integer) (4 + strlen (aValue) + strlen (aName));
} else {
encStr = LDOM_CharReference::Encode (aValue, aLength, Standard_True);
aLength += 4 + strlen (aName);
aLength += (Standard_Integer) (4 + strlen (aName));
}
if (aLength > myABufferLen) {
if (myABuffer != NULL) delete [] myABuffer;