mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +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:
parent
7f4c47564c
commit
5cbfdb412f
@ -111,7 +111,7 @@ void IntTools_TopolTool::ComputeSamplePoints()
|
|||||||
myU0 = uinf;
|
myU0 = uinf;
|
||||||
myV0 = vinf;
|
myV0 = vinf;
|
||||||
|
|
||||||
Standard_Integer nbsu,nbsv;
|
Standard_Integer nbsu = 0,nbsv = 0;
|
||||||
GeomAbs_SurfaceType typS = myS->GetType();
|
GeomAbs_SurfaceType typS = myS->GetType();
|
||||||
|
|
||||||
switch(typS) {
|
switch(typS) {
|
||||||
|
@ -1003,11 +1003,11 @@ static Standard_Integer BUC60724(Draw_Interpretor& di, Standard_Integer /*argc*/
|
|||||||
{
|
{
|
||||||
TCollection_AsciiString as1("");
|
TCollection_AsciiString as1("");
|
||||||
TCollection_AsciiString as2('\0');
|
TCollection_AsciiString as2('\0');
|
||||||
if((as1.ToCString()!=NULL) || (as1.ToCString() != ""))
|
if(as1.ToCString() == NULL || as1.Length() != 0 || as1.ToCString()[0] != '\0')
|
||||||
di << "Faulty : the first string is not zero string : " << as1.ToCString() << "\n";
|
di << "Error : the first string is not zero string : " << as1.ToCString() << "\n";
|
||||||
|
|
||||||
if((as2.ToCString()!=NULL) || (as2.ToCString() != ""))
|
if(as2.ToCString() == NULL || as2.Length() != 0 || as2.ToCString()[0] != '\0')
|
||||||
di << "Faulty : the second string is not zero string : " << as2.ToCString() << "\n";
|
di << "Error : the second string is not zero string : " << as2.ToCString() << "\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ void ShapeAnalysis_TransferParameters::Init(const TopoDS_Edge& E, const TopoDS_F
|
|||||||
{
|
{
|
||||||
myScale = 1.;
|
myScale = 1.;
|
||||||
myShift = 0.;
|
myShift = 0.;
|
||||||
Standard_Real l,f,l2d,f2d;
|
Standard_Real l,f,l2d = 0.0,f2d = 0.0;
|
||||||
TopLoc_Location L;
|
TopLoc_Location L;
|
||||||
myEdge = E;
|
myEdge = E;
|
||||||
ShapeAnalysis_Edge sae;
|
ShapeAnalysis_Edge sae;
|
||||||
|
@ -308,7 +308,7 @@ int MaxColor,BasePixel,MaxUserColor,MaxDefineColor,FirstFreeColorIndex,visualid
|
|||||||
Standard_Integer Xw_ColorMap::MaxOverlayColors( ) const {
|
Standard_Integer Xw_ColorMap::MaxOverlayColors( ) const {
|
||||||
Aspect_Handle *VisualInfo ;
|
Aspect_Handle *VisualInfo ;
|
||||||
Xw_TypeOfVisual VisualClass ;
|
Xw_TypeOfVisual VisualClass ;
|
||||||
int MaxColor,BasePixel,MaxUserColor,MaxDefineColor,FirstFreeColorIndex,visualid ;
|
int MaxColor,BasePixel,MaxDefineColor,FirstFreeColorIndex,visualid, MaxUserColor = 0;
|
||||||
|
|
||||||
status = XW_ERROR;
|
status = XW_ERROR;
|
||||||
if( MyExtendedOverlayColorMap ) {
|
if( MyExtendedOverlayColorMap ) {
|
||||||
|
@ -64,8 +64,8 @@ XW_EXT_WINDOW *pwindow = (XW_EXT_WINDOW*)awindow;
|
|||||||
XW_EXT_IMAGEDATA *pimage ;
|
XW_EXT_IMAGEDATA *pimage ;
|
||||||
XW_EXT_COLORMAP *pcolormap ;
|
XW_EXT_COLORMAP *pcolormap ;
|
||||||
//int i,pad ;
|
//int i,pad ;
|
||||||
int pad ;
|
int pad = 0;
|
||||||
char *cdata ;
|
char *cdata = NULL;
|
||||||
|
|
||||||
if( !Xw_isdefine_window(pwindow) ) {
|
if( !Xw_isdefine_window(pwindow) ) {
|
||||||
/*ERROR*Bad EXT_WINDOW Address*/
|
/*ERROR*Bad EXT_WINDOW Address*/
|
||||||
@ -100,8 +100,10 @@ char *cdata ;
|
|||||||
return (NULL) ;
|
return (NULL) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(pimage = Xw_add_imagedata_structure(sizeof(XW_EXT_IMAGEDATA))) )
|
if( !(pimage = Xw_add_imagedata_structure(sizeof(XW_EXT_IMAGEDATA))) ) {
|
||||||
return (NULL) ;
|
Xw_free(cdata);
|
||||||
|
return (NULL) ;
|
||||||
|
}
|
||||||
|
|
||||||
pimage->pimageinfo = aimageinfo ;
|
pimage->pimageinfo = aimageinfo ;
|
||||||
pimage->pcolormap = pcolormap = _COLORMAP ;
|
pimage->pcolormap = pcolormap = _COLORMAP ;
|
||||||
|
@ -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 "=========="
|
||||||
puts "BUC60724"
|
puts "BUC60724"
|
||||||
puts "=========="
|
puts "=========="
|
||||||
|
Loading…
x
Reference in New Issue
Block a user