NUMPY_API * Update Several Flags at once. */
| 59 | * Update Several Flags at once. |
| 60 | */ |
| 61 | NPY_NO_EXPORT void |
| 62 | PyArray_UpdateFlags(PyArrayObject *ret, int flagmask) |
| 63 | { |
| 64 | /* Always update both, as its not trivial to guess one from the other */ |
| 65 | if (flagmask & (NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_C_CONTIGUOUS)) { |
| 66 | _UpdateContiguousFlags(ret); |
| 67 | } |
| 68 | if (flagmask & NPY_ARRAY_ALIGNED) { |
| 69 | if (IsAligned(ret)) { |
| 70 | PyArray_ENABLEFLAGS(ret, NPY_ARRAY_ALIGNED); |
| 71 | } |
| 72 | else { |
| 73 | PyArray_CLEARFLAGS(ret, NPY_ARRAY_ALIGNED); |
| 74 | } |
| 75 | } |
| 76 | /* |
| 77 | * This is not checked by default WRITEABLE is not |
| 78 | * part of UPDATE_ALL |
| 79 | */ |
| 80 | if (flagmask & NPY_ARRAY_WRITEABLE) { |
| 81 | if (_IsWriteable(ret)) { |
| 82 | PyArray_ENABLEFLAGS(ret, NPY_ARRAY_WRITEABLE); |
| 83 | } |
| 84 | else { |
| 85 | PyArray_CLEARFLAGS(ret, NPY_ARRAY_WRITEABLE); |
| 86 | } |
| 87 | } |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | /* |
| 92 | * Check whether the given array is stored contiguously |
no test coverage detected