/* Implementation of the SHAPE intrinsic
- Copyright (C) 2002-2015 Free Software Foundation, Inc.
+ Copyright (C) 2002-2020 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
This file is part of the GNU Fortran runtime library (libgfortran).
<http://www.gnu.org/licenses/>. */
#include "libgfortran.h"
-#include <stdlib.h>
-#include <assert.h>
#if defined (HAVE_GFC_INTEGER_16)
shape_16 (gfc_array_i16 * const restrict ret,
const array_t * const restrict array)
{
- int n;
index_type stride;
index_type extent;
- int rank;
- rank = GFC_DESCRIPTOR_RANK (array);
+ int rank = GFC_DESCRIPTOR_RANK (array);
if (ret->base_addr == NULL)
{
if (GFC_DESCRIPTOR_EXTENT(ret,0) < 1)
return;
- for (n = 0; n < rank; n++)
+ for (index_type n = 0; n < rank; n++)
{
extent = GFC_DESCRIPTOR_EXTENT(array,n);
ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;