From: Paul Eggert Date: Thu, 20 Oct 2016 22:35:02 +0000 (-0700) Subject: quotearg-tests: pacify gcc -Wall X-Git-Tag: v1.0~6591 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=57adc478b0378c6fd631e63b9f3f8731624c811c;p=gnulib.git quotearg-tests: pacify gcc -Wall Problem reported by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00066.html * tests/test-quotearg-simple.c (use_quote_double_quotes): Move here ... * tests/test-quotearg.h: ... from here. --- diff --git a/ChangeLog b/ChangeLog index f274695df6..03d290f791 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2016-10-20 Paul Eggert + + quotearg-tests: pacify gcc -Wall + Problem reported by Bruno Haible in: + http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00066.html + * tests/test-quotearg-simple.c (use_quote_double_quotes): Move here ... + * tests/test-quotearg.h: ... from here. + 2016-10-20 Pádraig Brady canonicalize-lgpl: fix for missing SIZE_MAX on older systems diff --git a/tests/test-quotearg-simple.c b/tests/test-quotearg-simple.c index 9c71d03b54..99b69f4aff 100644 --- a/tests/test-quotearg-simple.c +++ b/tests/test-quotearg-simple.c @@ -245,6 +245,15 @@ static struct result_groups custom_results[] = { "\"'a' b'\"", "\"'" LQ_ENC RQ_ENC "'\"", "\"'" LQ RQ "'\"" } } }; +static char * +use_quote_double_quotes (const char *str, size_t *len) +{ + char *p = *len == SIZE_MAX ? quotearg_char (str, '"') + : quotearg_char_mem (str, *len, '"'); + *len = strlen (p); + return p; +} + int main (int argc _GL_UNUSED, char *argv[]) { diff --git a/tests/test-quotearg.h b/tests/test-quotearg.h index 1de74368d2..6e8510e5b4 100644 --- a/tests/test-quotearg.h +++ b/tests/test-quotearg.h @@ -118,15 +118,6 @@ use_quotearg (const char *str, size_t *len) return p; } -static char * -use_quote_double_quotes (const char *str, size_t *len) -{ - char *p = *len == SIZE_MAX ? quotearg_char (str, '"') - : quotearg_char_mem (str, *len, '"'); - *len = strlen (p); - return p; -} - static char * use_quotearg_colon (const char *str, size_t *len) {