X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libgfortran%2Fgenerated%2Freshape_i4.c;h=e2f38e7e796fcf2810a4a47c7253ee259f7b2a39;hb=37e0271a833027439fd91f2364506a04d96cb72c;hp=99e3db4192d92bd50c8e85185aef920435d8a07e;hpb=93830de1da404ed79635b483769802c798b94980;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libgfortran/generated/reshape_i4.c b/libgfortran/generated/reshape_i4.c index 99e3db4192d..e2f38e7e796 100644 --- a/libgfortran/generated/reshape_i4.c +++ b/libgfortran/generated/reshape_i4.c @@ -1,5 +1,5 @@ /* Implementation of the RESHAPE - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2006 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -25,26 +25,34 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with libgfortran; see the file COPYING. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "config.h" #include #include #include "libgfortran.h" +#if defined (HAVE_GFC_INTEGER_4) + typedef GFC_ARRAY_DESCRIPTOR(1, index_type) shape_type; /* The shape parameter is ignored. We can currently deduce the shape from the return array. */ -extern void reshape_4 (gfc_array_i4 *, gfc_array_i4 *, shape_type *, - gfc_array_i4 *, shape_type *); +extern void reshape_4 (gfc_array_i4 * const restrict, + gfc_array_i4 * const restrict, + shape_type * const restrict, + gfc_array_i4 * const restrict, + shape_type * const restrict); export_proto(reshape_4); void -reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, - gfc_array_i4 * pad, shape_type * order) +reshape_4 (gfc_array_i4 * const restrict ret, + gfc_array_i4 * const restrict source, + shape_type * const restrict shape, + gfc_array_i4 * const restrict pad, + shape_type * const restrict order) { /* r.* indicates the return array. */ index_type rcount[GFC_MAX_DIMENSIONS]; @@ -76,15 +84,6 @@ reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, int n; int dim; - if (source->dim[0].stride == 0) - source->dim[0].stride = 1; - if (shape->dim[0].stride == 0) - shape->dim[0].stride = 1; - if (pad && pad->dim[0].stride == 0) - pad->dim[0].stride = 1; - if (order && order->dim[0].stride == 0) - order->dim[0].stride = 1; - if (ret->data == NULL) { rdim = shape->dim[0].ubound - shape->dim[0].lbound + 1; @@ -104,8 +103,6 @@ reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, else { rdim = GFC_DESCRIPTOR_RANK (ret); - if (ret->dim[0].stride == 0) - ret->dim[0].stride = 1; } rsize = 1; @@ -256,3 +253,5 @@ reshape_4 (gfc_array_i4 * ret, gfc_array_i4 * source, shape_type * shape, } } } + +#endif