]> 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 e7a533111c8e814dc29c5b506c8382ab23f04776..0c99509cfda1c898c5fdd147266d58483bad9441 100644 (file)
@@ -1,5 +1,5 @@
 /* Specific implementation of the UNPACK intrinsic
-   Copyright (C) 2008-2014 Free Software Foundation, Inc.
+   Copyright (C) 2008-2020 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>
 
 
@@ -99,11 +97,13 @@ unpack0_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
     }
   else
     {
       dim = GFC_DESCRIPTOR_RANK (ret);
+      /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+      rstride[0] = 1;
       for (n = 0; n < dim; n++)
        {
          count[n] = 0;
@@ -244,11 +244,13 @@ unpack1_c16 (gfc_array_c16 *ret, const gfc_array_c16 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->base_addr = xmalloc (rs * sizeof (GFC_COMPLEX_16));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_COMPLEX_16));
     }
   else
     {
       dim = GFC_DESCRIPTOR_RANK (ret);
+      /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+      rstride[0] = 1;
       for (n = 0; n < dim; n++)
        {
          count[n] = 0;