Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edaae99

Browse files
author
Hood
committed
Fix more method METH_VARARGS method signatures
1 parent 4c3c040 commit edaae99

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

src/_backend_agg_wrapper.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ typedef struct
2323

2424

2525
/**********************************************************************
26-
* BufferRegion
26+
* BufferRegion, PyObject *
2727
* */
2828

29-
static PyObject *PyBufferRegion_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
29+
static PyObject *PyBufferRegion_new(PyTypeObject *type, PyObject *args)
3030
{
3131
PyBufferRegion *self;
3232
self = (PyBufferRegion *)type->tp_alloc(type, 0);
@@ -40,15 +40,15 @@ static void PyBufferRegion_dealloc(PyBufferRegion *self)
4040
Py_TYPE(self)->tp_free((PyObject *)self);
4141
}
4242

43-
static PyObject *PyBufferRegion_to_string(PyBufferRegion *self, PyObject *args, PyObject *kwds)
43+
static PyObject *PyBufferRegion_to_string(PyBufferRegion *self, PyObject *args)
4444
{
4545
return PyBytes_FromStringAndSize((const char *)self->x->get_data(),
4646
self->x->get_height() * self->x->get_stride());
4747
}
4848

4949
/* TODO: This doesn't seem to be used internally. Remove? */
5050

51-
static PyObject *PyBufferRegion_set_x(PyBufferRegion *self, PyObject *args, PyObject *kwds)
51+
static PyObject *PyBufferRegion_set_x(PyBufferRegion *self, PyObject *args)
5252
{
5353
int x;
5454
if (!PyArg_ParseTuple(args, "i:set_x", &x)) {
@@ -59,7 +59,7 @@ static PyObject *PyBufferRegion_set_x(PyBufferRegion *self, PyObject *args, PyOb
5959
Py_RETURN_NONE;
6060
}
6161

62-
static PyObject *PyBufferRegion_set_y(PyBufferRegion *self, PyObject *args, PyObject *kwds)
62+
static PyObject *PyBufferRegion_set_y(PyBufferRegion *self, PyObject *args)
6363
{
6464
int y;
6565
if (!PyArg_ParseTuple(args, "i:set_y", &y)) {
@@ -70,14 +70,14 @@ static PyObject *PyBufferRegion_set_y(PyBufferRegion *self, PyObject *args, PyOb
7070
Py_RETURN_NONE;
7171
}
7272

73-
static PyObject *PyBufferRegion_get_extents(PyBufferRegion *self, PyObject *args, PyObject *kwds)
73+
static PyObject *PyBufferRegion_get_extents(PyBufferRegion *self, PyObject *args)
7474
{
7575
agg::rect_i rect = self->x->get_rect();
7676

7777
return Py_BuildValue("IIII", rect.x1, rect.y1, rect.x2, rect.y2);
7878
}
7979

80-
static PyObject *PyBufferRegion_to_string_argb(PyBufferRegion *self, PyObject *args, PyObject *kwds)
80+
static PyObject *PyBufferRegion_to_string_argb(PyBufferRegion *self, PyObject *args)
8181
{
8282
PyObject *bufobj;
8383
uint8_t *buf;
@@ -154,15 +154,15 @@ static PyTypeObject *PyBufferRegion_init_type(PyObject *m, PyTypeObject *type)
154154
* RendererAgg
155155
* */
156156

157-
static PyObject *PyRendererAgg_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
157+
static PyObject *PyRendererAgg_new(PyTypeObject *type, PyObject *args)
158158
{
159159
PyRendererAgg *self;
160160
self = (PyRendererAgg *)type->tp_alloc(type, 0);
161161
self->x = NULL;
162162
return (PyObject *)self;
163163
}
164164

165-
static int PyRendererAgg_init(PyRendererAgg *self, PyObject *args, PyObject *kwds)
165+
static int PyRendererAgg_init(PyRendererAgg *self, PyObject *args)
166166
{
167167
unsigned int width;
168168
unsigned int height;
@@ -198,7 +198,7 @@ static void PyRendererAgg_dealloc(PyRendererAgg *self)
198198
Py_TYPE(self)->tp_free((PyObject *)self);
199199
}
200200

201-
static PyObject *PyRendererAgg_draw_path(PyRendererAgg *self, PyObject *args, PyObject *kwds)
201+
static PyObject *PyRendererAgg_draw_path(PyRendererAgg *self, PyObject *args)
202202
{
203203
GCAgg gc;
204204
py::PathIterator path;
@@ -227,7 +227,7 @@ static PyObject *PyRendererAgg_draw_path(PyRendererAgg *self, PyObject *args, Py
227227
Py_RETURN_NONE;
228228
}
229229

230-
static PyObject *PyRendererAgg_draw_text_image(PyRendererAgg *self, PyObject *args, PyObject *kwds)
230+
static PyObject *PyRendererAgg_draw_text_image(PyRendererAgg *self, PyObject *args)
231231
{
232232
numpy::array_view<agg::int8u, 2> image;
233233
double x;
@@ -252,7 +252,7 @@ static PyObject *PyRendererAgg_draw_text_image(PyRendererAgg *self, PyObject *ar
252252
Py_RETURN_NONE;
253253
}
254254

255-
PyObject *PyRendererAgg_draw_markers(PyRendererAgg *self, PyObject *args, PyObject *kwds)
255+
PyObject *PyRendererAgg_draw_markers(PyRendererAgg *self, PyObject *args)
256256
{
257257
GCAgg gc;
258258
py::PathIterator marker_path;
@@ -288,7 +288,7 @@ PyObject *PyRendererAgg_draw_markers(PyRendererAgg *self, PyObject *args, PyObje
288288
Py_RETURN_NONE;
289289
}
290290

291-
static PyObject *PyRendererAgg_draw_image(PyRendererAgg *self, PyObject *args, PyObject *kwds)
291+
static PyObject *PyRendererAgg_draw_image(PyRendererAgg *self, PyObject *args)
292292
{
293293
GCAgg gc;
294294
double x;
@@ -316,7 +316,7 @@ static PyObject *PyRendererAgg_draw_image(PyRendererAgg *self, PyObject *args, P
316316
}
317317

318318
static PyObject *
319-
PyRendererAgg_draw_path_collection(PyRendererAgg *self, PyObject *args, PyObject *kwds)
319+
PyRendererAgg_draw_path_collection(PyRendererAgg *self, PyObject *args)
320320
{
321321
GCAgg gc;
322322
agg::trans_affine master_transform;
@@ -377,7 +377,7 @@ PyRendererAgg_draw_path_collection(PyRendererAgg *self, PyObject *args, PyObject
377377
Py_RETURN_NONE;
378378
}
379379

380-
static PyObject *PyRendererAgg_draw_quad_mesh(PyRendererAgg *self, PyObject *args, PyObject *kwds)
380+
static PyObject *PyRendererAgg_draw_quad_mesh(PyRendererAgg *self, PyObject *args)
381381
{
382382
GCAgg gc;
383383
agg::trans_affine master_transform;
@@ -429,7 +429,7 @@ static PyObject *PyRendererAgg_draw_quad_mesh(PyRendererAgg *self, PyObject *arg
429429
}
430430

431431
static PyObject *
432-
PyRendererAgg_draw_gouraud_triangle(PyRendererAgg *self, PyObject *args, PyObject *kwds)
432+
PyRendererAgg_draw_gouraud_triangle(PyRendererAgg *self, PyObject *args)
433433
{
434434
GCAgg gc;
435435
numpy::array_view<const double, 2> points;
@@ -470,7 +470,7 @@ PyRendererAgg_draw_gouraud_triangle(PyRendererAgg *self, PyObject *args, PyObjec
470470
}
471471

472472
static PyObject *
473-
PyRendererAgg_draw_gouraud_triangles(PyRendererAgg *self, PyObject *args, PyObject *kwds)
473+
PyRendererAgg_draw_gouraud_triangles(PyRendererAgg *self, PyObject *args)
474474
{
475475
GCAgg gc;
476476
numpy::array_view<const double, 3> points;
@@ -540,14 +540,14 @@ int PyRendererAgg_get_buffer(PyRendererAgg *self, Py_buffer *buf, int flags)
540540
return 1;
541541
}
542542

543-
static PyObject *PyRendererAgg_clear(PyRendererAgg *self, PyObject *args, PyObject *kwds)
543+
static PyObject *PyRendererAgg_clear(PyRendererAgg *self, PyObject *args)
544544
{
545545
CALL_CPP("clear", self->x->clear());
546546

547547
Py_RETURN_NONE;
548548
}
549549

550-
static PyObject *PyRendererAgg_copy_from_bbox(PyRendererAgg *self, PyObject *args, PyObject *kwds)
550+
static PyObject *PyRendererAgg_copy_from_bbox(PyRendererAgg *self, PyObject *args)
551551
{
552552
agg::rect_d bbox;
553553
BufferRegion *reg;
@@ -565,7 +565,7 @@ static PyObject *PyRendererAgg_copy_from_bbox(PyRendererAgg *self, PyObject *arg
565565
return regobj;
566566
}
567567

568-
static PyObject *PyRendererAgg_restore_region(PyRendererAgg *self, PyObject *args, PyObject *kwds)
568+
static PyObject *PyRendererAgg_restore_region(PyRendererAgg *self, PyObject *args)
569569
{
570570
PyBufferRegion *regobj;
571571
int xx1 = 0, yy1 = 0, xx2 = 0, yy2 = 0, x = 0, y = 0;

src/_contour_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const char* PyQuadContourGenerator_create_contour__doc__ =
8181
"--\n\n"
8282
"Create and return a non-filled contour.";
8383

84-
static PyObject* PyQuadContourGenerator_create_contour(PyQuadContourGenerator* self, PyObject* args, PyObject* kwds)
84+
static PyObject* PyQuadContourGenerator_create_contour(PyQuadContourGenerator* self, PyObject* args)
8585
{
8686
double level;
8787
if (!PyArg_ParseTuple(args, "d:create_contour", &level)) {
@@ -98,7 +98,7 @@ const char* PyQuadContourGenerator_create_filled_contour__doc__ =
9898
"--\n\n"
9999
"Create and return a filled contour";
100100

101-
static PyObject* PyQuadContourGenerator_create_filled_contour(PyQuadContourGenerator* self, PyObject* args, PyObject* kwds)
101+
static PyObject* PyQuadContourGenerator_create_filled_contour(PyQuadContourGenerator* self, PyObject* args)
102102
{
103103
double lower_level, upper_level;
104104
if (!PyArg_ParseTuple(args, "dd:create_filled_contour",

src/ft2font_wrapper.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const char *PyFT2Image_draw_rect__doc__ =
6666
"--\n\n"
6767
"Draw an empty rectangle to the image.\n";
6868

69-
static PyObject *PyFT2Image_draw_rect(PyFT2Image *self, PyObject *args, PyObject *kwds)
69+
static PyObject *PyFT2Image_draw_rect(PyFT2Image *self, PyObject *args
7070
{
7171
double x0, y0, x1, y1;
7272

@@ -84,7 +84,7 @@ const char *PyFT2Image_draw_rect_filled__doc__ =
8484
"--\n\n"
8585
"Draw a filled rectangle to the image.\n";
8686

87-
static PyObject *PyFT2Image_draw_rect_filled(PyFT2Image *self, PyObject *args, PyObject *kwds)
87+
static PyObject *PyFT2Image_draw_rect_filled(PyFT2Image *self, PyObject *args)
8888
{
8989
double x0, y0, x1, y1;
9090

@@ -425,7 +425,7 @@ const char *PyFT2Font_clear__doc__ =
425425
"--\n\n"
426426
"Clear all the glyphs, reset for a new call to `.set_text`.\n";
427427

428-
static PyObject *PyFT2Font_clear(PyFT2Font *self, PyObject *args, PyObject *kwds)
428+
static PyObject *PyFT2Font_clear(PyFT2Font *self, PyObject *args)
429429
{
430430
CALL_CPP("clear", (self->x->clear()));
431431

@@ -437,7 +437,7 @@ const char *PyFT2Font_set_size__doc__ =
437437
"--\n\n"
438438
"Set the point size and dpi of the text.\n";
439439

440-
static PyObject *PyFT2Font_set_size(PyFT2Font *self, PyObject *args, PyObject *kwds)
440+
static PyObject *PyFT2Font_set_size(PyFT2Font *self, PyObject *args)
441441
{
442442
double ptsize;
443443
double dpi;
@@ -456,7 +456,7 @@ const char *PyFT2Font_set_charmap__doc__ =
456456
"--\n\n"
457457
"Make the i-th charmap current.\n";
458458

459-
static PyObject *PyFT2Font_set_charmap(PyFT2Font *self, PyObject *args, PyObject *kwds)
459+
static PyObject *PyFT2Font_set_charmap(PyFT2Font *self, PyObject *args)
460460
{
461461
int i;
462462

@@ -474,7 +474,7 @@ const char *PyFT2Font_select_charmap__doc__ =
474474
"--\n\n"
475475
"Select a charmap by its FT_Encoding number.\n";
476476

477-
static PyObject *PyFT2Font_select_charmap(PyFT2Font *self, PyObject *args, PyObject *kwds)
477+
static PyObject *PyFT2Font_select_charmap(PyFT2Font *self, PyObject *args)
478478
{
479479
unsigned long i;
480480

@@ -496,7 +496,7 @@ const char *PyFT2Font_get_kerning__doc__ =
496496
" KERNING_UNFITTED - Return scaled but un-grid-fitted kerning distances\n"
497497
" KERNING_UNSCALED - Return the kerning vector in original font units\n";
498498

499-
static PyObject *PyFT2Font_get_kerning(PyFT2Font *self, PyObject *args, PyObject *kwds)
499+
static PyObject *PyFT2Font_get_kerning(PyFT2Font *self, PyObject *args)
500500
{
501501
FT_UInt left, right, mode;
502502
int result;
@@ -587,7 +587,7 @@ const char *PyFT2Font_get_num_glyphs__doc__ =
587587
"--\n\n"
588588
"Return the number of loaded glyphs.\n";
589589

590-
static PyObject *PyFT2Font_get_num_glyphs(PyFT2Font *self, PyObject *args, PyObject *kwds)
590+
static PyObject *PyFT2Font_get_num_glyphs(PyFT2Font *self, PyObject *args)
591591
{
592592
return PyLong_FromLong(self->x->get_num_glyphs());
593593
}
@@ -677,7 +677,7 @@ const char *PyFT2Font_get_width_height__doc__ =
677677
"The rotation of the string is accounted for. To get width and height\n"
678678
"in pixels, divide these values by 64.\n";
679679

680-
static PyObject *PyFT2Font_get_width_height(PyFT2Font *self, PyObject *args, PyObject *kwds)
680+
static PyObject *PyFT2Font_get_width_height(PyFT2Font *self, PyObject *args)
681681
{
682682
long width, height;
683683

@@ -692,7 +692,7 @@ const char *PyFT2Font_get_bitmap_offset__doc__ =
692692
"Get the (x, y) offset in 26.6 subpixels for the bitmap if ink hangs left or below (0, 0).\n"
693693
"Since Matplotlib only supports left-to-right text, y is always 0.\n";
694694

695-
static PyObject *PyFT2Font_get_bitmap_offset(PyFT2Font *self, PyObject *args, PyObject *kwds)
695+
static PyObject *PyFT2Font_get_bitmap_offset(PyFT2Font *self, PyObject *args)
696696
{
697697
long x, y;
698698

@@ -708,7 +708,7 @@ const char *PyFT2Font_get_descent__doc__ =
708708
"The rotation of the string is accounted for. To get the descent\n"
709709
"in pixels, divide this value by 64.\n";
710710

711-
static PyObject *PyFT2Font_get_descent(PyFT2Font *self, PyObject *args, PyObject *kwds)
711+
static PyObject *PyFT2Font_get_descent(PyFT2Font *self, PyObject *args)
712712
{
713713
long descent;
714714

@@ -809,7 +809,7 @@ const char *PyFT2Font_get_glyph_name__doc__ =
809809
"names (per FT_FACE_FLAG_GLYPH_NAMES), this returns a made-up name which\n"
810810
"does *not* roundtrip through `.get_name_index`.\n";
811811

812-
static PyObject *PyFT2Font_get_glyph_name(PyFT2Font *self, PyObject *args, PyObject *kwds)
812+
static PyObject *PyFT2Font_get_glyph_name(PyFT2Font *self, PyObject *args)
813813
{
814814
unsigned int glyph_number;
815815
char buffer[128];
@@ -826,7 +826,7 @@ const char *PyFT2Font_get_charmap__doc__ =
826826
"Return a dict that maps the character codes of the selected charmap\n"
827827
"(Unicode by default) to their corresponding glyph indices.\n";
828828

829-
static PyObject *PyFT2Font_get_charmap(PyFT2Font *self, PyObject *args, PyObject *kwds)
829+
static PyObject *PyFT2Font_get_charmap(PyFT2Font *self, PyObject *args)
830830
{
831831
PyObject *charmap;
832832
if (!(charmap = PyDict_New())) {
@@ -856,7 +856,7 @@ const char *PyFT2Font_get_char_index__doc__ =
856856
"--\n\n"
857857
"Return the glyph index corresponding to a character *codepoint*.\n";
858858

859-
static PyObject *PyFT2Font_get_char_index(PyFT2Font *self, PyObject *args, PyObject *kwds)
859+
static PyObject *PyFT2Font_get_char_index(PyFT2Font *self, PyObject *args)
860860
{
861861
FT_UInt index;
862862
FT_ULong ccode;
@@ -878,7 +878,7 @@ const char *PyFT2Font_get_sfnt__doc__ =
878878
"(platform-ID, ISO-encoding-scheme, language-code, and description)\n"
879879
"tuples.\n";
880880

881-
static PyObject *PyFT2Font_get_sfnt(PyFT2Font *self, PyObject *args, PyObject *kwds)
881+
static PyObject *PyFT2Font_get_sfnt(PyFT2Font *self, PyObject *args)
882882
{
883883
PyObject *names;
884884

@@ -938,7 +938,7 @@ const char *PyFT2Font_get_name_index__doc__ =
938938
"Return the glyph index of a given glyph *name*.\n"
939939
"The glyph index 0 means 'undefined character code'.\n";
940940

941-
static PyObject *PyFT2Font_get_name_index(PyFT2Font *self, PyObject *args, PyObject *kwds)
941+
static PyObject *PyFT2Font_get_name_index(PyFT2Font *self, PyObject *args)
942942
{
943943
char *glyphname;
944944
long name_index;
@@ -954,7 +954,7 @@ const char *PyFT2Font_get_ps_font_info__doc__ =
954954
"--\n\n"
955955
"Return the information in the PS Font Info structure.\n";
956956

957-
static PyObject *PyFT2Font_get_ps_font_info(PyFT2Font *self, PyObject *args, PyObject *kwds)
957+
static PyObject *PyFT2Font_get_ps_font_info(PyFT2Font *self, PyObject *args)
958958
{
959959
PS_FontInfoRec fontinfo;
960960

@@ -982,7 +982,7 @@ const char *PyFT2Font_get_sfnt_table__doc__ =
982982
"Return one of the following SFNT tables: head, maxp, OS/2, hhea, "
983983
"vhea, post, or pclt.\n";
984984

985-
static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args, PyObject *kwds)
985+
static PyObject *PyFT2Font_get_sfnt_table(PyFT2Font *self, PyObject *args)
986986
{
987987
char *tagname;
988988
if (!PyArg_ParseTuple(args, "s:get_sfnt_table", &tagname)) {
@@ -1284,7 +1284,7 @@ const char *PyFT2Font_get_path__doc__ =
12841284
"Get the path data from the currently loaded glyph as a tuple of vertices, "
12851285
"codes.\n";
12861286

1287-
static PyObject *PyFT2Font_get_path(PyFT2Font *self, PyObject *args, PyObject *kwds)
1287+
static PyObject *PyFT2Font_get_path(PyFT2Font *self, PyObject *args)
12881288
{
12891289
CALL_CPP("get_path", return self->x->get_path());
12901290
}
@@ -1294,7 +1294,7 @@ const char *PyFT2Font_get_image__doc__ =
12941294
"--\n\n"
12951295
"Return the underlying image buffer for this font object.\n";
12961296

1297-
static PyObject *PyFT2Font_get_image(PyFT2Font *self, PyObject *args, PyObject *kwds)
1297+
static PyObject *PyFT2Font_get_image(PyFT2Font *self, PyObject *args)
12981298
{
12991299
FT2Image &im = self->x->get_image();
13001300
npy_intp dims[] = {(npy_intp)im.get_height(), (npy_intp)im.get_width() };

0 commit comments

Comments
 (0)