if (!swapped_args)
return NULL;
- if (st->swapped_suffix == NULL) {
-#ifdef WORDS_BIGENDIAN
- st->swapped_suffix = PyUnicode_InternFromString("_le");
-#else
- st->swapped_suffix = PyUnicode_InternFromString("_be");
-#endif
- }
- if (st->swapped_suffix == NULL) {
- Py_DECREF(swapped_args);
- return NULL;
- }
-
+ assert(st->swapped_suffix != NULL);
newname = PyUnicode_Concat(name, st->swapped_suffix);
if (newname == NULL) {
Py_DECREF(swapped_args);
char name[256];
PyObject *len;
- if (st->array_cache == NULL) {
- st->array_cache = PyDict_New();
- if (st->array_cache == NULL) {
- return NULL;
- }
- }
+ assert(st->array_cache != NULL);
len = PyLong_FromSsize_t(length);
if (len == NULL)
return NULL;
return -1;
}
+ st->array_cache = PyDict_New();
+ if (st->array_cache == NULL) {
+ return -1;
+ }
+
+#ifdef WORDS_BIGENDIAN
+ st->swapped_suffix = PyUnicode_InternFromString("_le");
+#else
+ st->swapped_suffix = PyUnicode_InternFromString("_be");
+#endif
+ if (st->swapped_suffix == NULL) {
+ return -1;
+ }
+
if (_ctypes_add_types(mod) < 0) {
return -1;
}