dnl Care should also be taken to avoid using the names defined in iparm.m4
define(START_ARRAY_FUNCTION,
`
-extern void name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *);
+extern void name`'rtype_qual`_'atype_code (rtype * const restrict,
+ atype * const restrict, const index_type * const restrict);
export_proto(name`'rtype_qual`_'atype_code);
void
-name`'rtype_qual`_'atype_code (rtype *retarray, atype *array, index_type *pdim)
+name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
+ atype * const restrict array,
+ const index_type * const restrict pdim)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
index_type sstride[GFC_MAX_DIMENSIONS];
index_type dstride[GFC_MAX_DIMENSIONS];
- atype_name *base;
- rtype_name *dest;
+ const atype_name * restrict base;
+ rtype_name * restrict dest;
index_type rank;
index_type n;
index_type len;
while (base)
{
- atype_name *src;
+ const atype_name * restrict src;
rtype_name result;
src = base;
{
}')dnl
define(START_MASKED_ARRAY_FUNCTION,
`
-extern void `m'name`'rtype_qual`_'atype_code (rtype *, atype *, index_type *,
- gfc_array_l4 *);
+extern void `m'name`'rtype_qual`_'atype_code (rtype * const restrict,
+ atype * const restrict, const index_type * const restrict,
+ gfc_array_l4 * const restrict);
export_proto(`m'name`'rtype_qual`_'atype_code);
void
-`m'name`'rtype_qual`_'atype_code (rtype * retarray, atype * array,
- index_type *pdim, gfc_array_l4 * mask)
+`m'name`'rtype_qual`_'atype_code (rtype * const restrict retarray,
+ atype * const restrict array,
+ const index_type * const restrict pdim,
+ gfc_array_l4 * const restrict mask)
{
index_type count[GFC_MAX_DIMENSIONS];
index_type extent[GFC_MAX_DIMENSIONS];
index_type sstride[GFC_MAX_DIMENSIONS];
index_type dstride[GFC_MAX_DIMENSIONS];
index_type mstride[GFC_MAX_DIMENSIONS];
- rtype_name *dest;
- atype_name *base;
- GFC_LOGICAL_4 *mbase;
+ rtype_name * restrict dest;
+ const atype_name * restrict base;
+ const GFC_LOGICAL_4 * restrict mbase;
int rank;
int dim;
index_type n;
while (base)
{
- atype_name *src;
- GFC_LOGICAL_4 *msrc;
+ const atype_name * restrict src;
+ const GFC_LOGICAL_4 * restrict msrc;
rtype_name result;
src = base;
msrc = mbase;