From f9bfed2243864c72c8a7822ce0ec9b7a1f2a35c8 Mon Sep 17 00:00:00 2001 From: Janne Blomqvist Date: Wed, 8 Apr 2009 19:48:07 +0300 Subject: string.c (compare0): Use gfc_charlen_type. 2009-04-08 Janne Blomqvist * runtime/string.c (compare0): Use gfc_charlen_type. * runtime/error.c (gfc_itoa): Move to io/write.c (xtoa): Rename to gfc_xtoa. * runtime/backtrace.c (show_backtrace): Call gfc_xtoa. * intrinsics/cshift0.c (cshift0): Use index_type for shift arg. * intrinsics/date_and_time.c (date_and_time): Use index_type. (itime_i4): Likewise. (itime_i8): Likewise. (idate_i4): Likewise. (idate_i8): Likewise. (gmtime_i4): Likewise. (gmtime_i8): Likewise. (ltime_i4): Likewise. (ltime_i8): Likewise. * libgfortran.h (gfc_itoa): Remove prototype. (xtoa): Rename prototype to gfc_xtoa. * io/list_read.c (nml_read_obj): Use size_t for string length. * io/transfer.c (read_block_direct): Change nbytes arg from pointer to value. (unformatted_read): Minor cleanup, call read_block_directly properly. (skip_record): Use ssize_t. (next_record_w_unf): Avoid stell() call by calling sseek with SEEK_CUR. (iolength_transfer): Make sure to multiply before cast. * io/intrinsics.c (fgetc): Remove unnecessary variable. * io/format.c (format_hash): Use gfc_charlen_type. * io/write.c (itoa): Move from runtime/error.c:gfc_itoa, rename, make static. (write_i): Call with pointer to itoa. (write_z): Call with pointer to gfc_xtoa. (write_integer): Pointer to itoa. (nml_write_obj): Type cleanup, don't call strlen in loop. From-SVN: r145758 --- libgfortran/intrinsics/cshift0.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libgfortran/intrinsics/cshift0.c') diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c index 73849d1..fa63cdc 100644 --- a/libgfortran/intrinsics/cshift0.c +++ b/libgfortran/intrinsics/cshift0.c @@ -1,5 +1,5 @@ /* Generic implementation of the CSHIFT intrinsic - Copyright 2003, 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. Contributed by Feng Wang This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -35,7 +35,7 @@ Boston, MA 02110-1301, USA. */ static void cshift0 (gfc_array_char * ret, const gfc_array_char * array, - ssize_t shift, int which, index_type size) + index_type shift, int which, index_type size) { /* r.* indicates the return array. */ index_type rstride[GFC_MAX_DIMENSIONS]; @@ -311,7 +311,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, rptr = ret->data; sptr = array->data; - shift = len == 0 ? 0 : shift % (ssize_t)len; + shift = len == 0 ? 0 : shift % len; if (shift < 0) shift += len; -- cgit v1.1