Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b537e4

Browse filesBrowse files
org common.h
1 parent 6d52554 commit 3b537e4
Copy full SHA for 3b537e4

File tree

1 file changed

+5
-7
lines changed
Filter options

1 file changed

+5
-7
lines changed

‎numpy/_core/src/multiarray/common.h

Copy file name to clipboardExpand all lines: numpy/_core/src/multiarray/common.h
+5-7Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,13 @@ check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis,
108108
/* Try to be as clear as possible about what went wrong. */
109109
if (axis >= 0) {
110110
PyErr_Format(PyExc_IndexError,
111-
"index %" NPY_INTP_FMT " is out of bounds "
111+
"index %" NPY_INTP_FMT" is out of bounds "
112112
"for axis %d with size %" NPY_INTP_FMT,
113113
*index, axis, max_item);
114114
} else {
115115
PyErr_Format(PyExc_IndexError,
116116
"index %" NPY_INTP_FMT " is out of bounds "
117117
"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);
120118
}
121119
return -1;
122120
}
@@ -173,13 +171,13 @@ check_and_adjust_axis(int *axis, int ndim)
173171
#define NPY_ALIGNOF(type) alignof(type)
174172
#elif (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
175173
|| (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
176-
&& !defined __clang__) \
174+
&& !defined __clang__) \
177175
|| (defined __clang__ && __clang_major__ < 8))
178-
#define NPY_ALIGNOF(type) __alignof__(type)
176+
# define NPY_ALIGNOF(type) offsetof(struct {char c; type v;}, v)
179177
#else
180-
#define NPY_ALIGNOF(type) _Alignof(type)
178+
# define NPY_ALIGNOF(type) _Alignof(type)
181179
#endif
182-
#define NPY_ALIGNOF_UINT(type) NPY_ALIGNOF(type)
180+
#define NPY_ALIGNOF_UINT(type) npy_uint_alignment(sizeof(type))
183181
/*
184182
* Disable harmless compiler warning "4116: unnamed type definition in
185183
* parentheses" which is caused by the _ALIGN macro.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.