[10/26] stdio-common: Move union printf_arg int <printf.h>

Message ID 65221473c57c0d0def4d698b81e95f4492a832c1.1647544751.git.fweimer@redhat.com
State Superseded
Headers
Series vfprintf rework to remove vtables |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent

Commit Message

Florian Weimer March 17, 2022, 7:30 p.m. UTC
  The type does not depend on wide vs narrow preprocessor macros,
so it does not need to be customized in stdio-common/printf-parse.h.
---
 include/printf.h            | 21 +++++++++++++++++++++
 stdio-common/printf-parse.h | 23 -----------------------
 2 files changed, 21 insertions(+), 23 deletions(-)
  

Comments

Adhemerval Zanella Netto May 20, 2022, 5:51 p.m. UTC | #1
On 17/03/2022 16:30, Florian Weimer via Libc-alpha wrote:
> The type does not depend on wide vs narrow preprocessor macros,
> so it does not need to be customized in stdio-common/printf-parse.h.


LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


> ---
>  include/printf.h            | 21 +++++++++++++++++++++
>  stdio-common/printf-parse.h | 23 -----------------------
>  2 files changed, 21 insertions(+), 23 deletions(-)
> 
> diff --git a/include/printf.h b/include/printf.h
> index e1ac20807b..770c32d8f8 100644
> --- a/include/printf.h
> +++ b/include/printf.h
> @@ -18,6 +18,27 @@ int __register_printf_specifier (int, printf_function,
>  				 printf_arginfo_size_function);
>  libc_hidden_proto (__register_printf_specifier)
>  
> +/* The various kinds of arguments that can be passed to printf.  */
> +union printf_arg
> +  {
> +    wchar_t pa_wchar;
> +    int pa_int;
> +    long int pa_long_int;
> +    long long int pa_long_long_int;
> +    unsigned int pa_u_int;
> +    unsigned long int pa_u_long_int;
> +    unsigned long long int pa_u_long_long_int;
> +    double pa_double;
> +    long double pa_long_double;
> +#if __HAVE_FLOAT128_UNLIKE_LDBL
> +    _Float128 pa_float128;
> +#endif
> +    const char *pa_string;
> +    const wchar_t *pa_wstring;
> +    void *pa_pointer;
> +    void *pa_user;
> +};
> +
>  #include <bits/types/locale_t.h>
>  
>  /* Now define the internal interfaces.  */
> diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
> index de0f289c1f..d00c165131 100644
> --- a/stdio-common/printf-parse.h
> +++ b/stdio-common/printf-parse.h
> @@ -44,29 +44,6 @@ struct printf_spec
>      int size;
>    };
>  
> -
> -/* The various kinds off arguments that can be passed to printf.  */
> -union printf_arg
> -  {
> -    wchar_t pa_wchar;
> -    int pa_int;
> -    long int pa_long_int;
> -    long long int pa_long_long_int;
> -    unsigned int pa_u_int;
> -    unsigned long int pa_u_long_int;
> -    unsigned long long int pa_u_long_long_int;
> -    double pa_double;
> -    long double pa_long_double;
> -#if __HAVE_FLOAT128_UNLIKE_LDBL
> -    _Float128 pa_float128;
> -#endif
> -    const char *pa_string;
> -    const wchar_t *pa_wstring;
> -    void *pa_pointer;
> -    void *pa_user;
> -  };
> -
> -
>  #ifndef DONT_NEED_READ_INT
>  /* Read a simple integer from a string and update the string pointer.
>     It is assumed that the first character is a digit.  */
  

Patch

diff --git a/include/printf.h b/include/printf.h
index e1ac20807b..770c32d8f8 100644
--- a/include/printf.h
+++ b/include/printf.h
@@ -18,6 +18,27 @@  int __register_printf_specifier (int, printf_function,
 				 printf_arginfo_size_function);
 libc_hidden_proto (__register_printf_specifier)
 
+/* The various kinds of arguments that can be passed to printf.  */
+union printf_arg
+  {
+    wchar_t pa_wchar;
+    int pa_int;
+    long int pa_long_int;
+    long long int pa_long_long_int;
+    unsigned int pa_u_int;
+    unsigned long int pa_u_long_int;
+    unsigned long long int pa_u_long_long_int;
+    double pa_double;
+    long double pa_long_double;
+#if __HAVE_FLOAT128_UNLIKE_LDBL
+    _Float128 pa_float128;
+#endif
+    const char *pa_string;
+    const wchar_t *pa_wstring;
+    void *pa_pointer;
+    void *pa_user;
+};
+
 #include <bits/types/locale_t.h>
 
 /* Now define the internal interfaces.  */
diff --git a/stdio-common/printf-parse.h b/stdio-common/printf-parse.h
index de0f289c1f..d00c165131 100644
--- a/stdio-common/printf-parse.h
+++ b/stdio-common/printf-parse.h
@@ -44,29 +44,6 @@  struct printf_spec
     int size;
   };
 
-
-/* The various kinds off arguments that can be passed to printf.  */
-union printf_arg
-  {
-    wchar_t pa_wchar;
-    int pa_int;
-    long int pa_long_int;
-    long long int pa_long_long_int;
-    unsigned int pa_u_int;
-    unsigned long int pa_u_long_int;
-    unsigned long long int pa_u_long_long_int;
-    double pa_double;
-    long double pa_long_double;
-#if __HAVE_FLOAT128_UNLIKE_LDBL
-    _Float128 pa_float128;
-#endif
-    const char *pa_string;
-    const wchar_t *pa_wstring;
-    void *pa_pointer;
-    void *pa_user;
-  };
-
-
 #ifndef DONT_NEED_READ_INT
 /* Read a simple integer from a string and update the string pointer.
    It is assumed that the first character is a digit.  */