From cea93abbe2d08a5a1df8cf6522d7d34aad3dca78 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Fri, 13 Jun 2008 20:28:08 +0000 Subject: re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8") 2008-06-13 Jerry DeLisle PR fortran/35863 * libgfortran.h: Change l8_to_l4_offset to big_endian and add endian_off. * runtime/main.c: Fix error in comment. Change l8_to_l4_offset to big_endian. (determine_endianness): Add endian_off and set its value according to big_endian. * gfortran.map: Add symbol for new _gfortran_transfer_character_wide. * io/io.h: Add prototype declarations for new functions. * io/list_read.c (list_formatted_read_scalar): Modify to handle kind=4. (list_formatted_read): Calculate stride based on kind for character type and use it when calling list_formatted_read_scalar. * io/inquire.c (inquire_via_unit): Change l8_to_l4_offset to big_endian. * io/open.c (st_open): Change l8_to_l4_offset to big_endian. * io/read.c (read_a_char4): New function to handle formatted read. * io/write.c: Define GFC_CHAR4(x) to improve readability of code. (write_a_char4): New function to handle formatted write. (write_character): Modify to accept the kind parameter and adjust for endianess of the machine. (list_formatted_write): Calculate the stride resulting from the kind and adjust the list_formatted_write_scalar call accordingly. (nml_write_obj): Adjust calls to write_character. (namelist_write): Likewise. * io/transfer.c (formatted_transfer_scaler): Rename 'len' argument to 'kind' argument to better describe what it is. Add calls to new functions for kind == 4. (formatted_transfer): Modify to handle the case of type character and kind equals 4 to pass in the kind to the transfer routines. (transfer_character_wide): Add this new function. (transfer_array): Don't set kind to the character string length. Adjust strides bases on character kind. (unformatted_read): Adjust size based on kind for character types. (unformatted_write): Likewise. (data_transfer_init): Change l8_to_l4_offset to big_endian. From-SVN: r136763 --- libgfortran/libgfortran.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libgfortran/libgfortran.h') diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 6ff9f4f..8c0f1b4 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -272,13 +272,12 @@ typedef GFC_UINTEGER_4 gfc_char4_t; simply equal to the kind parameter itself. */ #define GFC_SIZE_OF_CHAR_KIND(kind) (kind) - /* This will be 0 on little-endian machines and one on big-endian machines. */ -extern int l8_to_l4_offset; -internal_proto(l8_to_l4_offset); +extern int big_endian; +internal_proto(big_endian); #define GFOR_POINTER_TO_L1(p, kind) \ - (l8_to_l4_offset * (kind - 1) + (GFC_LOGICAL_1 *)(p)) + (big_endian * (kind - 1) + (GFC_LOGICAL_1 *)(p)) #define GFC_INTEGER_1_HUGE \ (GFC_INTEGER_1)((((GFC_UINTEGER_1)1) << 7) - 1) -- cgit v1.1