Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 33813e6

Browse filesBrowse files
committed
Fix some compiler warnings
1 parent a093579 commit 33813e6
Copy full SHA for 33813e6

File tree

Expand file treeCollapse file tree

9 files changed

+24
-51
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+24
-51
lines changed

‎lib/matplotlib/delaunay/natneighbors.cpp

Copy file name to clipboardExpand all lines: lib/matplotlib/delaunay/natneighbors.cpp
+11-12Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ NaturalNeighbors::~NaturalNeighbors()
4242
int NaturalNeighbors::find_containing_triangle(double targetx, double targety, int start_triangle)
4343
{
4444
int final_triangle;
45-
final_triangle = walking_triangles(start_triangle, targetx, targety,
45+
final_triangle = walking_triangles(start_triangle, targetx, targety,
4646
x, y, nodes, neighbors);
4747
return final_triangle;
4848
}
@@ -115,7 +115,7 @@ double NaturalNeighbors::interpolate_one(double *z, double targetx, double targe
115115
targetx, targety,
116116
INDEX2(c, i, 0), INDEX2(c, i, 1))) {
117117

118-
// bail out with the appropriate values if we're actually on a
118+
// bail out with the appropriate values if we're actually on a
119119
// node
120120
if ((fabs(targetx - this->x[INDEX3(this->nodes, t, j)]) < TOLERANCE_EPS)
121121
&& (fabs(targety - this->y[INDEX3(this->nodes, t, j)]) < TOLERANCE_EPS)) {
@@ -138,7 +138,7 @@ double NaturalNeighbors::interpolate_one(double *z, double targetx, double targe
138138
double ati = 0.0;
139139

140140
if (!onedge || ((edge[0] != q) && edge[1] != q)) {
141-
ati = signed_area(vx, vy,
141+
ati = signed_area(vx, vy,
142142
INDEX2(c, j, 0), INDEX2(c, j, 1),
143143
INDEX2(c, k, 0), INDEX2(c, k, 1));
144144

@@ -160,11 +160,11 @@ double NaturalNeighbors::interpolate_one(double *z, double targetx, double targe
160160
// doesn't work so well. We'll take care of these two nodes here.
161161
if (onedge) {
162162

163-
// If we're on the convex hull, then the other nodes don't actually
164-
// contribute anything, just the nodes for the edge we're on. The
163+
// If we're on the convex hull, then the other nodes don't actually
164+
// contribute anything, just the nodes for the edge we're on. The
165165
// Voronoi "polygons" are infinite in extent.
166166
if (onhull) {
167-
double a = (hypot(targetx-x[edge[0]], targety-y[edge[0]]) /
167+
double a = (hypot(targetx-x[edge[0]], targety-y[edge[0]]) /
168168
hypot(x[edge[1]]-x[edge[0]], y[edge[1]]-y[edge[0]]));
169169
return (1-a) * z[edge[0]] + a*z[edge[1]];
170170
}
@@ -233,11 +233,11 @@ double NaturalNeighbors::interpolate_one(double *z, double targetx, double targe
233233

234234
for (sit = alltri0.begin(); sit != alltri0.end(); sit++) {
235235
poly0.push(INDEX2(this->centers, *sit, 0),
236-
INDEX2(this->centers, *sit, 1));
236+
INDEX2(this->centers, *sit, 1));
237237
}
238238
for (sit = alltri1.begin(); sit != alltri1.end(); sit++) {
239239
poly1.push(INDEX2(this->centers, *sit, 0),
240-
INDEX2(this->centers, *sit, 1));
240+
INDEX2(this->centers, *sit, 1));
241241
}
242242

243243
double a0 = poly0.area();
@@ -256,20 +256,19 @@ double NaturalNeighbors::interpolate_one(double *z, double targetx, double targe
256256
return f;
257257
}
258258

259-
void NaturalNeighbors::interpolate_grid(double *z,
259+
void NaturalNeighbors::interpolate_grid(double *z,
260260
double x0, double x1, int xsteps,
261261
double y0, double y1, int ysteps,
262262
double *output,
263263
double defvalue, int start_triangle)
264264
{
265-
int i, ix, iy, rowtri, coltri, tri;
265+
int ix, iy, rowtri, coltri, tri;
266266
double dx, dy, targetx, targety;
267267

268268
dx = (x1 - x0) / (xsteps-1);
269269
dy = (y1 - y0) / (ysteps-1);
270270

271271
rowtri = 0;
272-
i = 0;
273272
for (iy=0; iy<ysteps; iy++) {
274273
targety = y0 + dy*iy;
275274
rowtri = find_containing_triangle(x0, targety, rowtri);
@@ -284,7 +283,7 @@ void NaturalNeighbors::interpolate_grid(double *z,
284283
}
285284
}
286285

287-
void NaturalNeighbors::interpolate_unstructured(double *z, int size,
286+
void NaturalNeighbors::interpolate_unstructured(double *z, int size,
288287
double *intx, double *inty, double *output, double defvalue)
289288
{
290289
int i, tri1, tri2;

‎lib/matplotlib/tri/_tri.cpp

Copy file name to clipboardExpand all lines: lib/matplotlib/tri/_tri.cpp
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void Triangulation::calculate_edges()
277277
}
278278

279279
// Convert to python _edges array.
280-
npy_intp dims[2] = {edge_set.size(), 2};
280+
npy_intp dims[2] = {(npy_intp)edge_set.size(), 2};
281281
_edges = (PyArrayObject*)PyArray_SimpleNew(2, dims, PyArray_INT);
282282
int* edges_ptr = (int*)PyArray_DATA(_edges);
283283
for (EdgeSet::const_iterator it = edge_set.begin(); it != edge_set.end(); ++it) {
@@ -571,7 +571,7 @@ Py::Object TriContourGenerator::contour_to_segs(const Contour& contour)
571571
Py::List segs(contour.size());
572572
for (Contour::size_type i = 0; i < contour.size(); ++i) {
573573
const ContourLine& line = contour[i];
574-
npy_intp dims[2] = {line.size(),2};
574+
npy_intp dims[2] = {(npy_intp)line.size(),2};
575575
PyArrayObject* py_line = (PyArrayObject*)PyArray_SimpleNew(
576576
2, dims, PyArray_DOUBLE);
577577
double* p = (double*)PyArray_DATA(py_line);
@@ -1113,4 +1113,3 @@ Py::Object TriModule::new_tricontourgenerator(const Py::Tuple &args)
11131113

11141114
return Py::asObject(new TriContourGenerator(tri, z));
11151115
}
1116-

‎src/_backend_agg.cpp

Copy file name to clipboardExpand all lines: src/_backend_agg.cpp
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ BufferRegion::to_string_argb(const Py::Tuple &args)
154154
Py_ssize_t length;
155155
unsigned char* pix;
156156
unsigned char* begin;
157-
unsigned char* end;
158157
unsigned char tmp;
159158
size_t i, j;
160159

@@ -165,7 +164,6 @@ BufferRegion::to_string_argb(const Py::Tuple &args)
165164
}
166165

167166
pix = begin;
168-
end = begin + (height * stride);
169167
for (i = 0; i < (size_t)height; ++i)
170168
{
171169
pix = begin + i * stride;
@@ -2029,7 +2027,6 @@ RendererAgg::write_rgba(const Py::Tuple& args)
20292027
args.verify_length(1);
20302028

20312029
FILE *fp = NULL;
2032-
bool close_file = false;
20332030
Py::Object py_fileobj = Py::Object(args[0]);
20342031

20352032
#if PY3K
@@ -2050,7 +2047,6 @@ RendererAgg::write_rgba(const Py::Tuple& args)
20502047
throw Py::RuntimeError(
20512048
Printf("Error writing to file %s", file_name).str());
20522049
}
2053-
close_file = true;
20542050
}
20552051
#if PY3K
20562052
else if (fd != -1)

‎src/_image.cpp

Copy file name to clipboardExpand all lines: src/_image.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ Image::resize(const Py::Tuple& args, const Py::Dict& kwargs)
371371
throw Py::RuntimeError("You must first load the image");
372372
}
373373

374-
int numcols = Py::Int(args[0]);
375-
int numrows = Py::Int(args[1]);
374+
size_t numcols = Py::Int(args[0]);
375+
size_t numrows = Py::Int(args[1]);
376376

377377
colsOut = numcols;
378378
rowsOut = numrows;

‎src/_path.cpp

Copy file name to clipboardExpand all lines: src/_path.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ _add_polygon(Py::List& polygons, const std::vector<double>& polygon)
13531353
{
13541354
return;
13551355
}
1356-
npy_intp polygon_dims[] = { polygon.size() / 2, 2, 0 };
1356+
npy_intp polygon_dims[] = { (npy_intp)polygon.size() / 2, 2, 0 };
13571357
PyArrayObject* polygon_array = NULL;
13581358
polygon_array = (PyArrayObject*)PyArray_SimpleNew
13591359
(2, polygon_dims, PyArray_DOUBLE);

‎src/_ttconv.cpp

Copy file name to clipboardExpand all lines: src/_ttconv.cpp
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ PyInit_ttconv(void)
309309
PyMODINIT_FUNC
310310
initttconv(void)
311311
{
312-
PyObject* m;
313-
314-
m = Py_InitModule3("ttconv", ttconv_methods, module_docstring);
312+
Py_InitModule3("ttconv", ttconv_methods, module_docstring);
315313
}
316314
#endif

‎src/ft2font.cpp

Copy file name to clipboardExpand all lines: src/ft2font.cpp
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "mplutils.h"
55
#include <sstream>
66

7+
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
78
#include "numpy/arrayobject.h"
89

910
/*

‎ttconv/pprdrv_tt.cpp

Copy file name to clipboardExpand all lines: ttconv/pprdrv_tt.cpp
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ void Read_name(struct TTFONT *font)
179179
int numrecords; /* Number of strings in this table */
180180
BYTE *strings; /* pointer to start of string storage */
181181
int x;
182-
int platform,encoding; /* Current platform id, encoding id, */
183-
int language,nameid; /* language id, name id, */
182+
int platform; /* Current platform id */
183+
int nameid; /* name id, */
184184
int offset,length; /* offset and length of string. */
185185

186186
#ifdef DEBUG_TRUETYPE
@@ -214,8 +214,6 @@ void Read_name(struct TTFONT *font)
214214
for (x=0; x < numrecords; x++,ptr2+=12)
215215
{
216216
platform = getUSHORT(ptr2);
217-
encoding = getUSHORT(ptr2+2);
218-
language = getUSHORT(ptr2+4);
219217
nameid = getUSHORT(ptr2+6);
220218
length = getUSHORT(ptr2+8);
221219
offset = getUSHORT(ptr2+10);

‎ttconv/pprdrv_tt2.cpp

Copy file name to clipboardExpand all lines: ttconv/pprdrv_tt2.cpp
+4-22Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,6 @@ void GlyphToType3::do_composite(TTStreamWriter& stream, struct TTFONT *font, BYT
418418
USHORT glyphIndex;
419419
int arg1;
420420
int arg2;
421-
USHORT xscale;
422-
USHORT yscale;
423-
USHORT scale01;
424-
USHORT scale10;
425421

426422
/* Once around this loop for each component. */
427423
do
@@ -449,38 +445,24 @@ void GlyphToType3::do_composite(TTStreamWriter& stream, struct TTFONT *font, BYT
449445

450446
if (flags & WE_HAVE_A_SCALE)
451447
{
452-
xscale = yscale = getUSHORT(glyph);
453448
glyph += 2;
454-
scale01 = scale10 = 0;
455449
}
456450
else if (flags & WE_HAVE_AN_X_AND_Y_SCALE)
457451
{
458-
xscale = getUSHORT(glyph);
459-
glyph += 2;
460-
yscale = getUSHORT(glyph);
461-
glyph += 2;
462-
scale01 = scale10 = 0;
452+
glyph += 4;
463453
}
464454
else if (flags & WE_HAVE_A_TWO_BY_TWO)
465455
{
466-
xscale = getUSHORT(glyph);
467-
glyph += 2;
468-
scale01 = getUSHORT(glyph);
469-
glyph += 2;
470-
scale10 = getUSHORT(glyph);
471-
glyph += 2;
472-
yscale = getUSHORT(glyph);
473-
glyph += 2;
456+
glyph += 8;
474457
}
475458
else
476459
{
477-
xscale = yscale = scale01 = scale10 = 0;
478460
}
479461

480462
/* Debugging */
481463
#ifdef DEBUG_TRUETYPE
482-
stream.printf("%% flags=%d, arg1=%d, arg2=%d, xscale=%d, yscale=%d, scale01=%d, scale10=%d\n",
483-
(int)flags,arg1,arg2,(int)xscale,(int)yscale,(int)scale01,(int)scale10);
464+
stream.printf("%% flags=%d, arg1=%d, arg2=%d\n",
465+
(int)flags,arg1,arg2);
484466
#endif
485467

486468
if (pdf_mode)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.