descriptor->dim[j].sm = byteSize;
byteSize *= extents[j];
}
- } else {
- for (std::size_t j{0}; j < rank; ++j) {
- descriptor->dim[j].lower_bound = lower_bound;
- descriptor->dim[j].extent = 0;
- descriptor->dim[j].sm = 0;
- }
}
return CFI_SUCCESS;
}
resRank = 0;
for (int j{0}; j < source->rank; ++j) {
if (actualStride[j] != 0) {
+ result->dim[resRank].lower_bound = 0;
result->dim[resRank].extent = extent[j];
result->dim[resRank].sm = actualStride[j] * source->dim[j].sm;
++resRank;
if (result->type != CFI_type_char) {
elem_len = result->elem_len;
}
- if (elem_len == 0) {
- return CFI_INVALID_ELEM_LEN; // TODO: is it wrong to forbid this?
- }
if (displacement + elem_len > source->elem_len) {
return CFI_INVALID_ELEM_LEN;
}
displacement + reinterpret_cast<char *>(source->base_addr));
result->elem_len = elem_len;
for (int j{0}; j < source->rank; ++j) {
- result->dim[j] = source->dim[j];
+ result->dim[j].lower_bound = 0;
+ result->dim[j].extent = source->dim[j].extent;
+ result->dim[j].sm = source->dim[j].sm;
}
return CFI_SUCCESS;
}