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
myU0 = uinf;
myV0 = vinf;
- Standard_Integer nbsu,nbsv;
+ Standard_Integer nbsu = 0,nbsv = 0;
GeomAbs_SurfaceType typS = myS->GetType();
switch(typS) {
{
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;
}
{
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;
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 ) {
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*/
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 ;
-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 "=========="