]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/libgfortran/lib/contrib/generated/unpack_i1.c
Update
[l4.git] / l4 / pkg / libgfortran / lib / contrib / generated / unpack_i1.c
index f5dcb93df812f4545f336c0cdd342f72ce0b6572..c5ab3dd493ccffd7a27cfebc21d0a1d4f5b50ad6 100644 (file)
@@ -1,9 +1,9 @@
 /* Specific implementation of the UNPACK intrinsic
-   Copyright 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2008-2015 Free Software Foundation, Inc.
    Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>, based on
    unpack_generic.c 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
@@ -61,7 +61,7 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
 
   empty = 0;
 
-  mptr = mask->data;
+  mptr = mask->base_addr;
 
   /* Use the same loop for all logical types, by using GFC_LOGICAL_1
      and using shifting to address size and endian issues.  */
@@ -81,7 +81,7 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
   else
     runtime_error ("Funny sized logical array");
 
-  if (ret->data == NULL)
+  if (ret->base_addr == NULL)
     {
       /* The front end has signalled that we need to populate the
         return array descriptor.  */
@@ -99,11 +99,13 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_1));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
     }
   else
     {
       dim = GFC_DESCRIPTOR_RANK (ret);
+      /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+      rstride[0] = 1;
       for (n = 0; n < dim; n++)
        {
          count[n] = 0;
@@ -127,8 +129,8 @@ unpack0_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
     vstride0 = 1;
   rstride0 = rstride[0];
   mstride0 = mstride[0];
-  rptr = ret->data;
-  vptr = vector->data;
+  rptr = ret->base_addr;
+  vptr = vector->base_addr;
 
   while (rptr)
     {
@@ -205,7 +207,7 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
 
   empty = 0;
 
-  mptr = mask->data;
+  mptr = mask->base_addr;
 
   /* Use the same loop for all logical types, by using GFC_LOGICAL_1
      and using shifting to address size and endian issues.  */
@@ -225,7 +227,7 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
   else
     runtime_error ("Funny sized logical array");
 
-  if (ret->data == NULL)
+  if (ret->base_addr == NULL)
     {
       /* The front end has signalled that we need to populate the
         return array descriptor.  */
@@ -244,11 +246,13 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
          rs *= extent[n];
        }
       ret->offset = 0;
-      ret->data = internal_malloc_size (rs * sizeof (GFC_INTEGER_1));
+      ret->base_addr = xmallocarray (rs, sizeof (GFC_INTEGER_1));
     }
   else
     {
       dim = GFC_DESCRIPTOR_RANK (ret);
+      /* Initialize to avoid -Wmaybe-uninitialized complaints.  */
+      rstride[0] = 1;
       for (n = 0; n < dim; n++)
        {
          count[n] = 0;
@@ -276,9 +280,9 @@ unpack1_i1 (gfc_array_i1 *ret, const gfc_array_i1 *vector,
   rstride0 = rstride[0];
   fstride0 = fstride[0];
   mstride0 = mstride[0];
-  rptr = ret->data;
-  fptr = field->data;
-  vptr = vector->data;
+  rptr = ret->base_addr;
+  fptr = field->base_addr;
+  vptr = vector->base_addr;
 
   while (rptr)
     {