]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/libgfortran/lib/contrib/generated/minloc1_8_r10.c
Update
[l4.git] / l4 / pkg / libgfortran / lib / contrib / generated / minloc1_8_r10.c
index a9239d28cbd977b43433e1816894a304a68f58bd..3ed3080d56a833c26561c14bd2d8954657d9d69d 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the MINLOC intrinsic
-   Copyright 2002, 2007, 2009, 2010 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 runtime library (libgfortran).
@@ -80,7 +80,7 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -98,10 +98,9 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
-      retarray->data = internal_malloc_size (alloc_size);
+      retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
       if (alloc_size == 0)
        {
          /* Make sure we have a zero-sized array.  */
@@ -131,8 +130,8 @@ minloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        return;
     }
 
-  base = array->data;
-  dest = retarray->data;
+  base = array->base_addr;
+  dest = retarray->base_addr;
 
   continue_loop = 1;
   while (continue_loop)
@@ -243,7 +242,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
   if (len <= 0)
     return;
 
-  mbase = mask->data;
+  mbase = mask->base_addr;
 
   mask_kind = GFC_DESCRIPTOR_SIZE (mask);
 
@@ -279,7 +278,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -294,8 +293,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
 
        }
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
@@ -307,7 +305,7 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
 
     }
   else
@@ -332,8 +330,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        return;
     }
 
-  dest = retarray->data;
-  base = array->data;
+  dest = retarray->base_addr;
+  base = array->base_addr;
 
   while (base)
     {
@@ -354,12 +352,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        GFC_INTEGER_8 result2 = 0;
 #endif
        result = 0;
-       if (len <= 0)
-         *dest = 0;
-       else
+       for (n = 0; n < len; n++, src += delta, msrc += mdelta)
          {
-           for (n = 0; n < len; n++, src += delta, msrc += mdelta)
-             {
 
                if (*msrc)
                  {
@@ -387,9 +381,8 @@ mminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
                    minval = *src;
                    result = (GFC_INTEGER_8)n + 1;
                  }
-             }
-           *dest = result;
          }
+       *dest = result;
       }
       /* Advance to the next element.  */
       count[0]++;
@@ -472,7 +465,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
        extent[n] = 0;
     }
 
-  if (retarray->data == NULL)
+  if (retarray->base_addr == NULL)
     {
       size_t alloc_size, str;
 
@@ -490,8 +483,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       retarray->offset = 0;
       retarray->dtype = (array->dtype & ~GFC_DTYPE_RANK_MASK) | rank;
 
-      alloc_size = sizeof (GFC_INTEGER_8) * GFC_DESCRIPTOR_STRIDE(retarray,rank-1)
-                  * extent[rank-1];
+      alloc_size = GFC_DESCRIPTOR_STRIDE(retarray,rank-1) * extent[rank-1];
 
       if (alloc_size == 0)
        {
@@ -500,7 +492,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
          return;
        }
       else
-       retarray->data = internal_malloc_size (alloc_size);
+       retarray->base_addr = xmallocarray (alloc_size, sizeof (GFC_INTEGER_8));
     }
   else
     {
@@ -532,7 +524,7 @@ sminloc1_8_r10 (gfc_array_i8 * const restrict retarray,
       dstride[n] = GFC_DESCRIPTOR_STRIDE(retarray,n);
     }
 
-  dest = retarray->data;
+  dest = retarray->base_addr;
 
   while(1)
     {