1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0023533: Unitialized variables used, IntTools_TopolTool.cxx

Also contains fixes for:

0023534: Unitialized variables used, ShapeAnalysis_TransferParameters.cxx
0023537: Uninitialized variable: MaxUserColor
0023538: Memory leak: cdata
0023557: V547 Expression 'as1.ToCString() != ""' is always true. To compare strings you should use strcmp() function. qabugs_3.cxx,
DRAW command for test bugs fclasses buc60724 corrected; test is OK now
This commit is contained in:
omy 2013-03-01 14:12:08 +04:00
parent 7f4c47564c
commit 5cbfdb412f
6 changed files with 13 additions and 14 deletions

View File

@ -111,7 +111,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
myU0 = uinf;
myV0 = vinf;
Standard_Integer nbsu,nbsv;
Standard_Integer nbsu = 0,nbsv = 0;
GeomAbs_SurfaceType typS = myS->GetType();
switch(typS) {

View File

@ -1003,11 +1003,11 @@ static Standard_Integer BUC60724(Draw_Interpretor& di, Standard_Integer /*argc*/
{
TCollection_AsciiString as1("");
TCollection_AsciiString as2('\0');
if((as1.ToCString()!=NULL) || (as1.ToCString() != ""))
di << "Faulty : the first string is not zero string : " << as1.ToCString() << "\n";
if(as1.ToCString() == NULL || as1.Length() != 0 || as1.ToCString()[0] != '\0')
di << "Error : the first string is not zero string : " << as1.ToCString() << "\n";
if((as2.ToCString()!=NULL) || (as2.ToCString() != ""))
di << "Faulty : the second string is not zero string : " << as2.ToCString() << "\n";
if(as2.ToCString() == NULL || as2.Length() != 0 || as2.ToCString()[0] != '\0')
di << "Error : the second string is not zero string : " << as2.ToCString() << "\n";
return 0;
}

View File

@ -57,7 +57,7 @@ void ShapeAnalysis_TransferParameters::Init(const TopoDS_Edge& E, const TopoDS_F
{
myScale = 1.;
myShift = 0.;
Standard_Real l,f,l2d,f2d;
Standard_Real l,f,l2d = 0.0,f2d = 0.0;
TopLoc_Location L;
myEdge = E;
ShapeAnalysis_Edge sae;

View File

@ -308,7 +308,7 @@ int MaxColor,BasePixel,MaxUserColor,MaxDefineColor,FirstFreeColorIndex,visualid
Standard_Integer Xw_ColorMap::MaxOverlayColors( ) const {
Aspect_Handle *VisualInfo ;
Xw_TypeOfVisual VisualClass ;
int MaxColor,BasePixel,MaxUserColor,MaxDefineColor,FirstFreeColorIndex,visualid ;
int MaxColor,BasePixel,MaxDefineColor,FirstFreeColorIndex,visualid, MaxUserColor = 0;
status = XW_ERROR;
if( MyExtendedOverlayColorMap ) {

View File

@ -64,8 +64,8 @@ XW_EXT_WINDOW *pwindow = (XW_EXT_WINDOW*)awindow;
XW_EXT_IMAGEDATA *pimage ;
XW_EXT_COLORMAP *pcolormap ;
//int i,pad ;
int pad ;
char *cdata ;
int pad = 0;
char *cdata = NULL;
if( !Xw_isdefine_window(pwindow) ) {
/*ERROR*Bad EXT_WINDOW Address*/
@ -100,8 +100,10 @@ char *cdata ;
return (NULL) ;
}
if( !(pimage = Xw_add_imagedata_structure(sizeof(XW_EXT_IMAGEDATA))) )
return (NULL) ;
if( !(pimage = Xw_add_imagedata_structure(sizeof(XW_EXT_IMAGEDATA))) ) {
Xw_free(cdata);
return (NULL) ;
}
pimage->pimageinfo = aimageinfo ;
pimage->pcolormap = pcolormap = _COLORMAP ;

View File

@ -1,6 +1,3 @@
puts "TODO OCC12345 ALL: Faulty : the first string is not zero string :"
puts "TODO OCC12345 ALL: Faulty : the second string is not zero string :"
puts "=========="
puts "BUC60724"
puts "=========="