Skip to content

Commit 1583903

Browse files
committed
Fixed compiler warnings in _macosx.m
1 parent c32bde5 commit 1583903

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/_macosx.m

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,8 +1770,8 @@ static int _transformation_converter(PyObject* object, void* pointer)
17701770
GraphicsContext_draw_quad_mesh (GraphicsContext* self, PyObject* args)
17711771
{
17721772
CGAffineTransform master;
1773-
int meshWidth;
1774-
int meshHeight;
1773+
size_t meshWidth;
1774+
size_t meshHeight;
17751775
PyObject* coordinates;
17761776
PyArrayObject* coordinates_arr = 0;
17771777
PyObject* offsets;
@@ -1793,7 +1793,7 @@ static int _transformation_converter(PyObject* object, void* pointer)
17931793
return NULL;
17941794
}
17951795

1796-
if(!PyArg_ParseTuple(args, "O&iiOOO&OiO",
1796+
if(!PyArg_ParseTuple(args, "O&IIOOO&OiO",
17971797
_transformation_converter, &master,
17981798
&meshWidth,
17991799
&meshHeight,
@@ -3740,7 +3740,7 @@ static void _data_provider_release(void* info, const void* data, size_t size)
37403740
return NULL;
37413741
}
37423742

3743-
data = [rep representationUsingType:filetype properties:nil];
3743+
data = [rep representationUsingType:filetype properties:[NSDictionary dictionary]];
37443744

37453745
[data writeToFile: filename atomically: YES];
37463746
[pool release];
@@ -4575,7 +4575,7 @@ -(void)save_figure:(id)sender
45754575
}
45764576
NSMenu* menu = [button menu];
45774577
NSArray* items = [menu itemArray];
4578-
unsigned int n = [items count];
4578+
size_t n = [items count];
45794579
int* states = calloc(n, sizeof(int));
45804580
if (!states)
45814581
{
@@ -4597,14 +4597,13 @@ -(void)save_figure:(id)sender
45974597
m++;
45984598
}
45994599
}
4600-
int j = 0;
4600+
Py_ssize_t list_index = 0;
46014601
PyObject* list = PyList_New(m);
4602-
for (i = 0; i < n; i++)
4602+
for (size_t state_index = 0; state_index < n; state_index++)
46034603
{
4604-
if(states[i]==1)
4604+
if(states[state_index]==1)
46054605
{
4606-
PyList_SET_ITEM(list, j, PyLong_FromLong(i));
4607-
j++;
4606+
PyList_SET_ITEM(list, list_index++, PyLong_FromSize_t(state_index));
46084607
}
46094608
}
46104609
free(states);

0 commit comments

Comments
 (0)