[Libreoffice-commits] online.git: common/Authorization.hpp common/Clipboard.hpp common/Common.hpp common/Crypto.hpp common/FileUtil.hpp common/JsonUtil.hpp common/Log.hpp common/LOOLWebSocket.hpp common/Message.hpp common/MessageQueue.hpp common/Png.hpp common/Protocol.hpp common/Rectangle.hpp common/Seccomp.hpp common/security.h common/Session.hpp common/SigUtil.cpp common/SigUtil.hpp common/SpookyV2.h common/StringVector.hpp common/Unit.hpp common/UnitHTTP.hpp common/Util.hpp kit/ChildSession.hpp kit/Delta.hpp kit/DummyLibreOfficeKit.hpp kit/ForKit.cpp kit/KitHelper.hpp kit/Kit.hpp kit/Watermark.hpp net/DelaySocket.hpp net/FakeSocket.hpp net/ServerSocket.hpp net/Socket.hpp net/Ssl.hpp net/SslSocket.hpp net/WebSocketHandler.hpp test/countloolkits.hpp test/helpers.hpp test/lokassert.hpp test/test.hpp tools/Replay.hpp wsd/Admin.hpp wsd/AdminModel.hpp wsd/Auth.hpp wsd/ClientSession.hpp wsd/DocumentBroker.hpp wsd/Exceptions.hpp wsd/FileServer.hpp wsd/LOOLWSD.hpp wsd/ProofKey.hpp wsd/QueueHandler.hpp wsd/SenderQueue.hpp wsd/Storage.hpp wsd/TileCache.hpp wsd/TileDesc.hpp wsd/TraceFile.hpp wsd/UserMessages.hpp

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 18 13:00:40 UTC 2020


 common/Authorization.hpp    |    5 +----
 common/Clipboard.hpp        |    6 ++----
 common/Common.hpp           |    6 ++----
 common/Crypto.hpp           |    5 +----
 common/FileUtil.hpp         |    5 +----
 common/JsonUtil.hpp         |    5 +----
 common/LOOLWebSocket.hpp    |    5 +----
 common/Log.hpp              |    5 +----
 common/Message.hpp          |    5 +----
 common/MessageQueue.hpp     |    5 +----
 common/Png.hpp              |    2 ++
 common/Protocol.hpp         |    5 +----
 common/Rectangle.hpp        |    5 +----
 common/Seccomp.hpp          |    6 ++----
 common/Session.hpp          |    5 +----
 common/SigUtil.cpp          |    2 ++
 common/SigUtil.hpp          |    5 +----
 common/SpookyV2.h           |    2 ++
 common/StringVector.hpp     |    5 +----
 common/Unit.hpp             |    6 ++----
 common/UnitHTTP.hpp         |    6 ++----
 common/Util.hpp             |    5 +----
 common/security.h           |    2 ++
 kit/ChildSession.hpp        |    5 +----
 kit/Delta.hpp               |    6 ++----
 kit/DummyLibreOfficeKit.hpp |    5 +----
 kit/ForKit.cpp              |    1 +
 kit/Kit.hpp                 |    6 ++----
 kit/KitHelper.hpp           |    5 +----
 kit/Watermark.hpp           |    6 ++----
 net/DelaySocket.hpp         |    5 +----
 net/FakeSocket.hpp          |    5 +----
 net/ServerSocket.hpp        |    5 +----
 net/Socket.hpp              |    4 +---
 net/Ssl.hpp                 |    5 +----
 net/SslSocket.hpp           |    5 +----
 net/WebSocketHandler.hpp    |    5 +----
 test/countloolkits.hpp      |    5 +----
 test/helpers.hpp            |    4 +---
 test/lokassert.hpp          |    5 +----
 test/test.hpp               |    5 +----
 tools/Replay.hpp            |    5 +----
 wsd/Admin.hpp               |    5 +----
 wsd/AdminModel.hpp          |    5 +----
 wsd/Auth.hpp                |    6 ++----
 wsd/ClientSession.hpp       |    6 +-----
 wsd/DocumentBroker.hpp      |    5 +----
 wsd/Exceptions.hpp          |    6 ++----
 wsd/FileServer.hpp          |    5 +----
 wsd/LOOLWSD.hpp             |    5 +----
 wsd/ProofKey.hpp            |    6 ++----
 wsd/QueueHandler.hpp        |    2 ++
 wsd/SenderQueue.hpp         |    5 +----
 wsd/Storage.hpp             |    6 ++----
 wsd/TileCache.hpp           |    5 +----
 wsd/TileDesc.hpp            |    5 +----
 wsd/TraceFile.hpp           |    5 +----
 wsd/UserMessages.hpp        |    6 ++----
 58 files changed, 76 insertions(+), 207 deletions(-)

New commits:
commit 4eb598711cd6162452a28285abbd65c6397f58bf
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Sat Apr 18 11:39:50 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Sat Apr 18 15:00:18 2020 +0200

    Use #pragma once
    
    LibreOffice core uses that, too, and we support an even more
    restricted set of compilers.
    
    Change-Id: I0d0e2c8608e323eb5ef0f35ee8c46d02ab49a745
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92467
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/common/Authorization.hpp b/common/Authorization.hpp
index c8c594988..4fd2f3671 100644
--- a/common/Authorization.hpp
+++ b/common/Authorization.hpp
@@ -9,8 +9,7 @@
 
 // WOPI Authorization
 
-#ifndef INCLUDED_AUTHORIZATION_HPP
-#define INCLUDED_AUTHORIZATION_HPP
+#pragma once
 
 #include <string>
 
@@ -51,6 +50,4 @@ public:
     void authorizeRequest(Poco::Net::HTTPRequest& request) const;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Clipboard.hpp b/common/Clipboard.hpp
index 0b4bee438..15e5e58e2 100644
--- a/common/Clipboard.hpp
+++ b/common/Clipboard.hpp
@@ -8,8 +8,8 @@
  */
 
 // Clipboard abstraction.
-#ifndef INCLUDED_CLIPBOARD_HPP
-#define INCLUDED_CLIPBOARD_HPP
+
+#pragma once
 
 #include <string>
 #include <vector>
@@ -142,6 +142,4 @@ public:
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Common.hpp b/common/Common.hpp
index ab9989e73..b12cc67b5 100644
--- a/common/Common.hpp
+++ b/common/Common.hpp
@@ -7,11 +7,11 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#pragma once
+
 #include <string>
 
 // Default values and other shared data between processes.
-#ifndef INCLUDED_COMMON_HPP
-#define INCLUDED_COMMON_HPP
 
 constexpr int DEFAULT_CLIENT_PORT_NUMBER = 9980;
 
@@ -50,6 +50,4 @@ constexpr const char CAPABILITIES_END_POINT[] = "/hosting/capabilities";
 extern int ClientPortNumber;
 extern std::string MasterLocation;
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Crypto.hpp b/common/Crypto.hpp
index 079a4f742..270e74e0e 100644
--- a/common/Crypto.hpp
+++ b/common/Crypto.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_CRYPTO_HPP
-#define INCLUDED_CRYPTO_HPP
+#pragma once
 
 #if ENABLE_SUPPORT_KEY
 
@@ -39,6 +38,4 @@ public:
 
 #endif
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/FileUtil.hpp b/common/FileUtil.hpp
index 864188308..29426e16c 100644
--- a/common/FileUtil.hpp
+++ b/common/FileUtil.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_FILEUTIL_HPP
-#define INCLUDED_FILEUTIL_HPP
+#pragma once
 
 #include <string>
 
@@ -98,6 +97,4 @@ namespace FileUtil
 
 } // end namespace FileUtil
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/JsonUtil.hpp b/common/JsonUtil.hpp
index c7fa20ac2..42cd4e915 100644
--- a/common/JsonUtil.hpp
+++ b/common/JsonUtil.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_JSONUTIL_HPP
-#define INCLUDED_JSONUTIL_HPP
+#pragma once
 
 #include <cstddef>
 #include <set>
@@ -140,7 +139,5 @@ bool findJSONValue(Poco::JSON::Object::Ptr &object, const std::string& key, T& v
 
 } // end namespace JsonUtil
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 
diff --git a/common/LOOLWebSocket.hpp b/common/LOOLWebSocket.hpp
index 2c0559593..a99c3afb0 100644
--- a/common/LOOLWebSocket.hpp
+++ b/common/LOOLWebSocket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LOOLWEBSOCKET_HPP
-#define INCLUDED_LOOLWEBSOCKET_HPP
+#pragma once
 
 #include <cstdlib>
 #include <mutex>
@@ -157,6 +156,4 @@ public:
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Log.hpp b/common/Log.hpp
index aa83bc171..bc96035e9 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LOG_HPP
-#define INCLUDED_LOG_HPP
+#pragma once
 
 #include <sys/syscall.h>
 #include <unistd.h>
@@ -409,6 +408,4 @@ namespace Log
         }                                                                                          \
     } while (false)
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Message.hpp b/common/Message.hpp
index 9320037c7..8fc894b96 100644
--- a/common/Message.hpp
+++ b/common/Message.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_MESSAGE_HPP
-#define INCLUDED_MESSAGE_HPP
+#pragma once
 
 #include <atomic>
 #include <string>
@@ -184,6 +183,4 @@ private:
     const Type _type;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp
index bf5f6c950..f315de558 100644
--- a/common/MessageQueue.hpp
+++ b/common/MessageQueue.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_MESSAGEQUEUE_HPP
-#define INCLUDED_MESSAGEQUEUE_HPP
+#pragma once
 
 #include <algorithm>
 #include <condition_variable>
@@ -253,6 +252,4 @@ private:
     std::vector<int> _viewOrder;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Png.hpp b/common/Png.hpp
index c0a99c74e..496d293df 100644
--- a/common/Png.hpp
+++ b/common/Png.hpp
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#pragma once
+
 /* cairo - a vector graphics library with display and print output
  *
  * Copyright © 2003 University of Southern California
diff --git a/common/Protocol.hpp b/common/Protocol.hpp
index 3574d2027..c10e9ae52 100644
--- a/common/Protocol.hpp
+++ b/common/Protocol.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LOOLPROTOCOL_HPP
-#define INCLUDED_LOOLPROTOCOL_HPP
+#pragma once
 
 #include <cstdint>
 #include <cstdlib>
@@ -346,6 +345,4 @@ namespace LOOLProtocol
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Rectangle.hpp b/common/Rectangle.hpp
index 8ed2f3626..3e73bc251 100644
--- a/common/Rectangle.hpp
+++ b/common/Rectangle.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_RECTANGLE_HPP
-#define INCLUDED_RECTANGLE_HPP
+#pragma once
 
 #include <limits>
 
@@ -124,6 +123,4 @@ public:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Seccomp.hpp b/common/Seccomp.hpp
index 400745bfa..e18065d0f 100644
--- a/common/Seccomp.hpp
+++ b/common/Seccomp.hpp
@@ -6,8 +6,8 @@
  * 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_SECCOMP_HPP
-#define INCLUDED_SECCOMP_HPP
+
+#pragma once
 
 #include <Protocol.hpp>
 
@@ -24,6 +24,4 @@ namespace Rlimit {
     bool handleSetrlimitCommand(const StringVector& tokens);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Session.hpp b/common/Session.hpp
index ec99f5e29..3e5f4c89b 100644
--- a/common/Session.hpp
+++ b/common/Session.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SESSION_HPP
-#define INCLUDED_SESSION_HPP
+#pragma once
 
 #include <atomic>
 #include <cassert>
@@ -291,6 +290,4 @@ private:
     int _canonicalViewId;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index cd4c779dc..dcca2d295 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -56,11 +56,13 @@ namespace SigUtil
 
     bool getTerminationFlag()
     {
+        LOG_TRC("getTerminationFlag: " << (TerminationFlag ? "YES" : "NO"));
         return TerminationFlag;
     }
 
     void setTerminationFlag()
     {
+        LOG_TRC("setTerminationFlag");
         TerminationFlag = true;
     }
 
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index a0da03142..9bccf0256 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SIGNALUTIL_HPP
-#define INCLUDED_SIGNALUTIL_HPP
+#pragma once
 
 #include <atomic>
 #include <mutex>
@@ -83,6 +82,4 @@ namespace SigUtil
 
 } // end namespace SigUtil
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/SpookyV2.h b/common/SpookyV2.h
index bfda65f93..52b1838e8 100644
--- a/common/SpookyV2.h
+++ b/common/SpookyV2.h
@@ -26,6 +26,8 @@
 // slower than MD5.
 //
 
+#pragma once
+
 #include <stddef.h>
 
 #ifdef _MSC_VER
diff --git a/common/StringVector.hpp b/common/StringVector.hpp
index 5008277fd..154060bf1 100644
--- a/common/StringVector.hpp
+++ b/common/StringVector.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_STRINGVECTOR_HPP
-#define INCLUDED_STRINGVECTOR_HPP
+#pragma once
 
 #include <string>
 #include <vector>
@@ -77,6 +76,4 @@ public:
     bool equals(size_t index, const StringVector& other, size_t otherIndex);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Unit.hpp b/common/Unit.hpp
index 25e903a3b..9b6a88ece 100644
--- a/common/Unit.hpp
+++ b/common/Unit.hpp
@@ -6,8 +6,8 @@
  * 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_UNIT_HPP
-#define INCLUDED_UNIT_HPP
+
+#pragma once
 
 #include <atomic>
 #include <cassert>
@@ -300,6 +300,4 @@ public:
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/UnitHTTP.hpp b/common/UnitHTTP.hpp
index 2eb1c629f..34b225e24 100644
--- a/common/UnitHTTP.hpp
+++ b/common/UnitHTTP.hpp
@@ -6,8 +6,8 @@
  * 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_UNITHTTP_HPP
-#define INCLUDED_UNITHTTP_HPP
+
+#pragma once
 
 #include <memory>
 #include <sstream>
@@ -157,6 +157,4 @@ public:
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/Util.hpp b/common/Util.hpp
index b4a6c8d7d..820f4e6ce 100644
--- a/common/Util.hpp
+++ b/common/Util.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_UTIL_HPP
-#define INCLUDED_UTIL_HPP
+#pragma once
 
 #include <cassert>
 #include <cerrno>
@@ -1005,6 +1004,4 @@ int main(int argc, char**argv)
 
 } // end namespace Util
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/security.h b/common/security.h
index eb79f465c..f6c0bf258 100644
--- a/common/security.h
+++ b/common/security.h
@@ -10,6 +10,8 @@
  * Place for simple security-related code.
  */
 
+#pragma once
+
 #include <sys/mount.h>
 #include <sys/types.h>
 
diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp
index f28c132a9..5cb75d702 100644
--- a/kit/ChildSession.hpp
+++ b/kit/ChildSession.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_CHILDSESSION_HPP
-#define INCLUDED_CHILDSESSION_HPP
+#pragma once
 
 #include <mutex>
 #include <unordered_map>
@@ -336,6 +335,4 @@ private:
     bool _copyToClipboard;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/kit/Delta.hpp b/kit/Delta.hpp
index 453d6eff7..9e3876643 100644
--- a/kit/Delta.hpp
+++ b/kit/Delta.hpp
@@ -6,8 +6,8 @@
  * 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_DELTA_HPP
-#define INCLUDED_DELTA_HPP
+
+#pragma once
 
 #include <vector>
 #include <assert.h>
@@ -269,6 +269,4 @@ class DeltaGenerator {
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/kit/DummyLibreOfficeKit.hpp b/kit/DummyLibreOfficeKit.hpp
index c08d8788b..cb3c588d8 100644
--- a/kit/DummyLibreOfficeKit.hpp
+++ b/kit/DummyLibreOfficeKit.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_DESKTOP_INC_LIB_INIT_HXX
-#define INCLUDED_DESKTOP_INC_LIB_INIT_HXX
+#pragma once
 
 #define LOK_USE_UNSTABLE_API
 #include <LibreOfficeKit/LibreOfficeKit.h>
@@ -24,6 +23,4 @@ LibreOfficeKit* dummy_lok_init_2(const char *install_path,  const char *user_pro
 }
 #endif
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 993794bc7..aecf96b64 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -82,6 +82,7 @@ public:
         WebSocketHandler(/* isClient = */ true, /* isMasking */ false),
         _socketName(socketName)
     {
+        LOG_TRC("===> Here is ServerWSHandler");
     }
 
 protected:
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index eb585fae9..b100fd674 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -6,8 +6,8 @@
  * 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_LOOLKIT_HPP
-#define INCLUDED_LOOLKIT_HPP
+
+#pragma once
 
 #include <map>
 #include <string>
@@ -142,6 +142,4 @@ std::string anonymizeUsername(const std::string& username);
 /// For the mobile, we need access to the document to perform eg. saveAs() for printing.
 std::shared_ptr<lok::Document> getLOKDocument();
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp
index 0c449262c..37fce3fa0 100644
--- a/kit/KitHelper.hpp
+++ b/kit/KitHelper.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LOKITHELPER_HPP
-#define INCLUDED_LOKITHELPER_HPP
+#pragma once
 
 #include <sstream>
 #include <string>
@@ -125,6 +124,4 @@ namespace LOKitHelper
     }
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/kit/Watermark.hpp b/kit/Watermark.hpp
index 5fc0e5c3c..303c194d6 100644
--- a/kit/Watermark.hpp
+++ b/kit/Watermark.hpp
@@ -6,8 +6,8 @@
  * 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_WATERMARK_HPP
-#define INCLUDED_WATERMARK_HPP
+
+#pragma once
 
 #define LOK_USE_UNSTABLE_API
 #include <LibreOfficeKit/LibreOfficeKitInit.h>
@@ -188,6 +188,4 @@ private:
     std::vector<unsigned char> _pixmap;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/DelaySocket.hpp b/net/DelaySocket.hpp
index df423b523..c5d4fbe09 100644
--- a/net/DelaySocket.hpp
+++ b/net/DelaySocket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_DELAY_SOCKET_HPP
-#define INCLUDED_DELAY_SOCKET_HPP
+#pragma once
 
 #include <Socket.hpp>
 
@@ -22,6 +21,4 @@ namespace Delay
     void dumpState(std::ostream &os);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/FakeSocket.hpp b/net/FakeSocket.hpp
index 8ad1d48f1..f11da3575 100644
--- a/net/FakeSocket.hpp
+++ b/net/FakeSocket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_FAKESOCKET_H
-#define INCLUDED_FAKESOCKET_H
+#pragma once
 
 #if MOBILEAPP
 
@@ -52,6 +51,4 @@ void fakeSocketDumpState();
 
 #endif // MOBILEAPP
 
-#endif // INCLUDED_FAKESOCKET_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/ServerSocket.hpp b/net/ServerSocket.hpp
index 5316d3318..87cd51347 100644
--- a/net/ServerSocket.hpp
+++ b/net/ServerSocket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SERVERSOCKET_HPP
-#define INCLUDED_SERVERSOCKET_HPP
+#pragma once
 
 #include "memory"
 
@@ -120,6 +119,4 @@ private:
 
 #endif
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 199ea0a09..5155a7bc8 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SOCKET_HPP
-#define INCLUDED_SOCKET_HPP
+#pragma once
 
 #include <poll.h>
 #include <unistd.h>
@@ -1166,6 +1165,5 @@ namespace HttpHelper
                   Poco::Net::HTTPResponse& response, bool noCache = false, bool deflate = false,
                   const bool headerOnly = false);
 }
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/Ssl.hpp b/net/Ssl.hpp
index 90ba4f441..25bcc318a 100644
--- a/net/Ssl.hpp
+++ b/net/Ssl.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SSL_HPP
-#define INCLUDED_SSL_HPP
+#pragma once
 
 #include <atomic>
 #include <memory>
@@ -73,6 +72,4 @@ private:
     SSL_CTX* _ctx;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp
index e7853c33f..4d5745485 100644
--- a/net/SslSocket.hpp
+++ b/net/SslSocket.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SSLSOCKET_HPP
-#define INCLUDED_SSLSOCKET_HPP
+#pragma once
 
 #include <cerrno>
 
@@ -309,6 +308,4 @@ private:
     bool _doHandshake;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 83a3fa244..46a2916a7 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_WEBSOCKETHANDLER_HPP
-#define INCLUDED_WEBSOCKETHANDLER_HPP
+#pragma once
 
 #include <chrono>
 #include <memory>
@@ -809,6 +808,4 @@ protected:
     }
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/countloolkits.hpp b/test/countloolkits.hpp
index 8aa9b5d1f..4948e97fc 100644
--- a/test/countloolkits.hpp
+++ b/test/countloolkits.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_COUNTLOOLKITPROCESSES_HPP
-#define INCLUDED_COUNTLOOLKITPROCESSES_HPP
+#pragma once
 
 #include <iostream>
 #include <thread>
@@ -111,6 +110,4 @@ static void testNoExtraLoolKitsLeft()
     TST_LOG(" (" << durationMs << " ms)");
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/helpers.hpp b/test/helpers.hpp
index 748e5572d..3322fc5b0 100644
--- a/test/helpers.hpp
+++ b/test/helpers.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_HELPERS_HPP
-#define INCLUDED_TEST_HELPERS_HPP
+#pragma once
 
 #include <iterator>
 
@@ -802,6 +801,5 @@ inline std::string getAllText(const std::shared_ptr<LOOLWebSocket>& socket,
 }
 
 }
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/lokassert.hpp b/test/lokassert.hpp
index 35ed5c8e2..bf50a8ef3 100644
--- a/test/lokassert.hpp
+++ b/test/lokassert.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_ASSERT_HPP
-#define INCLUDED_ASSERT_HPP
+#pragma once
 
 #include <assert.h>
 
@@ -85,5 +84,3 @@ inline std::ostream& operator<<(std::ostream& os, const std::vector<char>& v)
         LOK_ASSERT_IMPL(!"Forced failure");                                                               \
         CPPUNIT_FAIL((message));                                                                   \
     } while (false)
-
-#endif //INCLUDED_ASSERT_HPP
diff --git a/test/test.hpp b/test/test.hpp
index a5a2b2280..bbb8f5b39 100644
--- a/test/test.hpp
+++ b/test/test.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_HPP
-#define INCLUDED_TEST_HPP
+#pragma once
 
 #include <vector>
 
@@ -37,6 +36,4 @@ int getClientPort();
 /// How many live loolkit processes do we have ?
 int getLoolKitProcessCount();
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/Replay.hpp b/tools/Replay.hpp
index d9a654bd7..4417814e6 100644
--- a/tools/Replay.hpp
+++ b/tools/Replay.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_REPLAY_HPP
-#define INCLUDED_REPLAY_HPP
+#pragma once
 
 #include <Poco/Net/HTTPRequest.h>
 #include <Poco/Net/HTTPResponse.h>
@@ -286,6 +285,4 @@ private:
     std::map<std::string, std::map<std::string, std::shared_ptr<Connection>>> _sessions;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/Admin.hpp b/wsd/Admin.hpp
index 6287d38bc..701cf2e9d 100644
--- a/wsd/Admin.hpp
+++ b/wsd/Admin.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_ADMIN_HPP
-#define INCLUDED_ADMIN_HPP
+#pragma once
 
 #include <mutex>
 
@@ -188,6 +187,4 @@ private:
     static const int DefStatsIntervalMs;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/AdminModel.hpp b/wsd/AdminModel.hpp
index b097289ef..f5420747d 100644
--- a/wsd/AdminModel.hpp
+++ b/wsd/AdminModel.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_ADMINMODEL_HPP
-#define INCLUDED_ADMINMODEL_HPP
+#pragma once
 
 #include <memory>
 #include <set>
@@ -370,6 +369,4 @@ private:
     std::thread::id _owner;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/Auth.hpp b/wsd/Auth.hpp
index 00256fb1f..30f26ff0c 100644
--- a/wsd/Auth.hpp
+++ b/wsd/Auth.hpp
@@ -8,8 +8,8 @@
  */
 
 // Authentication and Authorization support.
-#ifndef INCLUDED_AUTH_HPP
-#define INCLUDED_AUTH_HPP
+
+#pragma once
 
 #include <cassert>
 #include <string>
@@ -103,6 +103,4 @@ private:
 
 #endif
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index e11ac721c..0f425b117 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_CLIENTSSESSION_HPP
-#define INCLUDED_CLIENTSSESSION_HPP
+#pragma once
 
 #include "Session.hpp"
 #include "Storage.hpp"
@@ -289,7 +288,4 @@ private:
     std::chrono::steady_clock::time_point _viewLoadStart;
 };
 
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 6f37607f7..d161be4aa 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_DOCUMENTBROKER_HPP
-#define INCLUDED_DOCUMENTBROKER_HPP
+#pragma once
 
 #include <csignal>
 
@@ -448,6 +447,4 @@ public:
     static void removeFile(const std::string &uri);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/Exceptions.hpp b/wsd/Exceptions.hpp
index 911dd4023..007cc7359 100644
--- a/wsd/Exceptions.hpp
+++ b/wsd/Exceptions.hpp
@@ -9,8 +9,8 @@
 
 // Exception classes to differentiate between the
 // different error situations and handling.
-#ifndef INCLUDED_EXCEPTIONS_HPP
-#define INCLUDED_EXCEPTIONS_HPP
+
+#pragma once
 
 #include <exception>
 #include <stdexcept>
@@ -81,6 +81,4 @@ public:
     using LoolException::LoolException;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/FileServer.hpp b/wsd/FileServer.hpp
index 365da309c..47ab86d3c 100644
--- a/wsd/FileServer.hpp
+++ b/wsd/FileServer.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_FILESERVER_HPP
-#define INCLUDED_FILESERVER_HPP
+#pragma once
 
 #include <string>
 #include "Socket.hpp"
@@ -48,6 +47,4 @@ private:
                           const std::string& longMessage, const std::string& extraHeader = "");
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index 821a7e5e4..368b58076 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_LOOLWSD_HPP
-#define INCLUDED_LOOLWSD_HPP
+#pragma once
 
 #include <algorithm>
 #include <atomic>
@@ -496,6 +495,4 @@ public:
 #endif
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/ProofKey.hpp b/wsd/ProofKey.hpp
index 9ac3c7b1c..34dd98e12 100644
--- a/wsd/ProofKey.hpp
+++ b/wsd/ProofKey.hpp
@@ -8,8 +8,8 @@
  */
 
 // WOPI proof management
-#ifndef INCLUDED_PROOFKEY_HPP
-#define INCLUDED_PROOFKEY_HPP
+
+#pragma once
 
 #include <string>
 #include <utility>
@@ -72,6 +72,4 @@ VecOfStringPairs GetProofHeaders(const std::string& access_token, const std::str
 // If no proof key, returns empty vector
 const VecOfStringPairs& GetProofKeyAttributes();
 
-#endif // INCLUDED_PROOFKEY_HPP
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/QueueHandler.hpp b/wsd/QueueHandler.hpp
index 54aea6ad7..434742ea8 100644
--- a/wsd/QueueHandler.hpp
+++ b/wsd/QueueHandler.hpp
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#pragma once
+
 #include <Poco/Runnable.h>
 
 #include "Protocol.hpp"
diff --git a/wsd/SenderQueue.hpp b/wsd/SenderQueue.hpp
index 3f08c6286..e880e5c23 100644
--- a/wsd/SenderQueue.hpp
+++ b/wsd/SenderQueue.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SENDERQUEUE_HPP
-#define INCLUDED_SENDERQUEUE_HPP
+#pragma once
 
 #include <condition_variable>
 #include <deque>
@@ -156,6 +155,4 @@ private:
     typedef typename std::deque<Item>::value_type queue_item_t;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/Storage.hpp b/wsd/Storage.hpp
index bb678ac8a..78eab6434 100644
--- a/wsd/Storage.hpp
+++ b/wsd/Storage.hpp
@@ -8,8 +8,8 @@
  */
 
 // Storage abstraction.
-#ifndef INCLUDED_STORAGE_HPP
-#define INCLUDED_STORAGE_HPP
+
+#pragma once
 
 #include <set>
 #include <string>
@@ -626,6 +626,4 @@ private:
     std::unique_ptr<AuthBase> _authAgent;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/TileCache.hpp b/wsd/TileCache.hpp
index 50303c895..38b2118a0 100644
--- a/wsd/TileCache.hpp
+++ b/wsd/TileCache.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TILECACHE_HPP
-#define INCLUDED_TILECACHE_HPP
+#pragma once
 
 #include <iosfwd>
 #include <memory>
@@ -205,6 +204,4 @@ private:
     std::map<std::string, Tile> _streamCache[(int)StreamType::Last];
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/TileDesc.hpp b/wsd/TileDesc.hpp
index e8eebdcf2..490a8e2c1 100644
--- a/wsd/TileDesc.hpp
+++ b/wsd/TileDesc.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TILEDESC_HPP
-#define INCLUDED_TILEDESC_HPP
+#pragma once
 
 #include <cassert>
 #include <map>
@@ -568,6 +567,4 @@ private:
     int _tileHeight;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/TraceFile.hpp b/wsd/TraceFile.hpp
index 8ef7eb201..38e43e839 100644
--- a/wsd/TraceFile.hpp
+++ b/wsd/TraceFile.hpp
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TRACEFILE_HPP
-#define INCLUDED_TRACEFILE_HPP
+#pragma once
 
 #include <fstream>
 #include <mutex>
@@ -512,6 +511,4 @@ private:
     unsigned _indexOut;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/UserMessages.hpp b/wsd/UserMessages.hpp
index 00ad7875b..5437f8509 100644
--- a/wsd/UserMessages.hpp
+++ b/wsd/UserMessages.hpp
@@ -9,13 +9,11 @@
 
 // A list of user-visible messages.
 // This list is intended to be centralized for review and i18n support.
-#ifndef INCLUDED_USERMESSAGES_HPP
-#define INCLUDED_USERMESSAGES_HPP
+
+#pragma once
 
 constexpr const char* SERVICE_UNAVAILABLE_INTERNAL_ERROR = "error: cmd=socket kind=serviceunavailable";
 constexpr const char* PAYLOAD_UNAVAILABLE_LIMIT_REACHED = "error: cmd=socket kind=hardlimitreached params=%u,%u";
 constexpr const char* PAYLOAD_INFO_LIMIT_REACHED = "info: cmd=socket kind=limitreached params=%u,%u";
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list