]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/libgfortran/lib/contrib/generated/pack_c10.c
Update
[l4.git] / l4 / pkg / libgfortran / lib / contrib / generated / pack_c10.c
index 621ba8d8b797c6f5573c6b7386e8362815ed99ab..c1c9b6f6e703f47244dde139cfa42b0a1c15a0f7 100644 (file)
@@ -1,8 +1,8 @@
 /* Specific implementation of the PACK intrinsic
-   Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 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
@@ -98,7 +98,7 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
 
   dim = GFC_DESCRIPTOR_RANK (array);
 
-  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.  */
@@ -136,9 +136,9 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
   if (zero_sized)
     sptr = NULL;
   else
-    sptr = array->data;
+    sptr = array->base_addr;
 
-  if (ret->data == NULL || unlikely (compile_options.bounds_check))
+  if (ret->base_addr == NULL || unlikely (compile_options.bounds_check))
     {
       /* Count the elements, either for allocating memory or
         for bounds checking.  */
@@ -160,15 +160,15 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
          total = count_0 (mask);
         }
 
-      if (ret->data == NULL)
+      if (ret->base_addr == NULL)
        {
          /* Setup the array descriptor.  */
          GFC_DIMENSION_SET(ret->dim[0], 0, total-1, 1);
 
          ret->offset = 0;
 
-         /* internal_malloc_size allocates a single byte for zero size.  */
-         ret->data = internal_malloc_size (sizeof (GFC_COMPLEX_10) * total);
+         /* xmallocarray allocates a single byte for zero size.  */
+         ret->base_addr = xmallocarray (total, sizeof (GFC_COMPLEX_10));
 
          if (total == 0)
            return;
@@ -191,7 +191,7 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
     rstride0 = 1;
   sstride0 = sstride[0];
   mstride0 = mstride[0];
-  rptr = ret->data;
+  rptr = ret->base_addr;
 
   while (sptr && mptr)
     {
@@ -236,14 +236,14 @@ pack_c10 (gfc_array_c10 *ret, const gfc_array_c10 *array,
   if (vector)
     {
       n = GFC_DESCRIPTOR_EXTENT(vector,0);
-      nelem = ((rptr - ret->data) / rstride0);
+      nelem = ((rptr - ret->base_addr) / rstride0);
       if (n > nelem)
         {
           sstride0 = GFC_DESCRIPTOR_STRIDE(vector,0);
           if (sstride0 == 0)
             sstride0 = 1;
 
-          sptr = vector->data + sstride0 * nelem;
+          sptr = vector->base_addr + sstride0 * nelem;
           n -= nelem;
           while (n--)
             {