Skip to content

Commit edba4fc

Browse files
committed
Fixes to compile with Clang 2.8 (tested on Ubuntu 11.04)
1 parent eff1069 commit edba4fc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/_path.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,19 +1578,19 @@ _path_module::convert_to_svg(const Py::Tuple& args)
15781578
#if PY_VERSION_HEX >= 0x02070000
15791579
char* str;
15801580
str = PyOS_double_to_string(x, 'g', precision, 0, NULL);
1581-
p += snprintf(p, buffersize - (p - buffer), str);
1581+
p += snprintf(p, buffersize - (p - buffer), "%s", str);
15821582
PyMem_Free(str);
15831583
*p++ = ' ';
15841584
str = PyOS_double_to_string(y, 'g', precision, 0, NULL);
1585-
p += snprintf(p, buffersize - (p - buffer), str);
1585+
p += snprintf(p, buffersize - (p - buffer), "%s", str);
15861586
PyMem_Free(str);
15871587
#else
15881588
char str[64];
15891589
PyOS_ascii_formatd(str, 64, format, x);
1590-
p += snprintf(p, buffersize - (p - buffer), str);
1590+
p += snprintf(p, buffersize - (p - buffer), "%s", str);
15911591
*p++ = ' ';
15921592
PyOS_ascii_formatd(str, 64, format, y);
1593-
p += snprintf(p, buffersize - (p - buffer), str);
1593+
p += snprintf(p, buffersize - (p - buffer), "%s", str);
15941594
#endif
15951595

15961596
--wait;

src/cntr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,8 +1366,8 @@ int reorder(double *xpp, double *ypp, short *kpp,
13661366
int maxnsegs = npts/2 + 1;
13671367

13681368
/* allocate maximum possible size--gross overkill */
1369-
i0 = malloc(maxnsegs * sizeof(int));
1370-
i1 = malloc(maxnsegs * sizeof(int));
1369+
i0 = (int *)malloc(maxnsegs * sizeof(int));
1370+
i1 = (int *)malloc(maxnsegs * sizeof(int));
13711371

13721372
/* Find the segments. */
13731373
iseg = 0;
@@ -1400,7 +1400,7 @@ int reorder(double *xpp, double *ypp, short *kpp,
14001400

14011401
/* Find the subpaths as sets of connected segments. */
14021402

1403-
subp = malloc(nsegs * sizeof(int));
1403+
subp = (int *)malloc(nsegs * sizeof(int));
14041404
for (i=0; i<nsegs; i++) subp[i] = -1;
14051405

14061406
nsp = 0;
@@ -1776,15 +1776,15 @@ Cntr_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
17761776
static int
17771777
Cntr_init(Cntr *self, PyObject *args, PyObject *kwds)
17781778
{
1779-
static char *kwlist[] = {"x", "y", "z", "mask", NULL};
1779+
static const char *kwlist[] = {"x", "y", "z", "mask", NULL};
17801780
PyObject *xarg, *yarg, *zarg, *marg;
17811781
PyArrayObject *xpa, *ypa, *zpa, *mpa;
17821782
long iMax, jMax;
17831783
char *mask;
17841784

17851785
marg = NULL;
17861786

1787-
if (! PyArg_ParseTupleAndKeywords(args, kwds, "OOO|O", kwlist,
1787+
if (! PyArg_ParseTupleAndKeywords(args, kwds, "OOO|O", (char **)kwlist,
17881788
&xarg, &yarg, &zarg, &marg))
17891789
return -1;
17901790
if (marg == Py_None)
@@ -1858,9 +1858,9 @@ Cntr_trace(Cntr *self, PyObject *args, PyObject *kwds)
18581858
double levels[2] = {0.0, -1e100};
18591859
int nlevels = 2;
18601860
long nchunk = 0L;
1861-
static char *kwlist[] = {"level0", "level1", "nchunk", NULL};
1861+
static const char *kwlist[] = {"level0", "level1", "nchunk", NULL};
18621862

1863-
if (! PyArg_ParseTupleAndKeywords(args, kwds, "d|dl", kwlist,
1863+
if (! PyArg_ParseTupleAndKeywords(args, kwds, "d|dl", (char **)kwlist,
18641864
levels, levels+1, &nchunk))
18651865
{
18661866
return NULL;

0 commit comments

Comments
 (0)