Skip to content

Commit d204c64

Browse files
committed
Merge pull request #4206 from mdboom/cpp-warnings
Fix C++ warnings from latest clang-analyzer
2 parents 01da227 + cbbcd5c commit d204c64

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

lib/matplotlib/delaunay/natneighbors.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ void NaturalNeighbors::interpolate_unstructured(double *z, int size,
289289
int i, tri1, tri2;
290290

291291
tri1 = 0;
292-
tri2 = 0;
293292
for (i=0; i<size; i++) {
294293
tri2 = tri1;
295294
output[i] = interpolate_one(z, intx[i], inty[i], defvalue, tri2);

src/cntr.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -715,16 +715,14 @@ slit_cutter (Csite * site, int up, int pass2)
715715
double *ycp = pass2 ? site->ycp : 0;
716716
short *kcp = pass2 ? site->kcp : 0;
717717

718-
if (up)
718+
if (up && pass2)
719719
{
720720
/* upward stroke of slit proceeds up left side of slit until
721721
* it hits a boundary or a point not between the contour levels
722722
* -- this never happens on the first pass */
723723
long p1 = site->edge;
724724
int z1;
725725

726-
assert(pass2);
727-
728726
for (;;)
729727
{
730728
z1 = data[p1] & Z_VALUE;

src/numpy_cpp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ class array_view : public detail::array_view_accessors<array_view, T, ND>
495495

496496
PyObject *pyobj()
497497
{
498-
Py_INCREF(m_arr);
498+
Py_XINCREF(m_arr);
499499
return (PyObject *)m_arr;
500500
}
501501

src/py_converters.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int convert_cap(PyObject *capobj, void *capp)
119119
{
120120
const char *names[] = {"butt", "round", "projecting", NULL};
121121
int values[] = {agg::butt_cap, agg::round_cap, agg::square_cap};
122-
int result;
122+
int result = agg::butt_cap;
123123

124124
if (!convert_string_enum(capobj, "capstyle", names, values, &result)) {
125125
return 0;
@@ -133,7 +133,7 @@ int convert_join(PyObject *joinobj, void *joinp)
133133
{
134134
const char *names[] = {"miter", "round", "bevel", NULL};
135135
int values[] = {agg::miter_join_revert, agg::round_join, agg::bevel_join};
136-
int result;
136+
int result = agg::miter_join_revert;
137137

138138
if (!convert_string_enum(joinobj, "joinstyle", names, values, &result)) {
139139
return 0;

0 commit comments

Comments
 (0)