diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-06-13 20:28:08 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2008-06-13 20:28:08 +0000 |
commit | cea93abbe2d08a5a1df8cf6522d7d34aad3dca78 (patch) | |
tree | 6519779ba74e7e856024b0c512587694f342c5db /libgfortran/io/inquire.c | |
parent | c5f4d1cc2f628f7ab48b905896082fcdfedfe889 (diff) | |
download | gcc-cea93abbe2d08a5a1df8cf6522d7d34aad3dca78.zip gcc-cea93abbe2d08a5a1df8cf6522d7d34aad3dca78.tar.gz gcc-cea93abbe2d08a5a1df8cf6522d7d34aad3dca78.tar.bz2 |
re PR libfortran/35863 ([F2003] Implement ENCODING="UTF-8")
2008-06-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
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
Diffstat (limited to 'libgfortran/io/inquire.c')
-rw-r--r-- | libgfortran/io/inquire.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index 5e0cf3e..9eb63d7 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -268,10 +268,9 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) case ENCODING_DEFAULT: p = "UNKNOWN"; break; - /* TODO: Enable UTF-8 case here when implemented. case ENCODING_UTF8: p = "UTF-8"; - break; */ + break; default: internal_error (&iqp->common, "inquire_via_unit(): Bad encoding"); } @@ -497,13 +496,13 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) else switch (u->flags.convert) { - /* l8_to_l4_offset is 0 for little-endian, 1 for big-endian. */ + /* big_endian is 0 for little-endian, 1 for big-endian. */ case GFC_CONVERT_NATIVE: - p = l8_to_l4_offset ? "BIG_ENDIAN" : "LITTLE_ENDIAN"; + p = big_endian ? "BIG_ENDIAN" : "LITTLE_ENDIAN"; break; case GFC_CONVERT_SWAP: - p = l8_to_l4_offset ? "LITTLE_ENDIAN" : "BIG_ENDIAN"; + p = big_endian ? "LITTLE_ENDIAN" : "BIG_ENDIAN"; break; default: |