]> OCCT Git - occt.git/commitdiff
0032677: Coding Rules, Geom_BezierSurface - eliminate GCC warning -Wmaybe-uninitializ...
authorkgv <kgv@opencascade.com>
Sun, 21 Nov 2021 22:54:20 +0000 (01:54 +0300)
committersmoskvin <smoskvin@opencascade.com>
Mon, 22 Nov 2021 16:02:55 +0000 (19:02 +0300)
Fixed initialization of TColStd_Array1OfReal for weights.

src/Geom/Geom_BezierSurface.cxx

index d0416d48b920c92ae9b59b7bf3e898410a1a3a76..976c141e683e90f87ef16d4e0f641a84add8b850 100644 (file)
@@ -739,14 +739,12 @@ void Geom_BezierSurface::InsertPoleRowAfter (const Standard_Integer UIndex,
 
   Handle(TColStd_HArray2OfReal) nweights;
 
-  if (urational || vrational) {
-    nweights = 
-      new TColStd_HArray2OfReal(1,poles->ColLength()+1,1,poles->RowLength());
+  if (urational || vrational)
+  {
+    nweights = new TColStd_HArray2OfReal(1,poles->ColLength()+1,1,poles->RowLength());
 
-//    TColStd_Array1OfReal CWeights(nweights->LowerCol(),nweights->UpperCol(),
-//                               1.0); ???????????
-    TColStd_Array1OfReal CWeights(1.0,
-                                  nweights->LowerCol(),nweights->UpperCol());
+    TColStd_Array1OfReal CWeights (nweights->LowerCol(), nweights->UpperCol());
+    CWeights.Init (1.0);
 
     AddRatPoleRow (poles->Array2(), weights->Array2(),
                   CPoles, CWeights, UIndex,