summaryrefslogtreecommitdiff
path: root/libgfortran/generated/pack_r8.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/generated/pack_r8.c')
-rw-r--r--libgfortran/generated/pack_r8.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libgfortran/generated/pack_r8.c b/libgfortran/generated/pack_r8.c
index ba2e60d7519..582c2b9aeb1 100644
--- a/libgfortran/generated/pack_r8.c
+++ b/libgfortran/generated/pack_r8.c
@@ -122,11 +122,11 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
for (n = 0; n < dim; n++)
{
count[n] = 0;
- extent[n] = array->dim[n].ubound + 1 - array->dim[n].lbound;
+ extent[n] = GFC_DESCRIPTOR_EXTENT(array,n);
if (extent[n] <= 0)
zero_sized = 1;
- sstride[n] = array->dim[n].stride;
- mstride[n] = mask->dim[n].stride * mask_kind;
+ sstride[n] = GFC_DESCRIPTOR_STRIDE(array,n);
+ mstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(mask,n);
}
if (sstride[0] == 0)
sstride[0] = 1;
@@ -147,7 +147,7 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
{
/* The return array will have as many
elements as there are in VECTOR. */
- total = vector->dim[0].ubound + 1 - vector->dim[0].lbound;
+ total = GFC_DESCRIPTOR_EXTENT(vector,0);
if (total < 0)
{
total = 0;
@@ -215,9 +215,7 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
if (ret->data == NULL)
{
/* Setup the array descriptor. */
- ret->dim[0].lbound = 0;
- ret->dim[0].ubound = total - 1;
- ret->dim[0].stride = 1;
+ GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
ret->offset = 0;
if (total == 0)
@@ -234,7 +232,7 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
/* We come here because of range checking. */
index_type ret_extent;
- ret_extent = ret->dim[0].ubound + 1 - ret->dim[0].lbound;
+ ret_extent = GFC_DESCRIPTOR_EXTENT(ret,0);
if (total != ret_extent)
runtime_error ("Incorrect extent in return value of PACK intrinsic;"
" is %ld, should be %ld", (long int) total,
@@ -242,7 +240,7 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
}
}
- rstride0 = ret->dim[0].stride;
+ rstride0 = GFC_DESCRIPTOR_STRIDE(ret,0);
if (rstride0 == 0)
rstride0 = 1;
sstride0 = sstride[0];
@@ -291,11 +289,11 @@ pack_r8 (gfc_array_r8 *ret, const gfc_array_r8 *array,
/* Add any remaining elements from VECTOR. */
if (vector)
{
- n = vector->dim[0].ubound + 1 - vector->dim[0].lbound;
+ n = GFC_DESCRIPTOR_EXTENT(vector,0);
nelem = ((rptr - ret->data) / rstride0);
if (n > nelem)
{
- sstride0 = vector->dim[0].stride;
+ sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
if (sstride0 == 0)
sstride0 = 1;