summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-11-05 10:44:28 (GMT)
committerGitHub <noreply@github.com>2019-11-05 10:44:28 (GMT)
commitfbbfcce2d6c5ab16324b36572966e9605e7dc192 (patch)
tree4c70b596732e66184c5e41c9e4558c085a022235 /Modules
parent62161ce989d7d4fe2b0e6899a54da20feeddc798 (diff)
downloadcpython-fbbfcce2d6c5ab16324b36572966e9605e7dc192.zip
cpython-fbbfcce2d6c5ab16324b36572966e9605e7dc192.tar.gz
cpython-fbbfcce2d6c5ab16324b36572966e9605e7dc192.tar.bz2
_json.c: use Py_UNUSED() macro (GH-17053)
Remove UNUSED macro: use Py_UNUSED() macro instead.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_json.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index 54ac605..439414f 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -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)
@@ -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);
@@ -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;
@@ -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 */
@@ -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 */