summaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-13 20:28:08 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2008-06-13 20:28:08 +0000
commit1316e8f038a8b9009d9e3a7fbe5a02e03de634ab (patch)
tree6519779ba74e7e856024b0c512587694f342c5db /libgfortran/runtime
parent5ccd29b1395498fb7240b0c43a98dfc59d34405c (diff)
downloadgcc-1316e8f038a8b9009d9e3a7fbe5a02e03de634ab.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136763 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c
index 8632f152c95..71b481a7deb 100644
--- a/libgfortran/runtime/main.c
+++ b/libgfortran/runtime/main.c
@@ -45,10 +45,9 @@ stupid_function_name_for_static_linking (void)
return;
}
-/* This is the offset (in bytes) required to cast from logical(8)* to
- logical(4)*. and still get the same result. Will be 0 for little-endian
- machines and 4 for big-endian machines. */
-int l8_to_l4_offset = 0;
+/* This will be 0 for little-endian
+ machines and 1 for big-endian machines. */
+int big_endian = 0;
/* Figure out endianness for this machine. */
@@ -64,9 +63,9 @@ determine_endianness (void)
u.l8 = 1;
if (u.l4[0])
- l8_to_l4_offset = 0;
+ big_endian = 0;
else if (u.l4[1])
- l8_to_l4_offset = 1;
+ big_endian = 1;
else
runtime_error ("Unable to determine machine endianness");
}