[Libreoffice-commits] core.git: include/o3tl solenv/clang-format

2023-04-22 Thread Mike Kaganski (via logerrit)
 include/o3tl/char16_t2wchar_t.hxx |   32 
 solenv/clang-format/excludelist   |1 -
 2 files changed, 8 insertions(+), 25 deletions(-)

New commits:
commit ab55c7bffddc1a4c8f3d971d24bae297a15f3346
Author: Mike Kaganski 
AuthorDate: Sat Apr 22 10:25:57 2023 +0200
Commit: Mike Kaganski 
CommitDate: Sat Apr 22 12:45:38 2023 +0200

clang-format char16_t2wchar_t.hxx

Change-Id: I5b86fb372702e3a6fdb3e4aa6846c4bc2e754307
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150778
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/o3tl/char16_t2wchar_t.hxx 
b/include/o3tl/char16_t2wchar_t.hxx
index 6ffab02e78c9..cf0415343147 100644
--- a/include/o3tl/char16_t2wchar_t.hxx
+++ b/include/o3tl/char16_t2wchar_t.hxx
@@ -7,18 +7,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_O3TL_CHAR16_T2WCHAR_T_HXX
-#define INCLUDED_O3TL_CHAR16_T2WCHAR_T_HXX
+#pragma once
 
 #include 
 
-namespace o3tl {
-
+namespace o3tl
+{
 #if defined _WIN32
 // Helpers for safe conversion between wchar_t and char16_t in MSVC
 
 static_assert(sizeof(char16_t) == sizeof(wchar_t),
-"These helper functions are only applicable to implementations with 16-bit 
wchar_t");
+  "These helper functions are only applicable to implementations 
with 16-bit wchar_t");
 
 // While other implementations define wchar_t as 32-bit integral value, and 
mostly use
 // char-based UTF-8 string APIs, in MSVC wchar_t is (non-conformant) 16-bit, 
and Unicode
@@ -34,26 +33,11 @@ static_assert(sizeof(char16_t) == sizeof(wchar_t),
 //
 // Use these helpers for wchar_t (WSTR, WCHAR, OLESTR etc) to char16_t 
(sal_Unicode) string
 // conversions instead of reinterpret-cast in Windows-specific code.
-inline wchar_t * toW(char16_t * p)
-{
-return reinterpret_cast(p);
-}
-inline wchar_t const * toW(char16_t const * p)
-{
-return reinterpret_cast(p);
-}
-inline char16_t * toU(wchar_t * p)
-{
-return reinterpret_cast(p);
-}
-inline char16_t const * toU(wchar_t const * p)
-{
-return reinterpret_cast(p);
-}
+inline wchar_t* toW(char16_t* p) { return reinterpret_cast(p); }
+inline wchar_t const* toW(char16_t const* p) { return reinterpret_cast(p); }
+inline char16_t* toU(wchar_t* p) { return reinterpret_cast(p); }
+inline char16_t const* toU(wchar_t const* p) { return 
reinterpret_cast(p); }
 #endif
-
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index 211e9ca30c04..35d750b22cc9 100644
--- a/solenv/clang-format/excludelist
+++ b/solenv/clang-format/excludelist
@@ -5296,7 +5296,6 @@ include/linguistic/lngprophelp.hxx
 include/linguistic/misc.hxx
 include/linguistic/spelldta.hxx
 include/o3tl/any.hxx
-include/o3tl/char16_t2wchar_t.hxx
 include/o3tl/cow_wrapper.hxx
 include/o3tl/enumarray.hxx
 include/o3tl/enumrange.hxx


[Libreoffice-commits] core.git: include/o3tl solenv/clang-format

2019-02-25 Thread Libreoffice Gerrit user
 include/o3tl/make_unique.hxx  |   51 --
 solenv/clang-format/blacklist |1 
 2 files changed, 52 deletions(-)

New commits:
commit 97d68765d24c1a9e0715063b4f9c65585281a869
Author: Gabor Kelemen 
AuthorDate: Sat Feb 23 12:23:34 2019 +0100
Commit: Noel Grandin 
CommitDate: Mon Feb 25 17:24:20 2019 +0100

Drop include/o3tl/make_unique.hxx

In favor of std::make_unique

Change-Id: I0428076a10fb7b61c5add994c9970661b375b82c
Reviewed-on: https://gerrit.libreoffice.org/68254
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
Reviewed-by: Noel Grandin 

diff --git a/include/o3tl/make_unique.hxx b/include/o3tl/make_unique.hxx
deleted file mode 100644
index 555e9ca538b8..
--- a/include/o3tl/make_unique.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_O3TL_MAKE_UNIQUE_HXX
-#define INCLUDED_O3TL_MAKE_UNIQUE_HXX
-
-#include 
-#include 
-#include 
-
-namespace o3tl
-{
-
-/**
- * Constructs an object of type T and wraps it in a std::unique_ptr.
- *
- * Can be replaced by std::make_unique when we allow C++14.
- */
-template
-typename std::enable_if::value, std::unique_ptr>::type
-make_unique(Args&& ... args)
-{
-return std::unique_ptr(new T(std::forward(args)...));
-}
-
-/**
- * for arrays
- */
-template 
-typename std::enable_if
-<
-std::is_array::value,
-std::unique_ptr
->::type
-make_unique(std::size_t n)
-{
-typedef typename std::remove_extent::type RT;
-return std::unique_ptr(new RT[n]);
-}
-
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index 457743df6603..39c02006623c 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -6501,7 +6501,6 @@ include/o3tl/functional.hxx
 include/o3tl/lazy_update.hxx
 include/o3tl/lru_map.hxx
 include/o3tl/make_shared.hxx
-include/o3tl/make_unique.hxx
 include/o3tl/numeric.hxx
 include/o3tl/runtimetooustring.hxx
 include/o3tl/safeint.hxx
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits