#include <string.h>
#include "libgfortran.h"
-static const char zeros[16] =
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-
-extern void eoshift3_8 (gfc_array_char *, gfc_array_char *,
- gfc_array_i8 *, const gfc_array_char *,
- GFC_INTEGER_8 *);
-export_proto(eoshift3_8);
-
-void
-eoshift3_8 (gfc_array_char *ret, gfc_array_char *array,
- gfc_array_i8 *h, const gfc_array_char *bound,
- GFC_INTEGER_8 *pwhich)
+static void
+eoshift3 (gfc_array_char *ret, const gfc_array_char *array, const gfc_array_i8 *h,
+ const gfc_array_char *bound, const GFC_INTEGER_8 *pwhich,
+ index_type size, char filler)
{
/* r.* indicates the return array. */
index_type rstride[GFC_MAX_DIMENSIONS];
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
index_type dim;
- index_type size;
index_type len;
index_type n;
int which;
else
which = 0;
- size = GFC_DESCRIPTOR_SIZE (ret);
if (ret->data == NULL)
{
int i;
extent[0] = 1;
count[0] = 0;
- size = GFC_DESCRIPTOR_SIZE (array);
n = 0;
for (dim = 0; dim < GFC_DESCRIPTOR_RANK (array); dim++)
{
if (bound)
bptr = bound->data;
else
- bptr = zeros;
+ bptr = NULL;
while (rptr)
{
dest = rptr;
n = delta;
- while (n--)
- {
- memcpy (dest, bptr, size);
- dest += roffset;
- }
+ if (bptr)
+ while (n--)
+ {
+ memcpy (dest, bptr, size);
+ dest += roffset;
+ }
+ else
+ while (n--)
+ {
+ memset (dest, filler, size);
+ dest += roffset;
+ }
/* Advance to the next section. */
rptr += rstride0;
}
}
}
+
+extern void eoshift3_8 (gfc_array_char *, const gfc_array_char *,
+ const gfc_array_i8 *, const gfc_array_char *,
+ const GFC_INTEGER_8 *);
+export_proto(eoshift3_8);
+
+void
+eoshift3_8 (gfc_array_char *ret, const gfc_array_char *array,
+ const gfc_array_i8 *h, const gfc_array_char *bound,
+ const GFC_INTEGER_8 *pwhich)
+{
+ eoshift3 (ret, array, h, bound, pwhich, GFC_DESCRIPTOR_SIZE (array), 0);
+}
+
+extern void eoshift3_8_char (gfc_array_char *, GFC_INTEGER_4,
+ const gfc_array_char *,
+ const gfc_array_i8 *,
+ const gfc_array_char *,
+ const GFC_INTEGER_8 *, GFC_INTEGER_4,
+ GFC_INTEGER_4);
+export_proto(eoshift3_8_char);
+
+void
+eoshift3_8_char (gfc_array_char *ret,
+ GFC_INTEGER_4 ret_length __attribute__((unused)),
+ const gfc_array_char *array, const gfc_array_i8 *h,
+ const gfc_array_char *bound,
+ const GFC_INTEGER_8 *pwhich,
+ GFC_INTEGER_4 array_length,
+ GFC_INTEGER_4 bound_length
+ __attribute__((unused)))
+{
+ eoshift3 (ret, array, h, bound, pwhich, array_length, ' ');
+}