diff options
Diffstat (limited to 'libgfortran/runtime')
-rw-r--r-- | libgfortran/runtime/backtrace.c | 4 | ||||
-rw-r--r-- | libgfortran/runtime/error.c | 43 | ||||
-rw-r--r-- | libgfortran/runtime/string.c | 4 |
3 files changed, 7 insertions, 44 deletions
diff --git a/libgfortran/runtime/backtrace.c b/libgfortran/runtime/backtrace.c index 4a3388841f8..0dd207466ef 100644 --- a/libgfortran/runtime/backtrace.c +++ b/libgfortran/runtime/backtrace.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. Contributed by François-Xavier Coudert This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -152,7 +152,7 @@ show_backtrace (void) /* Write the list of addresses in hexadecimal format. */ for (i = 0; i < depth; i++) - addr[i] = xtoa ((GFC_UINTEGER_LARGEST) (intptr_t) trace[i], addr_buf[i], + addr[i] = gfc_xtoa ((GFC_UINTEGER_LARGEST) (intptr_t) trace[i], addr_buf[i], sizeof (addr_buf[i])); /* Don't output an error message if something goes wrong, we'll simply diff --git a/libgfortran/runtime/error.c b/libgfortran/runtime/error.c index d75eaf23832..2dede7215c4 100644 --- a/libgfortran/runtime/error.c +++ b/libgfortran/runtime/error.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. Contributed by Andy Vaught This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -116,47 +116,10 @@ sys_exit (int code) * Other error returns are reserved for the STOP statement with a numeric code. */ -/* gfc_itoa()-- Integer to decimal conversion. */ +/* gfc_xtoa()-- Integer to hexadecimal conversion. */ const char * -gfc_itoa (GFC_INTEGER_LARGEST n, char *buffer, size_t len) -{ - int negative; - char *p; - GFC_UINTEGER_LARGEST t; - - assert (len >= GFC_ITOA_BUF_SIZE); - - if (n == 0) - return "0"; - - negative = 0; - t = n; - if (n < 0) - { - negative = 1; - t = -n; /*must use unsigned to protect from overflow*/ - } - - p = buffer + GFC_ITOA_BUF_SIZE - 1; - *p = '\0'; - - while (t != 0) - { - *--p = '0' + (t % 10); - t /= 10; - } - - if (negative) - *--p = '-'; - return p; -} - - -/* xtoa()-- Integer to hexadecimal conversion. */ - -const char * -xtoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len) +gfc_xtoa (GFC_UINTEGER_LARGEST n, char *buffer, size_t len) { int digit; char *p; diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c index ee7bcfb4be8..a14f82c502f 100644 --- a/libgfortran/runtime/string.c +++ b/libgfortran/runtime/string.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc. Contributed by Paul Brook This file is part of the GNU Fortran 95 runtime library (libgfortran). @@ -37,7 +37,7 @@ Boston, MA 02110-1301, USA. */ static int compare0 (const char *s1, gfc_charlen_type s1_len, const char *s2) { - size_t len; + gfc_charlen_type len; /* Strip trailing blanks from the Fortran string. */ len = fstrlen (s1, s1_len); |