aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <coudert@clipper.ens.fr>2007-01-17 20:44:00 +0100
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-01-17 19:44:00 +0000
commit0dce3ca161fa6664c8505cfe0718a9dbccb8765c (patch)
treeacb8b6ff735e7961042f7c90dac13e2947fc3c83 /libgfortran/runtime
parente7fd0be47b7afeb96031c3e6ba9ff0eddf7a848a (diff)
downloadgcc-0dce3ca161fa6664c8505cfe0718a9dbccb8765c.zip
gcc-0dce3ca161fa6664c8505cfe0718a9dbccb8765c.tar.gz
gcc-0dce3ca161fa6664c8505cfe0718a9dbccb8765c.tar.bz2
re PR libfortran/27107 (Make dependency on io/io.h broken)
PR libfortran/27107 * runtime/environ.c: Don't include io/io.h. * runtime/string.c: Don't include io/io.h. (compare0): Add cast to avoid warning. * runtime/error.c: Don't include io/io.h. (st_printf): Move to io/unix.c. * intrinsics/flush.c: Delete, contents moved to io/intrinsics.c. * intrinsics/fget.c: Likewise. * intrinsics/ftell.c: Likewise. * intrinsics/tty.c: Likewise. * libgfortran.h (DEFAULT_RECL, notification_std, get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR): New declarations. * io/io.h (DEFAULT_RECL, notification_std, get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR): Move to libgfortran.h. * io/unix.c: Add io/unix.h content. (st_printf): New function. * io/intrinsics.c: New file. * io/unix.h: Remove, contents moved into unix.c. * libtool-version: Update library version to 3.0.0. * configure.ac: Update library version to 0.3. * Makefile.am (intrinsics/fget.c, intrinsics/flush.c, intrinsics/ftell.c, intrinsics/tty.c, libgfortran.h): Remove targets. * Makefile.in: Regenerate. * configure: Regenerate. From-SVN: r120869
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r--libgfortran/runtime/environ.c2
-rw-r--r--libgfortran/runtime/error.c100
-rw-r--r--libgfortran/runtime/string.c3
3 files changed, 1 insertions, 104 deletions
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index 555b448..21c2cc9 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -34,8 +34,6 @@ Boston, MA 02110-1301, USA. */
#include <ctype.h>
#include "libgfortran.h"
-#include "../io/io.h"
-
/* Environment scanner. Examine the environment for controlling minor
* aspects of the program's execution. Our philosophy here that the
diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c
index 3595564..c0787de 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -37,8 +37,6 @@ Boston, MA 02110-1301, USA. */
#include <errno.h>
#include "libgfortran.h"
-#include "../io/io.h"
-#include "../io/unix.h"
/* Error conditions. The tricky part here is printing a message when
* it is the I/O subsystem that is severely wounded. Our goal is to
@@ -122,104 +120,6 @@ xtoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len)
}
-/* st_printf()-- simple printf() function for streams that handles the
- * formats %d, %s and %c. This function handles printing of error
- * messages that originate within the library itself, not from a user
- * program. */
-
-int
-st_printf (const char *format, ...)
-{
- int count, total;
- va_list arg;
- char *p;
- const char *q;
- stream *s;
- char itoa_buf[GFC_ITOA_BUF_SIZE];
- unix_stream err_stream;
-
- total = 0;
- s = init_error_stream (&err_stream);
- va_start (arg, format);
-
- for (;;)
- {
- count = 0;
-
- while (format[count] != '%' && format[count] != '\0')
- count++;
-
- if (count != 0)
- {
- p = salloc_w (s, &count);
- memmove (p, format, count);
- sfree (s);
- }
-
- total += count;
- format += count;
- if (*format++ == '\0')
- break;
-
- switch (*format)
- {
- case 'c':
- count = 1;
-
- p = salloc_w (s, &count);
- *p = (char) va_arg (arg, int);
-
- sfree (s);
- break;
-
- case 'd':
- q = gfc_itoa (va_arg (arg, int), itoa_buf, sizeof (itoa_buf));
- count = strlen (q);
-
- p = salloc_w (s, &count);
- memmove (p, q, count);
- sfree (s);
- break;
-
- case 'x':
- q = xtoa (va_arg (arg, unsigned), itoa_buf, sizeof (itoa_buf));
- count = strlen (q);
-
- p = salloc_w (s, &count);
- memmove (p, q, count);
- sfree (s);
- break;
-
- case 's':
- q = va_arg (arg, char *);
- count = strlen (q);
-
- p = salloc_w (s, &count);
- memmove (p, q, count);
- sfree (s);
- break;
-
- case '\0':
- return total;
-
- default:
- count = 2;
- p = salloc_w (s, &count);
- p[0] = format[-1];
- p[1] = format[0];
- sfree (s);
- break;
- }
-
- total += count;
- format++;
- }
-
- va_end (arg);
- return total;
-}
-
-
/* st_sprintf()-- Simple sprintf() for formatting memory buffers. */
void
diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c
index a92082f..a0c4498 100644
--- a/libgfortran/runtime/string.c
+++ b/libgfortran/runtime/string.c
@@ -31,7 +31,6 @@ Boston, MA 02110-1301, USA. */
#include <string.h>
#include "libgfortran.h"
-#include "../io/io.h"
/* Compare a C-style string with a fortran style string in a case-insensitive
manner. Used for decoding string options to various statements. Returns
@@ -44,7 +43,7 @@ compare0 (const char *s1, int s1_len, const char *s2)
/* Strip trailing blanks from the Fortran string. */
len = fstrlen (s1, s1_len);
- if(len != strlen(s2)) return 0; /* don't match */
+ if (len != (int) strlen(s2)) return 0; /* don't match */
return strncasecmp (s1, s2, len) == 0;
}