@@ -303,8 +303,9 @@ PyFile_NewStdPrinter(int fd)
303
303
}
304
304
305
305
static PyObject *
306
- stdprinter_write (PyStdPrinter_Object * self , PyObject * args )
306
+ stdprinter_write (PyObject * op , PyObject * args )
307
307
{
308
+ PyStdPrinter_Object * self = (PyStdPrinter_Object * )op ;
308
309
PyObject * unicode ;
309
310
PyObject * bytes = NULL ;
310
311
const char * str ;
@@ -355,27 +356,30 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
355
356
}
356
357
357
358
static PyObject *
358
- stdprinter_fileno (PyStdPrinter_Object * self , PyObject * Py_UNUSED (ignored ))
359
+ stdprinter_fileno (PyObject * op , PyObject * Py_UNUSED (ignored ))
359
360
{
361
+ PyStdPrinter_Object * self = (PyStdPrinter_Object * )op ;
360
362
return PyLong_FromLong ((long ) self -> fd );
361
363
}
362
364
363
365
static PyObject *
364
- stdprinter_repr (PyStdPrinter_Object * self )
366
+ stdprinter_repr (PyObject * op )
365
367
{
368
+ PyStdPrinter_Object * self = (PyStdPrinter_Object * )op ;
366
369
return PyUnicode_FromFormat ("<stdprinter(fd=%d) object at %p>" ,
367
370
self -> fd , self );
368
371
}
369
372
370
373
static PyObject *
371
- stdprinter_noop (PyStdPrinter_Object * self , PyObject * Py_UNUSED (ignored ))
374
+ stdprinter_noop (PyObject * self , PyObject * Py_UNUSED (ignored ))
372
375
{
373
376
Py_RETURN_NONE ;
374
377
}
375
378
376
379
static PyObject *
377
- stdprinter_isatty (PyStdPrinter_Object * self , PyObject * Py_UNUSED (ignored ))
380
+ stdprinter_isatty (PyObject * op , PyObject * Py_UNUSED (ignored ))
378
381
{
382
+ PyStdPrinter_Object * self = (PyStdPrinter_Object * )op ;
379
383
long res ;
380
384
if (self -> fd < 0 ) {
381
385
Py_RETURN_FALSE ;
@@ -389,11 +393,11 @@ stdprinter_isatty(PyStdPrinter_Object *self, PyObject *Py_UNUSED(ignored))
389
393
}
390
394
391
395
static PyMethodDef stdprinter_methods [] = {
392
- {"close" , ( PyCFunction ) stdprinter_noop , METH_NOARGS , "" },
393
- {"flush" , ( PyCFunction ) stdprinter_noop , METH_NOARGS , "" },
394
- {"fileno" , ( PyCFunction ) stdprinter_fileno , METH_NOARGS , "" },
395
- {"isatty" , ( PyCFunction ) stdprinter_isatty , METH_NOARGS , "" },
396
- {"write" , ( PyCFunction ) stdprinter_write , METH_VARARGS , "" },
396
+ {"close" , stdprinter_noop , METH_NOARGS , "" },
397
+ {"flush" , stdprinter_noop , METH_NOARGS , "" },
398
+ {"fileno" , stdprinter_fileno , METH_NOARGS , "" },
399
+ {"isatty" , stdprinter_isatty , METH_NOARGS , "" },
400
+ {"write" , stdprinter_write , METH_VARARGS , "" },
397
401
{NULL , NULL } /*sentinel */
398
402
};
399
403
@@ -433,7 +437,7 @@ PyTypeObject PyStdPrinter_Type = {
433
437
0 , /* tp_getattr */
434
438
0 , /* tp_setattr */
435
439
0 , /* tp_as_async */
436
- ( reprfunc ) stdprinter_repr , /* tp_repr */
440
+ stdprinter_repr , /* tp_repr */
437
441
0 , /* tp_as_number */
438
442
0 , /* tp_as_sequence */
439
443
0 , /* tp_as_mapping */
0 commit comments