@@ -108,15 +108,13 @@ check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis,
108
108
/* Try to be as clear as possible about what went wrong. */
109
109
if (axis >= 0 ) {
110
110
PyErr_Format (PyExc_IndexError ,
111
- "index %" NPY_INTP_FMT " is out of bounds "
111
+ "index %" NPY_INTP_FMT " is out of bounds "
112
112
"for axis %d with size %" NPY_INTP_FMT ,
113
113
* index , axis , max_item );
114
114
} else {
115
115
PyErr_Format (PyExc_IndexError ,
116
116
"index %" NPY_INTP_FMT " is out of bounds "
117
117
"for size %" NPY_INTP_FMT , * index , max_item );
118
- "index %" NPY_INTP_FMT " is out of bounds "
119
- "for size %" NPY_INTP_FMT , * index , max_item );
120
118
}
121
119
return -1 ;
122
120
}
@@ -173,13 +171,13 @@ check_and_adjust_axis(int *axis, int ndim)
173
171
#define NPY_ALIGNOF (type ) alignof(type)
174
172
#elif (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
175
173
|| (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9 ) \
176
- && !defined __clang__ ) \
174
+ && !defined __clang__ ) \
177
175
|| (defined __clang__ && __clang_major__ < 8 ))
178
- #define NPY_ALIGNOF (type ) __alignof__( type)
176
+ # define NPY_ALIGNOF (type ) offsetof(struct {char c; type v;}, v )
179
177
#else
180
- #define NPY_ALIGNOF (type ) _Alignof(type)
178
+ # define NPY_ALIGNOF (type ) _Alignof(type)
181
179
#endif
182
- #define NPY_ALIGNOF_UINT (type ) NPY_ALIGNOF( type)
180
+ #define NPY_ALIGNOF_UINT (type ) npy_uint_alignment(sizeof( type) )
183
181
/*
184
182
* Disable harmless compiler warning "4116: unnamed type definition in
185
183
* parentheses" which is caused by the _ALIGN macro.
0 commit comments