From c74e003b6efeef4ea94277c81ed6bdc01049a8c1 Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Sat, 14 Oct 2017 16:14:44 +0200 Subject: [PATCH 1/2] fix compilation with i586-pc-msdosdjgpp (using GCC 4.7.3) GCC raised a warning "mpz_inp_str_nowhite not defined, defined implicit" and directly afterwards error on the conflicting definition. I've actually not checked why it is not defined nor why the implicit definition is different - but swapping these two functions lead to a working compilation... --- mpz/inp_str.c | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/mpz/inp_str.c b/mpz/inp_str.c index 10a033ce..c6301c04 100644 --- a/mpz/inp_str.c +++ b/mpz/inp_str.c @@ -33,28 +33,6 @@ MA 02110-1301, USA. */ extern const unsigned char __gmp_digit_value_tab[]; #define digit_value_tab __gmp_digit_value_tab -size_t -mpz_inp_str (mpz_ptr x, FILE *stream, int base) -{ - int c; - size_t nread; - - if (stream == 0) - stream = stdin; - - nread = 0; - - /* Skip whitespace. */ - do - { - c = getc (stream); - nread++; - } - while (isspace (c)); - - return mpz_inp_str_nowhite (x, stream, base, c, nread); -} - /* shared by mpq_inp_str */ size_t mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) @@ -165,3 +143,26 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) (*__gmp_free_func) (str, alloc_size); return nread; } + +​ +size_t +mpz_inp_str (mpz_ptr x, FILE *stream, int base) +{ + int c; + size_t nread; +​ + if (stream == 0) + stream = stdin; +​ + nread = 0; +​ + /* Skip whitespace. */ + do + { + c = getc (stream); + nread++; + } + while (isspace (c)); +​ + return mpz_inp_str_nowhite (x, stream, base, c, nread); +} From fc047ca0367187dbcf13a55656ec624f4edf6138 Mon Sep 17 00:00:00 2001 From: Simon Sobisch Date: Sat, 14 Oct 2017 17:06:26 +0200 Subject: [PATCH 2/2] Update inp_str.c ...removing stray unicode characters that got in via GitHub editor.... --- mpz/inp_str.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mpz/inp_str.c b/mpz/inp_str.c index c6301c04..51ab10bc 100644 --- a/mpz/inp_str.c +++ b/mpz/inp_str.c @@ -144,18 +144,17 @@ mpz_inp_str_nowhite (mpz_ptr x, FILE *stream, int base, int c, size_t nread) return nread; } -​ size_t mpz_inp_str (mpz_ptr x, FILE *stream, int base) { int c; size_t nread; -​ + if (stream == 0) stream = stdin; -​ + nread = 0; -​ + /* Skip whitespace. */ do { @@ -163,6 +162,6 @@ mpz_inp_str (mpz_ptr x, FILE *stream, int base) nread++; } while (isspace (c)); -​ + return mpz_inp_str_nowhite (x, stream, base, c, nread); }