Commit c95ca9f2 authored by Stefan Behnel's avatar Stefan Behnel

remove duplicated "IsLittleEndian" helper (already exists in ModuleSetupCode.c now)

parent 7d70fde4
...@@ -738,7 +738,8 @@ buffer_structs_code = load_buffer_utility( ...@@ -738,7 +738,8 @@ buffer_structs_code = load_buffer_utility(
"BufferFormatStructs", proto_block='utility_code_proto_before_types') "BufferFormatStructs", proto_block='utility_code_proto_before_types')
acquire_utility_code = load_buffer_utility("BufferFormatCheck", acquire_utility_code = load_buffer_utility("BufferFormatCheck",
context=context, context=context,
requires=[buffer_structs_code]) requires=[buffer_structs_code,
UtilityCode.load_cached("IsLittleEndian", "ModuleSetupCode.c")])
# See utility code BufferFormatFromTypeInfo # See utility code BufferFormatFromTypeInfo
_typeinfo_to_format_code = load_buffer_utility("TypeInfoToFormat", context={}, _typeinfo_to_format_code = load_buffer_utility("TypeInfoToFormat", context={},
......
...@@ -166,11 +166,6 @@ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, ...@@ -166,11 +166,6 @@ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
/////////////// BufferFormatCheck /////////////// /////////////// BufferFormatCheck ///////////////
static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx, static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
__Pyx_BufFmt_StackElem* stack, __Pyx_BufFmt_StackElem* stack,
...@@ -611,7 +606,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha ...@@ -611,7 +606,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
++ts; ++ts;
break; break;
case '<': case '<':
if (!__Pyx_IsLittleEndian()) { if (!__Pyx_Is_Little_Endian()) {
PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler"); PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
return NULL; return NULL;
} }
...@@ -620,7 +615,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha ...@@ -620,7 +615,7 @@ static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const cha
break; break;
case '>': case '>':
case '!': case '!':
if (__Pyx_IsLittleEndian()) { if (__Pyx_Is_Little_Endian()) {
PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler"); PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
return NULL; return NULL;
} }
......
...@@ -720,11 +720,11 @@ static int __Pyx_check_binary_version(void) { ...@@ -720,11 +720,11 @@ static int __Pyx_check_binary_version(void) {
/////////////// IsLittleEndian.proto /////////////// /////////////// IsLittleEndian.proto ///////////////
static int __Pyx_Is_Little_Endian(void); static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
/////////////// IsLittleEndian /////////////// /////////////// IsLittleEndian ///////////////
static int __Pyx_Is_Little_Endian(void) static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{ {
union { union {
uint32_t u32; uint32_t u32;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment