Commit 85752e97 authored by Dave DeMarle's avatar Dave DeMarle
Browse files

Fix may be used uninitialized warnings.

We get:
/home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx: In member function virtual bool vtkMatplotlibMathTextUtilities::StringToPath(const char*, vtkPath*, vtkTextProperty*):
/home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:728:74: warning: origin[0] may be used uninitialized in this function [-Wmaybe-uninitialized]
/home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:728:74: warning: origin[1] may be used uninitialized in this function [-Wmaybe-uninitialized]
/home/kitware/dashboards/VTK/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx:727:9: warning: hasOrigin may be used uninitialized in this function [-Wmaybe-uninitialized]

From the case: pathClosePoly code path.
I think the correct solution is to initialize the hasOrigin flag to no but I could be wrong.

Change-Id: Ia3fbc63bb0bb2898aca173ea63801e05ae8937a5
parent d9ab6e3f
......@@ -562,11 +562,11 @@ bool vtkMatplotlibMathTextUtilities::StringToPath(const char *str,
Py_ssize_t numVerts;
// Temp vars:
float origin[2];
float origin[2] = {0.0, 0.0};
float vert[2];
float delta[2] = {0.0, 0.0};
int code;
bool hasOrigin;
bool hasOrigin = false;
// Bounding box for all control points, used for justification
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment