From 0698e636f15fbb8d739d9fc724d480fe343a88c6 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Thu, 27 Oct 2005 07:48:44 +0000 Subject: [PATCH] Make gcc 4.0 happy by removing internal static declaration of write_integer and moving this function above its first point of usage. --- c/unix/io.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/c/unix/io.c b/c/unix/io.c index ed21219..1548ed9 100644 --- a/c/unix/io.c +++ b/c/unix/io.c @@ -146,26 +146,6 @@ ps_write_char(char ch, FILE *port) return 0; } } -long -ps_write_integer(long n, FILE *port) -{ - int status; - - static long write_integer(unsigned long n, FILE *port); - - if (n == 0) { - WRITE_CHAR('0', port, status); - return status; } - else if (n > 0) - return write_integer(n, port); - else { - WRITE_CHAR('-', port, status); - if (status == 0) - return write_integer(- n, port); - else - return status; } -} - static long write_integer(unsigned long n, FILE *port) { @@ -182,6 +162,24 @@ write_integer(unsigned long n, FILE *port) return status; } +long +ps_write_integer(long n, FILE *port) +{ + int status; + + if (n == 0) { + WRITE_CHAR('0', port, status); + return status; } + else if (n > 0) + return write_integer(n, port); + else { + WRITE_CHAR('-', port, status); + if (status == 0) + return write_integer(- n, port); + else + return status; } +} + long ps_write_string(char *string, FILE *port) {