Skip to content

Commit

Permalink
_json.c: use Py_UNUSED() macro (pythonGH-17053)
Browse files Browse the repository at this point in the history
Remove UNUSED macro: use Py_UNUSED() macro instead.
  • Loading branch information
vstinner authored Nov 5, 2019
1 parent 62161ce commit fbbfcce
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Modules/_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
#include "structmember.h"
#include "pycore_accu.h"

#ifdef __GNUC__
#define UNUSED __attribute__((__unused__))
#else
#define UNUSED
#endif

#define PyScanner_Check(op) PyObject_TypeCheck(op, &PyScannerType)
#define PyScanner_CheckExact(op) (Py_TYPE(op) == &PyScannerType)
#define PyEncoder_Check(op) PyObject_TypeCheck(op, &PyEncoderType)
Expand Down Expand Up @@ -78,7 +72,7 @@ static PyMemberDef encoder_members[] = {
static PyObject *
ascii_escape_unicode(PyObject *pystr);
static PyObject *
py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr);
py_encode_basestring_ascii(PyObject* Py_UNUSED(self), PyObject *pystr);
void init_json(void);
static PyObject *
scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr);
Expand Down Expand Up @@ -562,7 +556,7 @@ PyDoc_STRVAR(pydoc_scanstring,
);

static PyObject *
py_scanstring(PyObject* self UNUSED, PyObject *args)
py_scanstring(PyObject* Py_UNUSED(self), PyObject *args)
{
PyObject *pystr;
PyObject *rval;
Expand Down Expand Up @@ -591,7 +585,7 @@ PyDoc_STRVAR(pydoc_encode_basestring_ascii,
);

static PyObject *
py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr)
py_encode_basestring_ascii(PyObject* Py_UNUSED(self), PyObject *pystr)
{
PyObject *rval;
/* Return an ASCII-only JSON representation of a Python string */
Expand All @@ -616,7 +610,7 @@ PyDoc_STRVAR(pydoc_encode_basestring,
);

static PyObject *
py_encode_basestring(PyObject* self UNUSED, PyObject *pystr)
py_encode_basestring(PyObject* Py_UNUSED(self), PyObject *pystr)
{
PyObject *rval;
/* Return a JSON representation of a Python string */
Expand Down

0 comments on commit fbbfcce

Please sign in to comment.