]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/spread_i16.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / spread_i16.c
index 9ff7a6520998a92d5a632cbe2ad16f7937f87c12..9b3cf849f09cb285f643d5611a647090e4407683 100644 (file)
@@ -1,5 +1,5 @@
 /* Special implementation of the SPREAD intrinsic
-   Copyright (C) 2008-2017 Free Software Foundation, Inc.
+   Copyright (C) 2008-2024 Free Software Foundation, Inc.
    Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
    spread_generic.c written by Paul Brook <paul@nowt.org>
 
@@ -56,6 +56,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
 
   srank = GFC_DESCRIPTOR_RANK(source);
 
+  sstride[0] = 0; /* Avoid warnings if not initialized.  */
+  
   rrank = srank + 1;
   if (rrank > GFC_MAX_DIMENSIONS)
     runtime_error ("return rank too large in spread()");
@@ -72,7 +74,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
 
       /* The front end has signalled that we need to populate the
         return array descriptor.  */
-      ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank;
+      ret->dtype.rank = rrank;
+
       dim = 0;
       rs = 1;
       for (n = 0; n < rrank; n++)
@@ -227,10 +230,8 @@ spread_i16 (gfc_array_i16 *ret, const gfc_array_i16 *source,
 
 void
 spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
-                       const index_type along, const index_type pncopies)
+                       const index_type along, const index_type ncopies)
 {
-  int n;
-  int ncopies = pncopies;
   GFC_INTEGER_16 * restrict dest;
   index_type stride;
 
@@ -256,7 +257,7 @@ spread_scalar_i16 (gfc_array_i16 *ret, const GFC_INTEGER_16 *source,
   dest = ret->base_addr;
   stride = GFC_DESCRIPTOR_STRIDE(ret,0);
 
-  for (n = 0; n < ncopies; n++)
+  for (index_type n = 0; n < ncopies; n++)
     {
       *dest = *source;
       dest += stride;