diff options
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/environ.c | 2 | ||||
-rw-r--r-- | libgfortran/runtime/error.c | 100 | ||||
-rw-r--r-- | libgfortran/runtime/string.c | 3 |
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; } |