summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-04-18 11:39:50 +0300
committerTor Lillqvist <tml@collabora.com>2020-04-18 15:00:18 +0200
commit4eb598711cd6162452a28285abbd65c6397f58bf (patch)
tree3f4d0f5562b715e7d940f5fda144cc5ed88532de
parent21dfba7db728c72d03e2d8009e595b60b6efa1c8 (diff)
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@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--common/Authorization.hpp5
-rw-r--r--common/Clipboard.hpp6
-rw-r--r--common/Common.hpp6
-rw-r--r--common/Crypto.hpp5
-rw-r--r--common/FileUtil.hpp5
-rw-r--r--common/JsonUtil.hpp5
-rw-r--r--common/LOOLWebSocket.hpp5
-rw-r--r--common/Log.hpp5
-rw-r--r--common/Message.hpp5
-rw-r--r--common/MessageQueue.hpp5
-rw-r--r--common/Png.hpp2
-rw-r--r--common/Protocol.hpp5
-rw-r--r--common/Rectangle.hpp5
-rw-r--r--common/Seccomp.hpp6
-rw-r--r--common/Session.hpp5
-rw-r--r--common/SigUtil.cpp2
-rw-r--r--common/SigUtil.hpp5
-rw-r--r--common/SpookyV2.h2
-rw-r--r--common/StringVector.hpp5
-rw-r--r--common/Unit.hpp6
-rw-r--r--common/UnitHTTP.hpp6
-rw-r--r--common/Util.hpp5
-rw-r--r--common/security.h2
-rw-r--r--kit/ChildSession.hpp5
-rw-r--r--kit/Delta.hpp6
-rw-r--r--kit/DummyLibreOfficeKit.hpp5
-rw-r--r--kit/ForKit.cpp1
-rw-r--r--kit/Kit.hpp6
-rw-r--r--kit/KitHelper.hpp5
-rw-r--r--kit/Watermark.hpp6
-rw-r--r--net/DelaySocket.hpp5
-rw-r--r--net/FakeSocket.hpp5
-rw-r--r--net/ServerSocket.hpp5
-rw-r--r--net/Socket.hpp4
-rw-r--r--net/Ssl.hpp5
-rw-r--r--net/SslSocket.hpp5
-rw-r--r--net/WebSocketHandler.hpp5
-rw-r--r--test/countloolkits.hpp5
-rw-r--r--test/helpers.hpp4
-rw-r--r--test/lokassert.hpp5
-rw-r--r--test/test.hpp5
-rw-r--r--tools/Replay.hpp5
-rw-r--r--wsd/Admin.hpp5
-rw-r--r--wsd/AdminModel.hpp5
-rw-r--r--wsd/Auth.hpp6
-rw-r--r--wsd/ClientSession.hpp6
-rw-r--r--wsd/DocumentBroker.hpp5
-rw-r--r--wsd/Exceptions.hpp6
-rw-r--r--wsd/FileServer.hpp5
-rw-r--r--wsd/LOOLWSD.hpp5
-rw-r--r--wsd/ProofKey.hpp6
-rw-r--r--wsd/QueueHandler.hpp2
-rw-r--r--wsd/SenderQueue.hpp5
-rw-r--r--wsd/Storage.hpp6
-rw-r--r--wsd/TileCache.hpp5
-rw-r--r--wsd/TileDesc.hpp5
-rw-r--r--wsd/TraceFile.hpp5
-rw-r--r--wsd/UserMessages.hpp6
58 files changed, 76 insertions, 207 deletions
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: */