From be8efac78d067c138ad8dda03df4336e73f94887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 8 Jan 2022 11:51:07 +0100 Subject: New upstream version 1.0 --- lib/printf-parse.c | 62 +++++++++++++++++------------------------------------- 1 file changed, 19 insertions(+), 43 deletions(-) (limited to 'lib/printf-parse.c') diff --git a/lib/printf-parse.c b/lib/printf-parse.c index b61841bb..aab02dc5 100644 --- a/lib/printf-parse.c +++ b/lib/printf-parse.c @@ -1,27 +1,18 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003, 2006-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006-2022 Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or - modify it under the terms of either: + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - - or - - * the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your - option) any later version. - - or both in parallel, as here. - This program is distributed in the hope that it will be useful, + This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + GNU Lesser General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, see . */ + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ /* This file can be parametrized with the following macros: CHAR_T The element type of the format string. @@ -57,16 +48,7 @@ #include /* Get intmax_t. */ -#if defined IN_LIBINTL || defined IN_LIBASPRINTF -# if HAVE_STDINT_H_WITH_UINTMAX -# include -# endif -# if HAVE_INTTYPES_H_WITH_UINTMAX -# include -# endif -#else -# include -#endif +#include /* malloc(), realloc(), free(). */ #include @@ -456,14 +438,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) switch (c) { case 'd': case 'i': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'long long' is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_LONGLONGINT; else -#endif - /* If 'long long' exists and is the same as 'long', we parse - "lld" into TYPE_LONGINT. */ + /* If 'long long' is the same as 'long', we parse "lld" into + TYPE_LONGINT. */ if (flags >= 8) type = TYPE_LONGINT; else if (flags & 2) @@ -474,14 +454,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_INT; break; case 'o': case 'u': case 'x': case 'X': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'unsigned long long' is larger than 'unsigned long': */ if (flags >= 16 || (flags & 4)) type = TYPE_ULONGLONGINT; else -#endif - /* If 'unsigned long long' exists and is the same as - 'unsigned long', we parse "llu" into TYPE_ULONGINT. */ + /* If 'unsigned long long' is the same as 'unsigned long', we + parse "llu" into TYPE_ULONGINT. */ if (flags >= 8) type = TYPE_ULONGINT; else if (flags & 2) @@ -534,14 +512,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) type = TYPE_POINTER; break; case 'n': -#if HAVE_LONG_LONG_INT - /* If 'long long' exists and is larger than 'long': */ + /* If 'long long' is larger than 'long': */ if (flags >= 16 || (flags & 4)) type = TYPE_COUNT_LONGLONGINT_POINTER; else -#endif - /* If 'long long' exists and is the same as 'long', we parse - "lln" into TYPE_COUNT_LONGINT_POINTER. */ + /* If 'long long' is the same as 'long', we parse "lln" into + TYPE_COUNT_LONGINT_POINTER. */ if (flags >= 8) type = TYPE_COUNT_LONGINT_POINTER; else if (flags & 2) -- cgit v1.2.3