[Patch, libfortran] Type cleanup
Janne Blomqvist
blomqvist.janne@gmail.com
Tue Apr 12 18:51:00 GMT 2011
Hi,
the attached patch does a bit of janitorial type cleanup for the
library. It replaces the use of ssize_t with ptrdiff_t or index_type
where appropriate; this is entirely for documentation purposes, as on
all targets we support ssize_t == ptrdiff_t.
ssize_t is a POSIX type used in the IO functions, and refers to the
size of an object or -1 for an error (hence there is SSIZE_MAX but not
SSIZE_MIN).
ptrdiff_t is a C89 type which is the result of subtracting two
pointers; hence it's also the "natural" type for array indexes.
Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
2011-04-12 Janne Blomqvist <jb@gcc.gnu.org>
* configure.ac: Use AC_TYPE_* to make sure we have (u)intptr_t,
check for ptrdiff_t.
* libgfortran.h: Remove (u)intptr_t definitions, use ptrdiff_t for
index_type, change cshift0* prototypes.
* config.h.in: Regenerated.
* configure: Regenerated.
* intrinsics/cshift0.c (cshift0): Use ptrdiff_t instead of ssize_t.
* io/io.h (array_loop_spec): Use index_type instead of ssize_t.
* io/list_read.c (nml_parse_qualifier): Likewise.
* io/write.c (nml_write_obj): Likewise.
* m4/cshift0.c (cshift0_'rtype_code`): Likewise.
* generated/cshift0_*.c: Regenerated.
--
Janne Blomqvist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: actypes.diff
Type: text/x-patch
Size: 10231 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110412/249b0c61/attachment.bin>
More information about the Gcc-patches
mailing list