summaryrefslogtreecommitdiff
path: root/libgfortran/m4/eoshift1.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/m4/eoshift1.m4')
-rw-r--r--libgfortran/m4/eoshift1.m427
1 files changed, 14 insertions, 13 deletions
diff --git a/libgfortran/m4/eoshift1.m4 b/libgfortran/m4/eoshift1.m4
index f68a56dc1eb..c6737ea2aa8 100644
--- a/libgfortran/m4/eoshift1.m4
+++ b/libgfortran/m4/eoshift1.m4
@@ -74,7 +74,7 @@ eoshift1 (gfc_array_char * const restrict ret,
soffset = 0;
roffset = 0;
- size = GFC_DESCRIPTOR_SIZE(array);
+ size = GFC_DESCRIPTOR_ELEM_LEN(array);
if (pwhich)
which = *pwhich - 1;
@@ -89,21 +89,22 @@ eoshift1 (gfc_array_char * const restrict ret,
{
int i;
+ ret->elem_len = array->elem_len;
+ ret->type = array->type;
ret->offset = 0;
- ret->dtype = array->dtype;
for (i = 0; i < GFC_DESCRIPTOR_RANK (array); i++)
{
- index_type ub, str;
+ index_type ext, sm;
- ub = GFC_DESCRIPTOR_EXTENT(array,i) - 1;
+ ext = GFC_DESCRIPTOR_EXTENT (array, i);
if (i == 0)
- str = 1;
+ sm = size;
else
- str = GFC_DESCRIPTOR_EXTENT(ret,i-1)
- * GFC_DESCRIPTOR_STRIDE(ret,i-1);
+ sm = GFC_DESCRIPTOR_EXTENT (ret, i-1)
+ * GFC_DESCRIPTOR_SM (ret, i-1);
- GFC_DIMENSION_SET(ret->dim[i], 0, ub, str);
+ GFC_DIMENSION_SET (ret->dim[i], 0, ext, sm);
}
/* xmallocarray allocates a single byte for zero size. */
@@ -130,10 +131,10 @@ eoshift1 (gfc_array_char * const restrict ret,
{
if (dim == which)
{
- roffset = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
+ roffset = GFC_DESCRIPTOR_SM(ret,dim);
if (roffset == 0)
roffset = size;
- soffset = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ soffset = GFC_DESCRIPTOR_SM(array,dim);
if (soffset == 0)
soffset = size;
len = GFC_DESCRIPTOR_EXTENT(array,dim);
@@ -142,10 +143,10 @@ eoshift1 (gfc_array_char * const restrict ret,
{
count[n] = 0;
extent[n] = GFC_DESCRIPTOR_EXTENT(array,dim);
- rstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(ret,dim);
- sstride[n] = GFC_DESCRIPTOR_STRIDE_BYTES(array,dim);
+ rstride[n] = GFC_DESCRIPTOR_SM(ret,dim);
+ sstride[n] = GFC_DESCRIPTOR_SM(array,dim);
- hstride[n] = GFC_DESCRIPTOR_STRIDE(h,n);
+ hstride[n] = GFC_DESCRIPTOR_STRIDE_TYPEKNOWN(h,n);
n++;
}
}