Skip to content

Commit 7aef9a7

Browse files
committed
Remove constant array declarations
1 parent 220d576 commit 7aef9a7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

graalpython/com.oracle.graal.python.jni/src/capi_native.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,6 @@ CONSTANT(PyObject*, _PyLong_Zero, PyLong_Zero) \
227227
CONSTANT(PyObject*, _PyLong_One, PyLong_One) \
228228

229229
#define CONSTANT_COPIES \
230-
CONSTANT_ARRAY(const unsigned char, _Py_ascii_whitespace, 256) \
231-
CONSTANT_ARRAY(const unsigned int, _Py_ctype_table, 256) \
232-
CONSTANT_ARRAY(const unsigned char, _Py_ctype_tolower, 256) \
233-
CONSTANT_ARRAY(const unsigned char, _Py_ctype_toupper, 256) \
234230
CONSTANT(struct _PyTraceMalloc_Config, _Py_tracemalloc_config) \
235231
CONSTANT(_Py_HashSecret_t, _Py_HashSecret) \
236232
CONSTANT(int, Py_DebugFlag) \
@@ -376,7 +372,7 @@ PyAPI_FUNC(int) initNativeForward(void* (*getBuiltin)(int), void* (*getAPI)(cons
376372
#define CONSTANT(TYPE, NAME, INTERNAL_NAME) NAME = (TYPE) getType(#INTERNAL_NAME);
377373
CONSTANTS
378374
#undef CONSTANT
379-
375+
380376
#define CONSTANT(TYPE, NAME) memcpy((void*) &NAME, getType(#NAME), sizeof(NAME));
381377
#define CONSTANT_ARRAY(TYPE, NAME, SIZE) memcpy((void*) NAME, getType(#NAME), sizeof(NAME));
382378
CONSTANT_COPIES
@@ -395,7 +391,7 @@ PyAPI_FUNC(int) initNativeForward(void* (*getBuiltin)(int), void* (*getAPI)(cons
395391
}
396392
PY_TYPE_OBJECTS(SET_TYPE_OBJECT_STORE)
397393
#undef SET_TYPE_OBJECT_STORE
398-
394+
399395
int id = 0;
400396
#define BUILTIN(NAME, RET, ...) Graal##NAME = (RET(*)(__VA_ARGS__)) getBuiltin(id++);
401397
CAPI_BUILTINS

0 commit comments

Comments
 (0)