mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0024186: Eliminate remaining compiler warnings in MSVC++ 2010 64 bit with warning level 4
Eliminated some warnings of type C4267 (conversion from Type1 to Type2: possible loss of data); size_t to int explicit casts added. Fixed warning C4267 and 4244 in OSD* files Change in OSD_FileNode and OSD_File reverted since different handle types are needed on Unix and Windows
This commit is contained in:
parent
b62b3e079f
commit
7dc9e04716
@ -138,7 +138,7 @@ void BinLDrivers_DocumentSection::WriteTOC (Standard_OStream& theStream)
|
||||
#if DO_INVERSE
|
||||
aBufSz[0] = InverseSize ((Standard_Integer)aBufSize);
|
||||
#else
|
||||
aBufSz[0] = aBufSize;
|
||||
aBufSz[0] = (Standard_Integer)aBufSize;
|
||||
#endif
|
||||
theStream.write (&aBuf[0], aBufSize + sizeof(Standard_Integer));
|
||||
|
||||
|
@ -332,7 +332,7 @@ BinObjMgt_Persistent& BinObjMgt_Persistent::PutCString
|
||||
(const Standard_CString theValue)
|
||||
{
|
||||
alignOffset (1);
|
||||
Standard_Integer aSize = strlen (theValue) + 1;
|
||||
Standard_Integer aSize = (Standard_Integer)(strlen (theValue) + 1);
|
||||
prepareForPut (aSize);
|
||||
putArray ((void* const)theValue, aSize);
|
||||
return *this;
|
||||
|
@ -186,7 +186,7 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
|
||||
Standard_Byte* anImageRow = myImageAlpha->ChangeRow (aRowIter);
|
||||
for (Standard_Size aColumnIter = 0; aColumnIter < myImage->Width(); aColumnIter++)
|
||||
{
|
||||
myImage->PixelColor ((Standard_Integer )aColumnIter, (Standard_Integer )aRowIter, anAlpha);
|
||||
myImage->PixelColor ((Standard_Integer)aColumnIter, (Standard_Integer)aRowIter, anAlpha);
|
||||
anImageRow[aColumnIter] = Standard_Byte (255.0 * anAlpha);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static char intval[20];
|
||||
char cardeb = text.Value(1);
|
||||
Standard_Integer ln,lnt,i,j;
|
||||
ln = text.Length();
|
||||
lnt = strlen(val) - ln;
|
||||
lnt = (Standard_Integer)(strlen(val) - ln);
|
||||
for (i = 0; i <= lnt; i ++) {
|
||||
if (val[i] == cardeb) {
|
||||
// un candidat
|
||||
|
@ -313,52 +313,52 @@ Handle(Interface_ParamSet) IGESData_GlobalSection::Params () const
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
|
||||
sprintf(nombre,"%d",theIntegerBits);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
sprintf(nombre,"%d",theMaxPower10Single);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
sprintf(nombre,"%d",theMaxDigitsSingle);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
sprintf(nombre,"%d",theMaxPower10Double);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
sprintf(nombre,"%d",theMaxDigitsDouble);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
MakeHollerith (theReceiveName,text,lt);
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
|
||||
Interface_FloatWriter::Convert (theScale,nombre,Standard_True,0.,0.,"%f","%f");
|
||||
// sprintf(nombre,"%f",theScale);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamReal,0);
|
||||
|
||||
sprintf(nombre,"%d",theUnitFlag);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
MakeHollerith (theUnitName,text,lt);
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
|
||||
sprintf(nombre,"%d",theLineWeightGrad);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
Interface_FloatWriter::Convert (theMaxLineWeight,nombre,Standard_True,0.,0.,"%f","%f");
|
||||
// sprintf(nombre,"%f",theMaxLineWeight);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamReal,0);
|
||||
|
||||
MakeHollerith (theDate,text,lt);
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
|
||||
Interface_FloatWriter::Convert (theResolution,nombre,Standard_True,0.,0.,"%g","%g");
|
||||
// sprintf(nombre,"%f",theResolution);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamReal,0);
|
||||
|
||||
if (hasMaxCoord)
|
||||
Interface_FloatWriter::Convert (theMaxCoord,nombre,Standard_True,0.,0.,"%f","%f");
|
||||
// sprintf(nombre,"%f",theMaxCoord);
|
||||
else nombre[0] = '\0';
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamReal,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamReal,0);
|
||||
|
||||
MakeHollerith (theAuthorName,text,lt);
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
@ -367,10 +367,10 @@ Handle(Interface_ParamSet) IGESData_GlobalSection::Params () const
|
||||
res->Append (text,lt, Interface_ParamText,0);
|
||||
|
||||
sprintf(nombre,"%d",theIGESVersion);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
sprintf(nombre,"%d",theDraftingStandard);
|
||||
res->Append (nombre,strlen(nombre),Interface_ParamInteger,0);
|
||||
res->Append (nombre,(Standard_Integer)strlen(nombre),Interface_ParamInteger,0);
|
||||
|
||||
if (!theLastChangeDate.IsNull()) {
|
||||
MakeHollerith (theLastChangeDate,text,lt);
|
||||
|
@ -51,7 +51,7 @@ IGESData_IGESReaderData::IGESData_IGESReaderData
|
||||
void IGESData_IGESReaderData::AddGlobal
|
||||
(const Interface_ParamType atype, const Standard_CString aval)
|
||||
{
|
||||
theparh->Append(aval,strlen(aval),atype,0);
|
||||
theparh->Append(aval,(int)strlen(aval),atype,0);
|
||||
}
|
||||
|
||||
void IGESData_IGESReaderData::SetGlobalSection ()
|
||||
|
@ -95,10 +95,10 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
|
||||
//
|
||||
pstartline=(Standard_PCharacter)startline;
|
||||
//
|
||||
Standard_Integer lst = strlen (startline);
|
||||
Standard_Size lst = strlen (startline);
|
||||
if (lst == 0) return;
|
||||
if (thestar.IsNull()) thestar = new TColStd_HSequenceOfHAsciiString();
|
||||
if (lst <= MaxcarsG) {
|
||||
if (lst <= (Standard_Size)MaxcarsG) {
|
||||
thestar->Append (new TCollection_HAsciiString(startline));
|
||||
return;
|
||||
}
|
||||
@ -349,7 +349,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
|
||||
const Standard_Integer more)
|
||||
{
|
||||
Standard_Integer lnstr = lnval;
|
||||
if (lnstr <= 0) lnstr = strlen(val);
|
||||
if (lnstr <= 0) lnstr = (Standard_Integer)strlen(val);
|
||||
if (!thecurr.CanGet (lnstr + more + 1)) {
|
||||
// + 1 (18-SEP-1996) pour etre sur que le separateur n est pas en tete de ligne
|
||||
if (thesect < 3) thehead->Append(thecurr.Moved());
|
||||
|
@ -222,12 +222,13 @@ void iges_newparam (int typarg, int longval, char *parval)
|
||||
/* Complement du parametre courant (cf Hollerith sur +ieurs lignes) */
|
||||
void iges_addparam (int longval, char* parval)
|
||||
{
|
||||
char *newval, *oldval; int i,long0;
|
||||
char *newval, *oldval; int i;
|
||||
size_t long0;
|
||||
if (longval <= 0) return;
|
||||
oldval = curparam->parval;
|
||||
long0 = strlen(oldval);
|
||||
/* newval = (char*) malloc(long0+longval+1); */
|
||||
newval = iges_newchar("",long0+longval+1);
|
||||
newval = iges_newchar("",(int)long0+longval+1);
|
||||
for (i = 0; i < long0; i ++) newval[i] = oldval[i];
|
||||
for (i = 0; i < longval; i ++) newval[i+long0] = parval[i];
|
||||
newval[long0+longval] = '\0';
|
||||
|
@ -431,8 +431,8 @@ Standard_Integer Image_Diff::ignoreBorderEffect()
|
||||
if (myGroupsOfDiffPixels.IsEmpty())
|
||||
{
|
||||
TColStd_MapOfInteger* aGroup = new TColStd_MapOfInteger();
|
||||
aGroup->Add (aValue1);
|
||||
aGroup->Add (aValue2);
|
||||
aGroup->Add ((Standard_Integer)aValue1);
|
||||
aGroup->Add ((Standard_Integer)aValue2);
|
||||
myGroupsOfDiffPixels.Append (aGroup);
|
||||
}
|
||||
else
|
||||
@ -442,9 +442,9 @@ Standard_Integer Image_Diff::ignoreBorderEffect()
|
||||
for (ListOfMapOfInteger::Iterator aGrIter (myGroupsOfDiffPixels); aGrIter.More(); aGrIter.Next())
|
||||
{
|
||||
TColStd_MapOfInteger*& aGroup = aGrIter.ChangeValue();
|
||||
if (aGroup->Contains (aValue1))
|
||||
if (aGroup->Contains ((Standard_Integer)aValue1))
|
||||
{
|
||||
aGroup->Add (aValue2);
|
||||
aGroup->Add ((Standard_Integer)aValue2);
|
||||
isFound = Standard_True;
|
||||
break;
|
||||
}
|
||||
@ -454,8 +454,8 @@ Standard_Integer Image_Diff::ignoreBorderEffect()
|
||||
{
|
||||
// Create a new group
|
||||
TColStd_MapOfInteger* aGroup = new TColStd_MapOfInteger();
|
||||
aGroup->Add (aValue1);
|
||||
aGroup->Add (aValue2);
|
||||
aGroup->Add ((Standard_Integer)aValue1);
|
||||
aGroup->Add ((Standard_Integer)aValue2);
|
||||
myGroupsOfDiffPixels.Append (aGroup);
|
||||
}
|
||||
}
|
||||
@ -480,7 +480,7 @@ Standard_Integer Image_Diff::ignoreBorderEffect()
|
||||
for (Standard_Size aNgbrIter = 0; aNgbrIter < NEIGHBOR_PIXELS_NB; ++aNgbrIter)
|
||||
{
|
||||
if (NEIGHBOR_PIXELS[aNgbrIter].isValid (aDataRef, aRow1, aCol1)
|
||||
&& aGroup->Contains (NEIGHBOR_PIXELS[aNgbrIter].pixel2Int (aRow1, aCol1)))
|
||||
&& aGroup->Contains ((Standard_Integer)NEIGHBOR_PIXELS[aNgbrIter].pixel2Int (aRow1, aCol1)))
|
||||
{
|
||||
++aNeighboursNb;
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
|
||||
if(( (Dup*UV1mUtest + Dvp*UV2mVtest) < 0) ||
|
||||
( Abs(UV1mUtest) < tolu
|
||||
&& Abs(UV2mVtest) < tolv)) {
|
||||
i_candidates.Append(i);
|
||||
i_candidates.Append((Standard_Integer)i);
|
||||
SqDist_candidates.Append(Dup*Dup + Dvp*Dvp);
|
||||
/*
|
||||
Irang=i;
|
||||
@ -319,7 +319,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
|
||||
(Vp-Vmult(j))*(UV(2)-Vmult(j)) < 0) ||
|
||||
(Abs(UV(1)-Umult(j)) < tolu &&
|
||||
Abs(UV(2)-Vmult(j)) < tolv)) {
|
||||
Irang=i;
|
||||
Irang=(Standard_Integer)i;
|
||||
Arrive = Standard_True;
|
||||
UV(1) = Utest;
|
||||
UV(2) = Vtest;
|
||||
|
@ -71,10 +71,7 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
|
||||
const Standard_CString aval, const Interface_ParamType atype,
|
||||
const Standard_Integer nument)
|
||||
{
|
||||
// Interface_FileParameter FP;
|
||||
// FP.Init(aval,atype);
|
||||
theparams->Append(aval,-1,atype,nument);
|
||||
//thenbpar(num) ++; // SetValue(num,thenbpar(num)+1);
|
||||
}
|
||||
|
||||
void Interface_FileReaderData::AddParam
|
||||
@ -82,10 +79,7 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
|
||||
const TCollection_AsciiString& aval, const Interface_ParamType atype,
|
||||
const Standard_Integer nument)
|
||||
{
|
||||
// Interface_FileParameter FP;
|
||||
// FP.Init(aval,atype);
|
||||
theparams->Append(aval.ToCString(),aval.Length(),atype,nument);
|
||||
//thenbpar(num) ++; // .SetValue(num,thenbpar(num)+1);
|
||||
}
|
||||
|
||||
void Interface_FileReaderData::AddParam
|
||||
@ -93,7 +87,6 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
|
||||
const Interface_FileParameter& FP)
|
||||
{
|
||||
theparams->Append(FP);
|
||||
//thenbpar(num) ++; // .SetValue(num,thenbpar(num)+1);
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +94,6 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
|
||||
(const Standard_Integer num, const Standard_Integer nump,
|
||||
const Interface_FileParameter& FP)
|
||||
{
|
||||
//if (nump <= thenbpar.Value(num))
|
||||
theparams->SetParam(thenumpar(num-1)+nump,FP);
|
||||
}
|
||||
|
||||
@ -109,7 +101,7 @@ Interface_FileReaderData::Interface_FileReaderData (const Standard_Integer nbr,
|
||||
(const Standard_Integer num) const
|
||||
{
|
||||
if (num > 1) return (thenumpar(num) - thenumpar(num-1));
|
||||
else if(num ==1) return thenumpar(num); //thenbpar(num);
|
||||
else if(num ==1) return thenumpar(num);
|
||||
else return theparams->NbParams();
|
||||
}
|
||||
|
||||
|
@ -154,5 +154,5 @@ Standard_Integer Interface_FloatWriter::Convert (const Standard_Real val,
|
||||
pText[j0+5] = lxp[4];
|
||||
pText[j0+6] = '\0';
|
||||
}
|
||||
return strlen(text);
|
||||
return (Standard_Integer)strlen(text);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ Interface_LineBuffer::Interface_LineBuffer (const Standard_Integer size)
|
||||
// .... AJOUTS ....
|
||||
|
||||
void Interface_LineBuffer::Add (const Standard_CString text)
|
||||
{ Add (text,strlen(text)); }
|
||||
{ Add (text,(Standard_Integer)strlen(text)); }
|
||||
|
||||
void Interface_LineBuffer::Add
|
||||
(const Standard_CString text, const Standard_Integer lntext)
|
||||
|
@ -55,7 +55,7 @@ Standard_Integer Interface_ParamSet::Append (const Standard_CString val, const
|
||||
Standard_Integer i;
|
||||
if (thelnval + lnval + 1 > thelnres) {
|
||||
// Reservation de caracteres insuffisante : d abord augmenter
|
||||
Standard_Integer newres = thelnres*2 + lnval ;
|
||||
Standard_Integer newres = (Standard_Integer)(thelnres*2 + lnval);
|
||||
char* newval = new char[newres];
|
||||
for (i = 0; i < thelnval; i++)
|
||||
newval[i] = theval[i]; //szv#4:S4163:12Mar99 `<= thelnres` was wrong
|
||||
@ -88,7 +88,7 @@ Standard_Integer Interface_ParamSet::Append (const Standard_CString val, const
|
||||
Interface_FileParameter& FP = thelist->ChangeValue(thenbpar);
|
||||
FP.Init(&theval[thelnval],typ);
|
||||
if (nument != 0) FP.SetEntityNumber(nument);
|
||||
thelnval += (lnval+1);
|
||||
thelnval += (Standard_Integer)(lnval+1);
|
||||
}
|
||||
return thenbpar;
|
||||
}
|
||||
|
@ -132,7 +132,10 @@ __declspec( dllexport ) long InterfaceGraphic_RealizePalette ( HDC hdc, HPALETTE
|
||||
|
||||
} // end else
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4306) /* level 4 warning on cast of int to HWND in HWND_BROADCAST macro */
|
||||
PostMessage ( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0 );
|
||||
#pragma warning(pop)
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -77,7 +77,7 @@ int cPrintf ( char* fmt, ... ) {
|
||||
va_start( argptr, fmt );
|
||||
cnt = vsprintf ( buffer, fmt, argptr );
|
||||
va_end ( argptr );
|
||||
WriteConsole ( hConsole, buffer, strlen ( buffer ), &lpcchWritten, NULL );
|
||||
WriteConsole ( hConsole, buffer, (DWORD) strlen ( buffer ), &lpcchWritten, NULL );
|
||||
return cnt;
|
||||
|
||||
} /* end cPrintf */
|
||||
@ -105,7 +105,7 @@ int fcPrintf ( int /*dummy*/, char* fmt, ... ) {
|
||||
va_start( argptr, fmt );
|
||||
cnt = vsprintf ( buffer, fmt, argptr );
|
||||
va_end ( argptr );
|
||||
WriteConsole ( hConsole, buffer, strlen ( buffer ), &lpcchWritten, NULL );
|
||||
WriteConsole ( hConsole, buffer, (DWORD )strlen ( buffer ), &lpcchWritten, NULL );
|
||||
|
||||
return cnt;
|
||||
|
||||
|
@ -56,7 +56,7 @@ LDOMString::LDOMString (const LDOMBasicString& anOther,
|
||||
case LDOM_AsciiDoc:
|
||||
{
|
||||
const char * aString = anOther.GetString ();
|
||||
Standard_Integer aLen = strlen (aString) + 1;
|
||||
Standard_Integer aLen = (Standard_Integer)(strlen (aString) + 1);
|
||||
myVal.ptr = ((LDOM_MemManager *) myPtrDoc) -> Allocate (aLen);
|
||||
memcpy (myVal.ptr, aString, aLen);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ LDOM_BasicAttribute& LDOM_BasicAttribute::Create
|
||||
|
||||
const char * aString = theName.GetString();
|
||||
aNewAtt -> myName =
|
||||
theDoc -> HashedAllocate (aString, strlen(aString), theHash);
|
||||
theDoc -> HashedAllocate (aString, (Standard_Integer)strlen(aString), theHash);
|
||||
|
||||
aNewAtt -> myNodeType = LDOM_Node::ATTRIBUTE_NODE;
|
||||
return * aNewAtt;
|
||||
|
@ -277,7 +277,7 @@ const LDOM_BasicNode * LDOM_BasicElement::RemoveAttribute
|
||||
// Check attribute hash value against the current mask
|
||||
const char * const aNameStr = aName.GetString();
|
||||
const Standard_Integer aHash =
|
||||
LDOM_MemManager::Hash (aNameStr, strlen(aNameStr));
|
||||
LDOM_MemManager::Hash (aNameStr, (Standard_Integer)strlen(aNameStr));
|
||||
const unsigned int anAttrMaskValue = aHash & (8*sizeof(myAttributeMask) - 1);
|
||||
const unsigned long anAttributeMask = (1 << anAttrMaskValue);
|
||||
#ifdef DEBUG_MASK
|
||||
@ -422,7 +422,7 @@ void LDOM_BasicElement::ReplaceElement
|
||||
const LDOM_BasicElement& aBNodeElem = *(const LDOM_BasicElement*)aBNode;
|
||||
const char * aTagString = aBNodeElem.GetTagName();
|
||||
LDOM_BasicElement& aNewBNodeElem =
|
||||
LDOM_BasicElement::Create (aTagString, strlen(aTagString), aDocument);
|
||||
LDOM_BasicElement::Create (aTagString, (Standard_Integer)strlen(aTagString), aDocument);
|
||||
aNewBNodeElem.ReplaceElement (aBNodeElem, aDocument); //reccur
|
||||
aNewBNode = &aNewBNodeElem;
|
||||
break;
|
||||
|
@ -61,15 +61,15 @@ char * LDOM_CharReference::Decode (char * theSrc, Standard_Integer& theLen)
|
||||
// End of the loop
|
||||
aPtr = strchr (aSrcPtr, '\0');
|
||||
if (anIncrCount == 0)
|
||||
theLen = aPtr - theSrc;
|
||||
theLen = (Standard_Integer)(aPtr - theSrc);
|
||||
else {
|
||||
Standard_Integer aByteCount = aPtr - aSrcPtr;
|
||||
Standard_Integer aByteCount = (Standard_Integer)(aPtr - aSrcPtr);
|
||||
memmove (aDstPtr, aSrcPtr, aByteCount + 1);
|
||||
theLen = (aDstPtr - theSrc) + aByteCount;
|
||||
theLen = (Standard_Integer)(aDstPtr - theSrc) + aByteCount;
|
||||
}
|
||||
break;
|
||||
}
|
||||
Standard_Integer aByteCount = aPtr - aSrcPtr;
|
||||
Standard_Integer aByteCount = (Standard_Integer)(aPtr - aSrcPtr);
|
||||
if (aByteCount > 0 && aDstPtr != aSrcPtr)
|
||||
memmove (aDstPtr, aSrcPtr, aByteCount);
|
||||
aSrcPtr = aPtr;
|
||||
@ -85,7 +85,7 @@ char * LDOM_CharReference::Decode (char * theSrc, Standard_Integer& theLen)
|
||||
// Error reading an XML string
|
||||
return NULL;
|
||||
aDstPtr[-1] = (char) aChar;
|
||||
anIncrCount += aNewPtr - aSrcPtr;
|
||||
anIncrCount += (Standard_Integer)(aNewPtr - aSrcPtr);
|
||||
aSrcPtr = &aNewPtr[1];
|
||||
}
|
||||
else if (IS_EQUAL(aSrcPtr+1, "amp;")) {
|
||||
@ -167,7 +167,7 @@ char * LDOM_CharReference::Encode (const char* theSrc, Standard_Integer& theLen,
|
||||
}
|
||||
// If there are such, copy the string with replacements
|
||||
if (!aCount)
|
||||
theLen = endSrc - theSrc;
|
||||
theLen = (Standard_Integer)(endSrc - theSrc);
|
||||
else {
|
||||
char * ptrDest = new char [(endSrc - theSrc) + aCount * 5 + 1];
|
||||
aDest = ptrDest;
|
||||
@ -188,7 +188,7 @@ char * LDOM_CharReference::Encode (const char* theSrc, Standard_Integer& theLen,
|
||||
ptrDest += entity_ref[aCode].length;
|
||||
}
|
||||
}
|
||||
theLen = ptrDest - aDest;
|
||||
theLen = (Standard_Integer)(ptrDest - aDest);
|
||||
* ptrDest = '\0';
|
||||
}
|
||||
return aDest;
|
||||
|
@ -78,6 +78,6 @@ void LDOM_CharacterData::setData (const LDOMString& theValue)
|
||||
Standard_Integer LDOM_CharacterData::getLength () const
|
||||
{
|
||||
if (myLength < 0)
|
||||
(Standard_Integer&)myLength = strlen (getNodeValue().GetString());
|
||||
(Standard_Integer&)myLength = (Standard_Integer)strlen (getNodeValue().GetString());
|
||||
return myLength;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ LDOM_Document LDOM_Document::createDocument (const LDOMString& theQualifiedName)
|
||||
if (strlen(aString) == 0)
|
||||
aString = "document";
|
||||
aDoc.myMemManager -> myRootElement =
|
||||
& LDOM_BasicElement::Create (aString, strlen(aString), aDoc.myMemManager);
|
||||
& LDOM_BasicElement::Create (aString, (Standard_Integer)strlen(aString), aDoc.myMemManager);
|
||||
return aDoc;
|
||||
}
|
||||
|
||||
@ -121,7 +121,7 @@ LDOM_Element LDOM_Document::createElement (const LDOMString& theTagName)
|
||||
{
|
||||
const char * aTagString = theTagName.GetString();
|
||||
LDOM_BasicElement& aBasicElem = LDOM_BasicElement::Create (aTagString,
|
||||
strlen(aTagString),
|
||||
(Standard_Integer)strlen(aTagString),
|
||||
myMemManager);
|
||||
return LDOM_Element (aBasicElem, myMemManager);
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void * LDOM_MemManager::MemBlock::AllocateAndCheck
|
||||
const LDOM_MemManager::MemBlock *& aFirstWithoutRoom)
|
||||
{
|
||||
void * aResult = NULL;
|
||||
Standard_Integer aRoom = myEndBlock - myFreeSpace;
|
||||
Standard_Integer aRoom = (Standard_Integer)(myEndBlock - myFreeSpace);
|
||||
if (aSize <= aRoom) {
|
||||
aResult = myFreeSpace;
|
||||
myFreeSpace += aSize;
|
||||
|
@ -120,7 +120,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
|
||||
// Check if the current file buffer is exhausted
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// There should always be some bytes available in the buffer for analysis
|
||||
Standard_Integer aBytesRest = myEndPtr - myPtr;
|
||||
Standard_Integer aBytesRest = (Standard_Integer)(myEndPtr - myPtr);
|
||||
if (aBytesRest < XML_MIN_BUFFER) {
|
||||
if (myEOF == Standard_True) {
|
||||
if (aBytesRest <= 0)
|
||||
@ -202,7 +202,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
|
||||
myPtr = aNameEnd;
|
||||
if (myPtr < myEndPtr) {
|
||||
myElement = & LDOM_BasicElement::Create (aStartData,
|
||||
myPtr - aStartData,
|
||||
(Standard_Integer)(myPtr - aStartData),
|
||||
myDocument);
|
||||
myLastChild = NULL;
|
||||
aState = STATE_ATTRIBUTE_NAME;
|
||||
@ -408,7 +408,7 @@ LDOM_XmlReader::RecordType LDOM_XmlReader::ReadRecord
|
||||
aStartData = myPtr;
|
||||
else {
|
||||
if (theData.Length() == 0)
|
||||
anAttrName = LDOMBasicString(myPtr, aNameEnd - myPtr, myDocument);
|
||||
anAttrName = LDOMBasicString(myPtr, (Standard_Integer)(aNameEnd - myPtr), myDocument);
|
||||
else {
|
||||
theData.rdbuf()->sputn(myPtr, aNameEnd - myPtr);
|
||||
attr_name:
|
||||
|
@ -97,7 +97,7 @@ is
|
||||
myEntry : Address ; -- unused by Windows NT code
|
||||
myInit : Integer ; -- unused by Windows NT code
|
||||
myError : Error;
|
||||
myHandle : Integer; -- Windows NT specific
|
||||
myHandle : Address; -- Windows NT specific
|
||||
myData : Address; -- Windows NT specific
|
||||
myFirstCall : Boolean; -- Windows NT specific
|
||||
end DirectoryIterator from OSD;
|
||||
|
@ -208,7 +208,7 @@ OSD_DirectoryIterator :: OSD_DirectoryIterator (
|
||||
) {
|
||||
|
||||
myFlag = Standard_False;
|
||||
myHandle = ( Standard_Integer )INVALID_HANDLE_VALUE;
|
||||
myHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
where.SystemName ( myPlace );
|
||||
|
||||
@ -223,7 +223,7 @@ void OSD_DirectoryIterator :: Destroy () {
|
||||
|
||||
if ( myData != NULL ) HeapFree ( GetProcessHeap (), 0, myData );
|
||||
|
||||
if ( myHandle != ( Standard_Integer )INVALID_HANDLE_VALUE )
|
||||
if ( myHandle != INVALID_HANDLE_VALUE )
|
||||
|
||||
FindClose ( ( HANDLE )myHandle );
|
||||
|
||||
@ -231,7 +231,7 @@ void OSD_DirectoryIterator :: Destroy () {
|
||||
|
||||
Standard_Boolean OSD_DirectoryIterator :: More () {
|
||||
|
||||
if ( myHandle == ( Standard_Integer )INVALID_HANDLE_VALUE ) {
|
||||
if ( myHandle == INVALID_HANDLE_VALUE ) {
|
||||
|
||||
TCollection_AsciiString wc = myPlace + TEXT( "/" ) + myMask;
|
||||
|
||||
@ -239,13 +239,11 @@ Standard_Boolean OSD_DirectoryIterator :: More () {
|
||||
GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, sizeof ( WIN32_FIND_DATA )
|
||||
);
|
||||
|
||||
myHandle = ( Standard_Integer )FindFirstFile (
|
||||
wc.ToCString (), ( PWIN32_FIND_DATA )myData
|
||||
);
|
||||
myHandle = FindFirstFile (wc.ToCString (), (PWIN32_FIND_DATA)myData);
|
||||
|
||||
if ( myHandle == ( Standard_Integer )INVALID_HANDLE_VALUE )
|
||||
|
||||
_osd_wnt_set_error ( myError, OSD_WDirectoryIterator );
|
||||
if ( myHandle == INVALID_HANDLE_VALUE )
|
||||
|
||||
_osd_wnt_set_error ( myError, OSD_WDirectoryIterator );
|
||||
|
||||
else {
|
||||
|
||||
@ -259,7 +257,7 @@ Standard_Boolean OSD_DirectoryIterator :: More () {
|
||||
} else if ( !myFlag ) {
|
||||
|
||||
FindClose ( ( HANDLE )myHandle );
|
||||
myHandle = ( Standard_Integer )INVALID_HANDLE_VALUE;
|
||||
myHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -96,7 +96,7 @@ is
|
||||
myEntry : Address ; -- unused by Windows NT code
|
||||
myInit : Integer ; -- unused by Windows NT code
|
||||
myError : Error;
|
||||
myHandle : Integer; -- Windows NT specific
|
||||
myHandle : Address; -- Windows NT specific
|
||||
myData : Address; -- Windows NT specific
|
||||
myFirstCall : Boolean; -- Windows NT specific
|
||||
end FileIterator from OSD;
|
||||
|
@ -292,7 +292,7 @@ OSD_FileIterator :: OSD_FileIterator (
|
||||
) {
|
||||
|
||||
myFlag = Standard_False;
|
||||
myHandle = ( Standard_Integer )INVALID_HANDLE_VALUE;
|
||||
myHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
where.SystemName ( myPlace );
|
||||
|
||||
@ -307,7 +307,7 @@ void OSD_FileIterator :: Destroy () {
|
||||
|
||||
if ( myData != NULL ) HeapFree ( GetProcessHeap (), 0, myData );
|
||||
|
||||
if ( myHandle != ( Standard_Integer )INVALID_HANDLE_VALUE )
|
||||
if ( myHandle != INVALID_HANDLE_VALUE )
|
||||
|
||||
FindClose ( ( HANDLE )myHandle );
|
||||
|
||||
@ -315,7 +315,7 @@ void OSD_FileIterator :: Destroy () {
|
||||
|
||||
Standard_Boolean OSD_FileIterator :: More () {
|
||||
|
||||
if ( myHandle == ( Standard_Integer )INVALID_HANDLE_VALUE ) {
|
||||
if ( myHandle == INVALID_HANDLE_VALUE ) {
|
||||
|
||||
TCollection_AsciiString wc = myPlace + TEXT( "/" ) + myMask;
|
||||
|
||||
@ -323,11 +323,9 @@ Standard_Boolean OSD_FileIterator :: More () {
|
||||
GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, sizeof ( WIN32_FIND_DATA )
|
||||
);
|
||||
|
||||
myHandle = ( Standard_Integer )FindFirstFile (
|
||||
wc.ToCString (), ( PWIN32_FIND_DATA )myData
|
||||
);
|
||||
myHandle = FindFirstFile (wc.ToCString (), (PWIN32_FIND_DATA)myData);
|
||||
|
||||
if ( myHandle == ( Standard_Integer )INVALID_HANDLE_VALUE )
|
||||
if ( myHandle == INVALID_HANDLE_VALUE )
|
||||
|
||||
_osd_wnt_set_error ( myError, OSD_WDirectoryIterator );
|
||||
|
||||
@ -343,7 +341,7 @@ Standard_Boolean OSD_FileIterator :: More () {
|
||||
} else if ( !myFlag ) {
|
||||
|
||||
FindClose ( ( HANDLE )myHandle );
|
||||
myHandle = ( Standard_Integer )INVALID_HANDLE_VALUE;
|
||||
myHandle = INVALID_HANDLE_VALUE;
|
||||
|
||||
} // end if
|
||||
|
||||
|
@ -53,7 +53,7 @@ static Standard_Real cnvreal;
|
||||
static int intstr(Standard_Integer V,Standard_CString F)
|
||||
{
|
||||
sprintf(cnvbuf,F,V);
|
||||
return strlen(cnvbuf);
|
||||
return (int)strlen(cnvbuf);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@ -62,7 +62,7 @@ static int intstr(Standard_Integer V,Standard_CString F)
|
||||
static int realstr(Standard_Real V, Standard_CString F)
|
||||
{
|
||||
sprintf(cnvbuf,F,V);
|
||||
return strlen(cnvbuf);
|
||||
return (int)strlen(cnvbuf);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
@ -2391,7 +2391,7 @@ static int StackOverflow(int i = -1)
|
||||
si = 0;
|
||||
memcpy(arr,sarr,2000);
|
||||
arr[1999]=0;
|
||||
int n = strlen(arr), s=0;
|
||||
int n = (int)strlen(arr), s=0;
|
||||
while (n--)
|
||||
s += StackOverflow(i-1);
|
||||
return i + s + StackOverflow(i-1);
|
||||
|
@ -51,7 +51,8 @@ void CompSparseArray (const Standard_Integer theRep, const Standard_Integer theS
|
||||
PERF_STOP_METER("NCollection_SparseArray filling")
|
||||
|
||||
PERF_START_METER("NCollection_SparseArray size")
|
||||
Standard_Integer sizeSparseArray=a1.Size();
|
||||
Standard_Size sizeSparseArray=a1.Size();
|
||||
(void)sizeSparseArray; // avoid compiler warning on unused variable
|
||||
PERF_STOP_METER("NCollection_SparseArray size")
|
||||
|
||||
PERF_START_METER("NCollection_Array1 Assign")
|
||||
|
@ -78,7 +78,7 @@ void StepData_UndefinedEntity::ReadRecord(const Handle(StepData_StepReaderData)&
|
||||
}
|
||||
else if (partyp == Interface_ParamText) {
|
||||
// Return integre a supprimer silya
|
||||
Standard_Integer lval = strlen(val); Standard_Integer mval = -1;
|
||||
Standard_Integer lval = (Standard_Integer)strlen(val); Standard_Integer mval = -1;
|
||||
for (Standard_Integer j = 0; j < lval; j ++) {
|
||||
if (val[j] == '\n') { mval = i; break; }
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ void OthersCommands_flags(Standard_Integer& na,const char** a,TestTopOpeDraw_Dis
|
||||
iloc = i - decal;
|
||||
if(!a[iloc]) break;
|
||||
if (a[iloc][0] == '-') {
|
||||
l = strlen(a[iloc]);
|
||||
l = (Standard_Integer)strlen(a[iloc]);
|
||||
for (j=1; j<l; j++) {
|
||||
if (a[iloc][j] == 'g') tgeo=Standard_True;
|
||||
else if(!strcmp(a[iloc],"-tol")) tolflag = Standard_True;
|
||||
|
@ -132,7 +132,7 @@ class VrmlData_IndexedFaceSet : public VrmlData_Faceted
|
||||
/**
|
||||
* Set the polygons
|
||||
*/
|
||||
inline void SetPolygons (const Standard_Integer nPolygons,
|
||||
inline void SetPolygons (const Standard_Size nPolygons,
|
||||
const Standard_Integer ** thePolygons)
|
||||
{ myNbPolygons = nPolygons; myArrPolygons = thePolygons; }
|
||||
|
||||
@ -183,7 +183,7 @@ class VrmlData_IndexedFaceSet : public VrmlData_Faceted
|
||||
/**
|
||||
* Set the normals array of indice
|
||||
*/
|
||||
inline void SetNormalInd (const Standard_Integer nIndice,
|
||||
inline void SetNormalInd (const Standard_Size nIndice,
|
||||
const Standard_Integer ** theIndice)
|
||||
{ myNbNormals = nIndice; myArrNormalInd = theIndice; }
|
||||
|
||||
@ -231,7 +231,7 @@ class VrmlData_IndexedFaceSet : public VrmlData_Faceted
|
||||
/**
|
||||
* Set the colors array of indice
|
||||
*/
|
||||
inline void SetColorInd (const Standard_Integer nIndice,
|
||||
inline void SetColorInd (const Standard_Size nIndice,
|
||||
const Standard_Integer ** theIndice)
|
||||
{ myNbColors = nIndice; myArrColorInd = theIndice; }
|
||||
|
||||
@ -264,7 +264,7 @@ class VrmlData_IndexedFaceSet : public VrmlData_Faceted
|
||||
/**
|
||||
* Set the TexCoordiante array of indice
|
||||
*/
|
||||
inline void SetTextureCoordInd (const Standard_Integer nIndice,
|
||||
inline void SetTextureCoordInd (const Standard_Size nIndice,
|
||||
const Standard_Integer ** theIndice)
|
||||
{ myNbTextures = nIndice; myArrTextureInd = theIndice; }
|
||||
|
||||
|
@ -112,7 +112,7 @@ class VrmlData_IndexedLineSet : public VrmlData_Geometry
|
||||
/**
|
||||
* Set the polygons
|
||||
*/
|
||||
inline void SetPolygons (const Standard_Integer nPolygons,
|
||||
inline void SetPolygons (const Standard_Size nPolygons,
|
||||
const Standard_Integer ** thePolygons)
|
||||
{ myNbPolygons = nPolygons; myArrPolygons = thePolygons; }
|
||||
|
||||
@ -147,7 +147,7 @@ class VrmlData_IndexedLineSet : public VrmlData_Geometry
|
||||
/**
|
||||
* Set the colors array of indice
|
||||
*/
|
||||
inline void SetColorInd (const Standard_Integer nIndice,
|
||||
inline void SetColorInd (const Standard_Size nIndice,
|
||||
const Standard_Integer ** theIndice)
|
||||
{ myNbColors = nIndice; myArrColorInd = theIndice; }
|
||||
|
||||
|
@ -196,7 +196,7 @@ Standard_Boolean XmlObjMgt::GetTagEntryString
|
||||
if (aTagValue <= 0 || aPtr[0] != aQuote ||
|
||||
errno == ERANGE || errno == EINVAL)
|
||||
return Standard_False;
|
||||
Standard_Integer aLen = aPtr - &aSource[1];
|
||||
Standard_Integer aLen = (Standard_Integer)(aPtr - &aSource[1]);
|
||||
aTagEntryPtr[0] = ':';
|
||||
memcpy (&aTagEntryPtr[1], &aSource[1], aLen);
|
||||
aTagEntryPtr += (aLen + 1);
|
||||
@ -251,7 +251,7 @@ void XmlObjMgt::SetTagEntryString (XmlObjMgt_DOMString& theTarget,
|
||||
long aTagValue = strtol (aTagEntry, &ptr, 10);
|
||||
if (aTagValue <= 0 || errno == ERANGE || errno == EINVAL)
|
||||
return; // error
|
||||
Standard_Integer aTagSize = ptr - aTagEntry;
|
||||
Standard_Integer aTagSize = (Standard_Integer)(ptr - aTagEntry);
|
||||
|
||||
// Add one XPath level to the expression in aTarget
|
||||
memcpy (&aTargetPtr[0], aRefElem1, anElem1Size);
|
||||
|
@ -120,7 +120,7 @@ void XmlTObjDrivers_IntSparseArrayDriver::Paste
|
||||
TCollection_AsciiString( i );
|
||||
TCollection_AsciiString aStrIndex = TCollection_AsciiString( ITEM_VALUE ) +
|
||||
TCollection_AsciiString( i );
|
||||
theTarget.Element().setAttribute( anIdStr.ToCString(), anIt.Index() );
|
||||
theTarget.Element().setAttribute( anIdStr.ToCString(), (Standard_Integer)anIt.Index() );
|
||||
theTarget.Element().setAttribute( aStrIndex.ToCString(), anIt.Value() );
|
||||
i++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user