[gcc r16-3611] libgomp: Use consistent formatting in <omp.h>

Jakub Jelinek jakub@gcc.gnu.org
Sat Sep 6 10:25:49 GMT 2025


https://gcc.gnu.org/g:db7a807ef26de75abb75eec7834a95b9a9b98e5d

commit r16-3611-gdb7a807ef26de75abb75eec7834a95b9a9b98e5d
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Sep 6 12:24:31 2025 +0200

    libgomp: Use consistent formatting in <omp.h>
    
    I've noticed the new C++ part of omp.h uses libstdc++ coding conventions,
    while the rest of the header (and libgomp) is formatted using the normal
    gcc coding conventions like gcc/.
    
    This patch makes it consistent.
    
    2025-09-06  Jakub Jelinek  <jakub@redhat.com>
    
            * omp.h.in: Fix up formatting of __cplusplus >= 201103L
            guarded code from libstc++ style to GCC/libgomp style.

Diff:
---
 libgomp/omp.h.in | 83 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 42 insertions(+), 41 deletions(-)

diff --git a/libgomp/omp.h.in b/libgomp/omp.h.in
index 4f2bc46a76aa..60cb2b21be74 100644
--- a/libgomp/omp.h.in
+++ b/libgomp/omp.h.in
@@ -449,104 +449,104 @@ namespace allocator
 namespace __detail
 {
 
-template<typename __T, omp_allocator_handle_t __Handle>
+template <typename __T, omp_allocator_handle_t __Handle>
 struct __allocator_templ
 {
   using value_type = __T;
-  using pointer = __T*;
-  using const_pointer = const __T*;
+  using pointer = __T *;
+  using const_pointer = const __T *;
   using size_type = __SIZE_TYPE__;
   using difference_type = __PTRDIFF_TYPE__;
 
-  __T*
+  __T *
   allocate (size_type __n)
   {
-    if (__SIZE_MAX__ / sizeof(__T) < __n)
+    if (__SIZE_MAX__ / sizeof (__T) < __n)
       std::__throw_bad_array_new_length ();
     void *__p = omp_aligned_alloc (alignof(__T), __n * sizeof(__T), __Handle);
     if (!__p)
       std::__throw_bad_alloc ();
-    return static_cast<__T*>(__p);
+    return static_cast <__T *> (__p);
   }
 
   void
   deallocate (__T *__p, size_type) __GOMP_NOTHROW
   {
-    omp_free (static_cast<void*>(__p), __Handle);
+    omp_free (static_cast <void *> (__p), __Handle);
   }
 };
 
-template<typename __T, typename __U, omp_allocator_handle_t __Handle>
+template <typename __T, typename __U, omp_allocator_handle_t __Handle>
 constexpr bool
-operator== (const __allocator_templ<__T, __Handle>&,
-	    const __allocator_templ<__U, __Handle>&) __GOMP_NOTHROW
+operator== (const __allocator_templ <__T, __Handle> &,
+	    const __allocator_templ <__U, __Handle> &) __GOMP_NOTHROW
 {
   return true;
 }
 
-template<typename __T, omp_allocator_handle_t __Handle,
-	 typename __U, omp_allocator_handle_t __UHandle>
+template <typename __T, omp_allocator_handle_t __Handle,
+	  typename __U, omp_allocator_handle_t __UHandle>
 constexpr bool
-operator== (const __allocator_templ<__T, __Handle>&,
-	    const __allocator_templ<__U, __UHandle>&) __GOMP_NOTHROW
+operator== (const __allocator_templ <__T, __Handle> &,
+	    const __allocator_templ <__U, __UHandle> &) __GOMP_NOTHROW
 {
   return false;
 }
 
-template<typename __T, typename __U, omp_allocator_handle_t __Handle>
+template <typename __T, typename __U, omp_allocator_handle_t __Handle>
 constexpr bool
-operator!= (const __allocator_templ<__T, __Handle>&,
-	    const __allocator_templ<__U, __Handle>&) __GOMP_NOTHROW
+operator!= (const __allocator_templ <__T, __Handle> &,
+	    const __allocator_templ <__U, __Handle> &) __GOMP_NOTHROW
 {
   return false;
 }
 
-template<typename __T, omp_allocator_handle_t __Handle,
-	 typename __U, omp_allocator_handle_t __UHandle>
+template <typename __T, omp_allocator_handle_t __Handle,
+	  typename __U, omp_allocator_handle_t __UHandle>
 constexpr bool
-operator!= (const __allocator_templ<__T, __Handle>&,
-	    const __allocator_templ<__U, __UHandle>&) __GOMP_NOTHROW
+operator!= (const __allocator_templ <__T, __Handle> &,
+	    const __allocator_templ <__U, __UHandle> &) __GOMP_NOTHROW
 {
   return true;
 }
 
 } /* namespace __detail */
 
-template<typename __T>
+template <typename __T>
 struct null_allocator
-  : __detail::__allocator_templ<__T, omp_null_allocator> {};
+  : __detail::__allocator_templ <__T, omp_null_allocator> {};
 
-template<typename __T>
+template <typename __T>
 struct default_mem
-  : __detail::__allocator_templ<__T, omp_default_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_default_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct large_cap_mem
-  : __detail::__allocator_templ<__T, omp_large_cap_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_large_cap_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct const_mem
-  : __detail::__allocator_templ<__T, omp_const_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_const_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct high_bw_mem
-  : __detail::__allocator_templ<__T, omp_high_bw_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_high_bw_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct low_lat_mem
-  : __detail::__allocator_templ<__T, omp_low_lat_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_low_lat_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct cgroup_mem
-  : __detail::__allocator_templ<__T, omp_cgroup_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_cgroup_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct pteam_mem
-  : __detail::__allocator_templ<__T, omp_pteam_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_pteam_mem_alloc> {};
 
-template<typename __T>
+template <typename __T>
 struct thread_mem
-  : __detail::__allocator_templ<__T, omp_thread_mem_alloc> {};
+  : __detail::__allocator_templ <__T, omp_thread_mem_alloc> {};
 
 } /* namespace allocator */
 
@@ -558,9 +558,10 @@ namespace ompx
 namespace allocator
 {
 
-template<typename __T>
+template <typename __T>
 struct gnu_pinned_mem
-  : omp::allocator::__detail::__allocator_templ<__T, ompx_gnu_pinned_mem_alloc> {};
+  : omp::allocator::__detail::__allocator_templ <__T,
+						 ompx_gnu_pinned_mem_alloc> {};
 
 } /* namespace allocator */


More information about the Gcc-cvs mailing list