]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgfortran/generated/unpack_c16.c
Update copyright years.
[thirdparty/gcc.git] / libgfortran / generated / unpack_c16.c
index f33830d43ae5ac2c56a9a38608c1321b96f4e555..58e4c15454e64e1b941be8a452457771f008cec5 100644 (file)
@@ -1,5 +1,5 @@
 /* Specific implementation of the UNPACK intrinsic
-   Copyright 2008, 2009, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
    unpack_generic.c by Paul Brook <paul@nowt.org>.
 
@@ -25,8 +25,6 @@ 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>
 #include <string.h>
 
 
@@ -81,6 +79,8 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
   else
     runtime_error ("Funny sized logical array");
 
+  /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+  rstride[0] = 1;
   if (ret->base_addr == NULL)
     {
       /* The front end has signalled that we need to populate the
@@ -99,7 +99,7 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->base_addr = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
     }
   else
     {
@@ -225,6 +225,8 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
   else
     runtime_error ("Funny sized logical array");
 
+  /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+  rstride[0] = 1;
   if (ret->base_addr == NULL)
     {
       /* The front end has signalled that we need to populate the
@@ -244,7 +246,7 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->base_addr = internal_malloc_size (rs * sizeof (GFC_COMPLEX_16));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
     }
   else
     {