77// Five distinguishable immortal singletons used as placeholder pointers.
88// These require no reference-count management when stored in a raw array.
99#define NPTRS 5
10- static PyObject * test_objs [NPTRS ];
11-
12- static void
13- setup_test_objs (void )
14- {
15- test_objs [0 ] = Py_None ;
16- test_objs [1 ] = Py_True ;
17- test_objs [2 ] = Py_False ;
18- test_objs [3 ] = Py_Ellipsis ;
19- test_objs [4 ] = Py_NotImplemented ;
20- }
21-
10+ const static PyObject * test_objs [NPTRS ] = {
11+ Py_None , Py_True , Py_False , Py_Ellipsis , Py_NotImplemented
12+ };
2213// Fill buf[0..NPTRS-1] with test_objs in order.
2314static void
2415fill_buf (PyObject * * buf )
@@ -64,7 +55,6 @@ call_memmove(PyObject **dest, PyObject **src, Py_ssize_t n)
6455static PyObject *
6556test_memmove_dest_lt_src (PyObject * self , PyObject * Py_UNUSED (arg ))
6657{
67- setup_test_objs ();
6858
6959 PyObject * buf [NPTRS ];
7060 fill_buf (buf );
@@ -90,7 +80,6 @@ test_memmove_dest_lt_src(PyObject *self, PyObject *Py_UNUSED(arg))
9080static PyObject *
9181test_memmove_dest_gt_src (PyObject * self , PyObject * Py_UNUSED (arg ))
9282{
93- setup_test_objs ();
9483
9584 PyObject * buf [NPTRS ];
9685 fill_buf (buf );
@@ -116,7 +105,6 @@ test_memmove_dest_gt_src(PyObject *self, PyObject *Py_UNUSED(arg))
116105static PyObject *
117106test_memmove_dest_eq_src (PyObject * self , PyObject * Py_UNUSED (arg ))
118107{
119- setup_test_objs ();
120108
121109 PyObject * buf [NPTRS ];
122110 fill_buf (buf );
@@ -141,7 +129,6 @@ test_memmove_dest_eq_src(PyObject *self, PyObject *Py_UNUSED(arg))
141129static PyObject *
142130test_memmove_overlapping (PyObject * self , PyObject * Py_UNUSED (arg ))
143131{
144- setup_test_objs ();
145132
146133 PyObject * buf [NPTRS ];
147134 fill_buf (buf );
@@ -168,7 +155,6 @@ test_memmove_overlapping(PyObject *self, PyObject *Py_UNUSED(arg))
168155static PyObject *
169156test_memmove_single_owner (PyObject * self , PyObject * Py_UNUSED (arg ))
170157{
171- setup_test_objs ();
172158
173159 PyObject * a = PyList_New (0 );
174160 if (a == NULL ) {
0 commit comments