]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/libgfortran/lib/contrib/generated/reshape_r4.c
Update
[l4.git] / l4 / pkg / libgfortran / lib / contrib / generated / reshape_r4.c
index 2b859fca7d892dae7c7c5dbf281b134c4ea35311..75a07587e426a2a3bc78c239af47011dbfa99c0f 100644 (file)
@@ -1,8 +1,8 @@
 /* Implementation of the RESHAPE intrinsic
-   Copyright 2002, 2006, 2007, 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
@@ -87,7 +87,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
 
   for (n = 0; n < rdim; n++)
     {
-      shape_data[n] = shape->data[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
+      shape_data[n] = shape->base_addr[n * GFC_DESCRIPTOR_STRIDE(shape,0)];
       if (shape_data[n] <= 0)
       {
         shape_data[n] = 0;
@@ -95,7 +95,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
       }
     }
 
-  if (ret->data == NULL)
+  if (ret->base_addr == NULL)
     {
       index_type alloc_size;
 
@@ -111,11 +111,11 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
       ret->offset = 0;
 
       if (unlikely (rs < 1))
-        alloc_size = 1;
+        alloc_size = 0;
       else
-        alloc_size = rs * sizeof (GFC_REAL_4);
+        alloc_size = rs;
 
-      ret->data = internal_malloc_size (alloc_size);
+      ret->base_addr = xmallocarray (alloc_size, sizeof (GFC_REAL_4));
       ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rdim;
     }
 
@@ -143,7 +143,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
           else
             psize = 0;
         }
-      pptr = pad->data;
+      pptr = pad->base_addr;
     }
   else
     {
@@ -193,7 +193,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
 
          for (n = 0; n < rdim; n++)
            {
-             v = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+             v = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
 
              if (v < 0 || v >= rdim)
                runtime_error("Value %ld out of range in ORDER argument"
@@ -212,7 +212,7 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
   for (n = 0; n < rdim; n++)
     {
       if (order)
-        dim = order->data[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
+        dim = order->base_addr[n * GFC_DESCRIPTOR_STRIDE(order,0)] - 1;
       else
         dim = n;
 
@@ -258,12 +258,12 @@ reshape_r4 (gfc_array_r4 * const restrict ret,
       rsize *= sizeof (GFC_REAL_4);
       ssize *= sizeof (GFC_REAL_4);
       psize *= sizeof (GFC_REAL_4);
-      reshape_packed ((char *)ret->data, rsize, (char *)source->data,
-                     ssize, pad ? (char *)pad->data : NULL, psize);
+      reshape_packed ((char *)ret->base_addr, rsize, (char *)source->base_addr,
+                     ssize, pad ? (char *)pad->base_addr : NULL, psize);
       return;
     }
-  rptr = ret->data;
-  src = sptr = source->data;
+  rptr = ret->base_addr;
+  src = sptr = source->base_addr;
   rstride0 = rstride[0];
   sstride0 = sstride[0];