]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/shape_i16.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / shape_i16.c
index c2c52005a13a52b4436dd13ec8dd4ca0ee89a05a..7cc1dc5cd641c5afb9a62339f771427901f2f4c4 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the SHAPE intrinsic
-   Copyright 2002, 2006, 2007, 2009 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 95 runtime library (libgfortran).
+This file is part of the GNU Fortran runtime library (libgfortran).
 
 Libgfortran is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public
@@ -24,32 +24,28 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
 #include "libgfortran.h"
-#include <stdlib.h>
-#include <assert.h>
 
 
 #if defined (HAVE_GFC_INTEGER_16)
 
 extern void shape_16 (gfc_array_i16 * const restrict ret, 
-       const gfc_array_i16 * const restrict array);
+       const array_t * const restrict array);
 export_proto(shape_16);
 
 void
 shape_16 (gfc_array_i16 * const restrict ret, 
-       const gfc_array_i16 * const restrict array)
+       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->data == NULL)
+  if (ret->base_addr == NULL)
     {
       GFC_DIMENSION_SET(ret->dim[0], 0, rank - 1, 1);
       ret->offset = 0;
-      ret->data = internal_malloc_size (sizeof (GFC_INTEGER_16) * rank);
+      ret->base_addr = xmallocarray (rank, sizeof (GFC_INTEGER_16));
     }
 
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
@@ -57,10 +53,10 @@ shape_16 (gfc_array_i16 * const restrict ret,
   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->data[n * stride] = extent > 0 ? extent : 0 ;
+      ret->base_addr[n * stride] = extent > 0 ? extent : 0 ;
     }
 }