[Libreoffice-commits] online.git: loolwsd/Admin.cpp loolwsd/Admin.hpp loolwsd/AdminModel.cpp loolwsd/AdminModel.hpp loolwsd/Auth.cpp loolwsd/ChildSession.cpp loolwsd/ClientSession.cpp loolwsd/Connect.cpp loolwsd/DocumentBroker.cpp loolwsd/DocumentBroker.hpp loolwsd/IoUtil.cpp loolwsd/LOOLForKit.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLProtocol.cpp loolwsd/LOOLProtocol.hpp loolwsd/LOOLSession.cpp loolwsd/LOOLWSD.cpp loolwsd/PrisonerSession.cpp loolwsd/Storage.cpp loolwsd/Storage.hpp loolwsd/test loolwsd/TileCache.cpp loolwsd/TileCache.hpp loolwsd/Unit.cpp loolwsd/Util.cpp loolwsd/Util.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sat May 21 15:53:13 UTC 2016
loolwsd/Admin.cpp | 13 ++++++++-----
loolwsd/Admin.hpp | 3 +++
loolwsd/AdminModel.cpp | 5 ++++-
loolwsd/AdminModel.hpp | 1 +
loolwsd/Auth.cpp | 9 ++++++---
loolwsd/ChildSession.cpp | 3 ++-
loolwsd/ClientSession.cpp | 8 +++++---
loolwsd/Connect.cpp | 7 ++++---
loolwsd/DocumentBroker.cpp | 12 ++++++++----
loolwsd/DocumentBroker.hpp | 5 +++--
loolwsd/IoUtil.cpp | 9 ++++++---
loolwsd/LOOLForKit.cpp | 10 +++++-----
loolwsd/LOOLKit.cpp | 7 ++++---
loolwsd/LOOLProtocol.cpp | 5 +++--
loolwsd/LOOLProtocol.hpp | 1 +
loolwsd/LOOLSession.cpp | 9 ++++++---
loolwsd/LOOLWSD.cpp | 10 ++++++----
loolwsd/PrisonerSession.cpp | 4 ++--
loolwsd/Storage.cpp | 17 +++++++++--------
loolwsd/Storage.hpp | 1 +
loolwsd/TileCache.cpp | 7 +++----
loolwsd/TileCache.hpp | 4 ++--
loolwsd/Unit.cpp | 13 ++++++++-----
loolwsd/Util.cpp | 13 ++++++++-----
loolwsd/Util.hpp | 9 ++++-----
loolwsd/test/TileCacheTests.cpp | 7 +++----
loolwsd/test/UnitAdmin.cpp | 13 ++++++-------
loolwsd/test/UnitFonts.cpp | 19 ++++++++++---------
loolwsd/test/UnitPrefork.cpp | 14 ++++++++------
loolwsd/test/UnitStorage.cpp | 6 ------
loolwsd/test/UnitTileCache.cpp | 7 ++-----
loolwsd/test/UnitTimeout.cpp | 8 +++-----
32 files changed, 144 insertions(+), 115 deletions(-)
New commits:
commit fae850189d48c31f52251d25bffaa18ecc981a48
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat May 21 10:23:07 2016 -0400
loolwsd: include cleanup and organization
A source file (.cpp) must include its own header first.
This insures that the header is self-contained and
doesn't depend on arbitrary (and accidental) includes
before it to compile.
Furthermore, system headers should go next, followed by
C then C++ headers, then libraries (Poco, etc) and, finally,
project headers come last.
This makes sure that headers and included in the same dependency
order to avoid side-effects. For example, Poco should never rely on
anything from our project in the same way that a C header should
never rely on anything in C++, Poco, or project headers.
Also, includes ought to be sorted where possible, to improve
readability and avoid accidental duplicates (of which there
were a few).
Change-Id: I62cc1343e4a091d69195e37ed659dba20cfcb1ef
Reviewed-on: https://gerrit.libreoffice.org/25262
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/Admin.cpp b/loolwsd/Admin.cpp
index 5ca707d..8c8bf80 100644
--- a/loolwsd/Admin.cpp
+++ b/loolwsd/Admin.cpp
@@ -7,6 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "Admin.hpp"
+#include "config.h"
+
#include <cassert>
#include <mutex>
#include <sys/poll.h>
@@ -24,16 +27,16 @@
#include <Poco/Util/ServerApplication.h>
#include <Poco/Util/Timer.h>
-#include "Auth.hpp"
-#include "Admin.hpp"
#include "AdminModel.hpp"
+#include "Auth.hpp"
#include "Common.hpp"
#include "FileServer.hpp"
-#include "TileCache.hpp"
-#include "Storage.hpp"
+#include "IoUtil.hpp"
#include "LOOLProtocol.hpp"
#include "LOOLWSD.hpp"
-#include "IoUtil.hpp"
+#include "Log.hpp"
+#include "Storage.hpp"
+#include "TileCache.hpp"
#include "Unit.hpp"
#include "Util.hpp"
diff --git a/loolwsd/Admin.hpp b/loolwsd/Admin.hpp
index 5c40146..4fb7d95 100644
--- a/loolwsd/Admin.hpp
+++ b/loolwsd/Admin.hpp
@@ -10,6 +10,8 @@
#ifndef INCLUDED_ADMIN_HPP
#define INCLUDED_ADMIN_HPP
+#include <mutex>
+
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPRequestHandler.h>
#include <Poco/Net/HTTPServer.h>
@@ -20,6 +22,7 @@
#include <Poco/Util/TimerTask.h>
#include "AdminModel.hpp"
+#include "Log.hpp"
class Admin;
diff --git a/loolwsd/AdminModel.cpp b/loolwsd/AdminModel.cpp
index fde6c2e..556bbcc 100644
--- a/loolwsd/AdminModel.cpp
+++ b/loolwsd/AdminModel.cpp
@@ -7,6 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "AdminModel.hpp"
+#include "config.h"
+
#include <memory>
#include <set>
#include <sstream>
@@ -17,7 +20,7 @@
#include <Poco/StringTokenizer.h>
#include <Poco/URI.h>
-#include "AdminModel.hpp"
+#include "Log.hpp"
#include "Unit.hpp"
#include "Util.hpp"
diff --git a/loolwsd/AdminModel.hpp b/loolwsd/AdminModel.hpp
index 3707598..b011f66 100644
--- a/loolwsd/AdminModel.hpp
+++ b/loolwsd/AdminModel.hpp
@@ -17,6 +17,7 @@
#include <Poco/Net/WebSocket.h>
#include <Poco/Process.h>
+#include "Log.hpp"
#include "Util.hpp"
class View
diff --git a/loolwsd/Auth.cpp b/loolwsd/Auth.cpp
index 71f2d2b..a978d56 100644
--- a/loolwsd/Auth.cpp
+++ b/loolwsd/Auth.cpp
@@ -7,26 +7,29 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "Auth.hpp"
+#include "config.h"
+
#include <cstdlib>
#include <string>
-#include <Poco/Base64Encoder.h>
#include <Poco/Base64Decoder.h>
+#include <Poco/Base64Encoder.h>
#include <Poco/Crypto/RSADigestEngine.h>
#include <Poco/Crypto/RSAKey.h>
#include <Poco/Dynamic/Var.h>
#include <Poco/JSON/Object.h>
#include <Poco/JSON/Parser.h>
#include <Poco/LineEndingConverter.h>
-#include <Poco/Net/NetException.h>
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
+#include <Poco/Net/NetException.h>
#include <Poco/StringTokenizer.h>
#include <Poco/Timestamp.h>
#include <Poco/URI.h>
-#include "Auth.hpp"
+#include "Log.hpp"
#include "Util.hpp"
using Poco::Base64Decoder;
diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp
index e9e9960..c3b948b 100644
--- a/loolwsd/ChildSession.cpp
+++ b/loolwsd/ChildSession.cpp
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "ChildSession.hpp"
#include "config.h"
#include <iostream>
@@ -23,10 +24,10 @@
#include <Poco/StringTokenizer.h>
#include <Poco/URI.h>
-#include "ChildSession.hpp"
#include "Common.hpp"
#include "LOKitHelper.hpp"
#include "LOOLProtocol.hpp"
+#include "Log.hpp"
#include "Rectangle.hpp"
#include "Util.hpp"
diff --git a/loolwsd/ClientSession.cpp b/loolwsd/ClientSession.cpp
index aeb7c86..7158a97 100644
--- a/loolwsd/ClientSession.cpp
+++ b/loolwsd/ClientSession.cpp
@@ -7,8 +7,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "ClientSession.hpp"
#include "config.h"
+#include <fstream>
+
#include <Poco/FileStream.h>
#include <Poco/JSON/Object.h>
#include <Poco/JSON/Parser.h>
@@ -16,16 +19,15 @@
#include <Poco/URIStreamOpener.h>
#include "Common.hpp"
+#include "IoUtil.hpp"
#include "LOOLProtocol.hpp"
#include "LOOLSession.hpp"
#include "LOOLWSD.hpp"
-#include "ClientSession.hpp"
+#include "Log.hpp"
#include "PrisonerSession.hpp"
-#include "ClientSession.hpp"
#include "Rectangle.hpp"
#include "Storage.hpp"
#include "TileCache.hpp"
-#include "IoUtil.hpp"
#include "Util.hpp"
using namespace LOOLProtocol;
diff --git a/loolwsd/Connect.cpp b/loolwsd/Connect.cpp
index 341329b..e81e668 100644
--- a/loolwsd/Connect.cpp
+++ b/loolwsd/Connect.cpp
@@ -15,18 +15,17 @@
#include <iostream>
#include <mutex>
-#include <Poco/Version.h>
#include <Poco/Net/AcceptCertificateHandler.h>
#include <Poco/Net/Context.h>
#include <Poco/Net/HTTPClientSession.h>
-#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
+#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/InvalidCertificateHandler.h>
#include <Poco/Net/NetException.h>
#include <Poco/Net/PrivateKeyPassphraseHandler.h>
-#include <Poco/Net/SocketStream.h>
#include <Poco/Net/SSLManager.h>
+#include <Poco/Net/SocketStream.h>
#include <Poco/Net/StreamSocket.h>
#include <Poco/Net/TCPServer.h>
#include <Poco/Net/TCPServerConnection.h>
@@ -39,9 +38,11 @@
#include <Poco/Thread.h>
#include <Poco/URI.h>
#include <Poco/Util/Application.h>
+#include <Poco/Version.h>
#include "Common.hpp"
#include "LOOLProtocol.hpp"
+#include "Log.hpp"
#include "Util.hpp"
using namespace LOOLProtocol;
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index de4d984..4c69a36 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -7,19 +7,23 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "DocumentBroker.hpp"
+#include "config.h"
+
#include <cassert>
+#include <fstream>
#include <Poco/Path.h>
#include <Poco/SHA1Engine.h>
-#include "DocumentBroker.hpp"
+#include "ClientSession.hpp"
#include "Exceptions.hpp"
+#include "LOOLProtocol.hpp"
#include "LOOLWSD.hpp"
+#include "Log.hpp"
+#include "PrisonerSession.hpp"
#include "Storage.hpp"
#include "TileCache.hpp"
-#include "LOOLProtocol.hpp"
-#include "ClientSession.hpp"
-#include "PrisonerSession.hpp"
#include "Unit.hpp"
using namespace LOOLProtocol;
diff --git a/loolwsd/DocumentBroker.hpp b/loolwsd/DocumentBroker.hpp
index c64e0e7..3fa7def 100644
--- a/loolwsd/DocumentBroker.hpp
+++ b/loolwsd/DocumentBroker.hpp
@@ -14,17 +14,18 @@
#include <atomic>
#include <chrono>
-#include <memory>
#include <condition_variable>
+#include <map>
+#include <memory>
#include <mutex>
#include <string>
#include <thread>
-#include <map>
#include <Poco/URI.h>
#include <Poco/Net/WebSocket.h>
#include "IoUtil.hpp"
+#include "Log.hpp"
#include "TileCache.hpp"
#include "Util.hpp"
diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp
index 5aa1578..350f3d1 100644
--- a/loolwsd/IoUtil.cpp
+++ b/loolwsd/IoUtil.cpp
@@ -7,6 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "IoUtil.hpp"
+#include "config.h"
+
#include <sys/poll.h>
#include <cassert>
@@ -17,16 +20,16 @@
#include <sstream>
#include <string>
-#include <Poco/StringTokenizer.h>
+#include <Poco/Net/NetException.h>
#include <Poco/Net/Socket.h>
#include <Poco/Net/WebSocket.h>
-#include <Poco/Net/NetException.h>
+#include <Poco/StringTokenizer.h>
#include <Poco/Thread.h>
#include <Poco/URI.h>
#include "Common.hpp"
#include "LOOLProtocol.hpp"
-#include "IoUtil.hpp"
+#include "Log.hpp"
#include "Util.hpp"
using Poco::Net::Socket;
diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index 4ff57cf..60a3b8e 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -14,15 +14,15 @@
#include "config.h"
#include <sys/capability.h>
-#include <sys/wait.h>
-#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include <atomic>
#include <cstdlib>
#include <cstring>
-#include <map>
#include <iostream>
+#include <map>
#include <set>
#include <Poco/Path.h>
@@ -34,9 +34,9 @@
#include "Common.hpp"
#include "IoUtil.hpp"
#include "LOOLKit.hpp"
-#include "Util.hpp"
+#include "Log.hpp"
#include "Unit.hpp"
-
+#include "Util.hpp"
#include "security.h"
using Poco::Path;
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 528e690..9ac1d19 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -13,12 +13,12 @@
#include <dlfcn.h>
#include <ftw.h>
+#include <limits.h>
+#include <malloc.h>
+#include <stdlib.h>
#include <sys/capability.h>
#include <unistd.h>
#include <utime.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <malloc.h>
#include <atomic>
#include <cassert>
@@ -49,6 +49,7 @@
#include "LOKitHelper.hpp"
#include "LOOLProtocol.hpp"
#include "LibreOfficeKit.hpp"
+#include "Log.hpp"
#include "QueueHandler.hpp"
#include "Unit.hpp"
#include "UserMessages.hpp"
diff --git a/loolwsd/LOOLProtocol.cpp b/loolwsd/LOOLProtocol.cpp
index b04222c..a00127c 100644
--- a/loolwsd/LOOLProtocol.cpp
+++ b/loolwsd/LOOLProtocol.cpp
@@ -7,6 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "LOOLProtocol.hpp"
+#include "config.h"
+
#include <cassert>
#include <cstring>
#include <map>
@@ -17,8 +20,6 @@
#include <Poco/StringTokenizer.h>
-#include "LOOLProtocol.hpp"
-
using Poco::StringTokenizer;
namespace LOOLProtocol
diff --git a/loolwsd/LOOLProtocol.hpp b/loolwsd/LOOLProtocol.hpp
index 842429c..7b2a76e 100644
--- a/loolwsd/LOOLProtocol.hpp
+++ b/loolwsd/LOOLProtocol.hpp
@@ -10,6 +10,7 @@
#ifndef INCLUDED_LOOLPROTOCOL_HPP
#define INCLUDED_LOOLPROTOCOL_HPP
+#include <cstring>
#include <map>
#include <string>
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 7d4a889..c2b80f8 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -7,9 +7,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "LOOLSession.hpp"
+#include "config.h"
+
#include <sys/stat.h>
#include <sys/types.h>
-
#include <ftw.h>
#include <utime.h>
@@ -30,11 +32,12 @@
#include <Poco/String.h>
#include <Poco/StringTokenizer.h>
+#include "ChildSession.hpp"
#include "Common.hpp"
+#include "IoUtil.hpp"
#include "LOOLProtocol.hpp"
-#include "LOOLSession.hpp"
+#include "Log.hpp"
#include "TileCache.hpp"
-#include "IoUtil.hpp"
#include "Util.hpp"
using namespace LOOLProtocol;
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index a6fc20b..da2f72c 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "LOOLWSD.hpp"
#include "config.h"
// This is the main source for the loolwsd program. LOOL uses several loolwsd processes: one main
@@ -27,6 +28,7 @@
#include <condition_variable>
#include <cstdlib>
#include <cstring>
+#include <fstream>
#include <iostream>
#include <map>
#include <mutex>
@@ -81,21 +83,21 @@
#include "Admin.hpp"
#include "Auth.hpp"
+#include "ClientSession.hpp"
#include "Common.hpp"
#include "Exceptions.hpp"
#include "FileServer.hpp"
#include "IoUtil.hpp"
#include "LOOLProtocol.hpp"
#include "LOOLSession.hpp"
-#include "LOOLWSD.hpp"
-#include "ClientSession.hpp"
+#include "Log.hpp"
#include "PrisonerSession.hpp"
#include "QueueHandler.hpp"
#include "Storage.hpp"
-#include "UserMessages.hpp"
-#include "Util.hpp"
#include "Unit.hpp"
#include "UnitHTTP.hpp"
+#include "UserMessages.hpp"
+#include "Util.hpp"
using namespace LOOLProtocol;
diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index 3bcf134..9933e6c 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "PrisonerSession.hpp"
#include "config.h"
#include <Poco/FileStream.h>
@@ -19,9 +20,8 @@
#include "LOOLProtocol.hpp"
#include "LOOLSession.hpp"
#include "LOOLWSD.hpp"
+#include "Log.hpp"
#include "ClientSession.hpp"
-#include "PrisonerSession.hpp"
-#include "PrisonerSession.hpp"
#include "Rectangle.hpp"
#include "Storage.hpp"
#include "TileCache.hpp"
diff --git a/loolwsd/Storage.cpp b/loolwsd/Storage.cpp
index bbaccb0..591f1ec 100644
--- a/loolwsd/Storage.cpp
+++ b/loolwsd/Storage.cpp
@@ -7,29 +7,30 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "Storage.hpp"
#include "config.h"
#include <cassert>
-#include <string>
#include <fstream>
+#include <string>
-#include <Poco/Net/HTTPResponse.h>
-#include <Poco/Net/HTTPRequest.h>
+#include <Poco/JSON/Object.h>
+#include <Poco/JSON/Parser.h>
+#include <Poco/Net/DNS.h>
#include <Poco/Net/HTTPClientSession.h>
+#include <Poco/Net/HTTPRequest.h>
+#include <Poco/Net/HTTPResponse.h>
#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/NetworkInterface.h>
-#include <Poco/Net/DNS.h>
#include <Poco/Net/SSLManager.h>
#include <Poco/StreamCopier.h>
-#include <Poco/JSON/Object.h>
-#include <Poco/JSON/Parser.h>
#include "Auth.hpp"
#include "Common.hpp"
#include "Exceptions.hpp"
-#include "Storage.hpp"
-#include "Util.hpp"
+#include "Log.hpp"
#include "Unit.hpp"
+#include "Util.hpp"
///////////////////
// StorageBase Impl
diff --git a/loolwsd/Storage.hpp b/loolwsd/Storage.hpp
index 84aa8a2..1ccd1df 100644
--- a/loolwsd/Storage.hpp
+++ b/loolwsd/Storage.hpp
@@ -18,6 +18,7 @@
#include <Poco/URI.h>
#include "Auth.hpp"
+#include "Log.hpp"
#include "Util.hpp"
/// Base class of all Storage abstractions.
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index bac923d..d0f4e06 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include "TileCache.hpp"
#include "config.h"
#include <cassert>
@@ -29,13 +30,11 @@
#include <Poco/Timestamp.h>
#include <Poco/URI.h>
+#include "ClientSession.hpp"
#include "Common.hpp"
-#include "Storage.hpp"
#include "LOOLProtocol.hpp"
-#include "TileCache.hpp"
-#include "Util.hpp"
-#include "ClientSession.hpp"
#include "Unit.hpp"
+#include "Util.hpp"
using Poco::DirectoryIterator;
using Poco::File;
diff --git a/loolwsd/TileCache.hpp b/loolwsd/TileCache.hpp
index 4f72ef8..a93fc4f 100644
--- a/loolwsd/TileCache.hpp
+++ b/loolwsd/TileCache.hpp
@@ -10,10 +10,10 @@
#ifndef INCLUDED_TILECACHE_HPP
#define INCLUDED_TILECACHE_HPP
-#include <fstream>
+#include <iosfwd>
+#include <map>
#include <memory>
#include <mutex>
-#include <map>
#include <string>
#include <Poco/Timestamp.h>
diff --git a/loolwsd/Unit.cpp b/loolwsd/Unit.cpp
index 7630a86..c0b9f18 100644
--- a/loolwsd/Unit.cpp
+++ b/loolwsd/Unit.cpp
@@ -7,17 +7,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <dlfcn.h>
-#include <ftw.h>
+#include "Unit.hpp"
+#include "config.h"
+
#include <cassert>
+#include <dlfcn.h>
#include <fstream>
-
-#include "Util.hpp"
-#include "Unit.hpp"
+#include <ftw.h>
#include <Poco/Thread.h>
#include <Poco/Util/Application.h>
+#include "Log.hpp"
+#include "Util.hpp"
+
UnitBase *UnitBase::_global = nullptr;
static Poco::Thread TimeoutThread("unit timeout");
diff --git a/loolwsd/Util.cpp b/loolwsd/Util.cpp
index a814ae2..5b6ad9f 100644
--- a/loolwsd/Util.cpp
+++ b/loolwsd/Util.cpp
@@ -7,6 +7,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+// PNG headers are testy and don't like us including anything
+// they include. Must be first until moved and restrained.
+#include <png.h>
+
+#include "Util.hpp"
#include "config.h"
#include <execinfo.h>
@@ -20,27 +25,25 @@
#include <cassert>
#include <cstdlib>
#include <cstring>
-#include <iostream>
#include <iomanip>
+#include <iostream>
#include <mutex>
#include <random>
#include <sstream>
#include <string>
-#include <png.h>
-
#include <Poco/ConsoleChannel.h>
#include <Poco/Exception.h>
#include <Poco/Format.h>
#include <Poco/Net/WebSocket.h>
#include <Poco/Process.h>
+#include <Poco/TemporaryFile.h>
#include <Poco/Thread.h>
#include <Poco/Timestamp.h>
-#include <Poco/TemporaryFile.h>
#include <Poco/Util/Application.h>
#include "Common.hpp"
-#include "Util.hpp"
+#include "Log.hpp"
#include "Png.hpp"
// Callback functions for libpng
diff --git a/loolwsd/Util.hpp b/loolwsd/Util.hpp
index 5340899..d364e1b 100644
--- a/loolwsd/Util.hpp
+++ b/loolwsd/Util.hpp
@@ -10,23 +10,22 @@
#ifndef INCLUDED_UTIL_HPP
#define INCLUDED_UTIL_HPP
-#include <string>
-#include <sstream>
+#include <cassert>
#include <functional>
#include <memory>
#include <set>
+#include <sstream>
+#include <string>
#include <Poco/File.h>
+#include <Poco/Net/WebSocket.h>
#include <Poco/Path.h>
#include <Poco/Process.h>
-#include <Poco/Net/WebSocket.h>
#include <Poco/RegularExpression.h>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include "Log.hpp"
-
/// Flag to stop pump loops.
extern volatile bool TerminationFlag;
diff --git a/loolwsd/test/TileCacheTests.cpp b/loolwsd/test/TileCacheTests.cpp
index 8906cda..a1a16a8 100644
--- a/loolwsd/test/TileCacheTests.cpp
+++ b/loolwsd/test/TileCacheTests.cpp
@@ -12,13 +12,12 @@
#include <Poco/Net/WebSocket.h>
#include <cppunit/extensions/HelperMacros.h>
-#include <TileCache.hpp>
-
+#include "helpers.hpp"
#include <Common.hpp>
+#include <LOOLProtocol.hpp>
+#include <TileCache.hpp>
#include <Unit.hpp>
#include <Util.hpp>
-#include <LOOLProtocol.hpp>
-#include "helpers.hpp"
using namespace helpers;
diff --git a/loolwsd/test/UnitAdmin.cpp b/loolwsd/test/UnitAdmin.cpp
index 2ecd27a..133413c 100644
--- a/loolwsd/test/UnitAdmin.cpp
+++ b/loolwsd/test/UnitAdmin.cpp
@@ -13,24 +13,23 @@
#include <condition_variable>
#include <mutex>
-#include "Common.hpp"
-#include "Unit.hpp"
-#include "Util.hpp"
-#include "Log.hpp"
-
-#include <Poco/StringTokenizer.h>
#include <Poco/Net/HTTPBasicCredentials.h>
+#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPCookie.h>
#include <Poco/Net/HTTPResponse.h>
-#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPSClientSession.h>
#include <Poco/Net/HTTPServerRequest.h>
#include <Poco/Net/NameValueCollection.h>
#include <Poco/Net/NetException.h>
#include <Poco/Net/WebSocket.h>
#include <Poco/StringTokenizer.h>
+#include <Poco/StringTokenizer.h>
#include <Poco/URI.h>
+#include "Common.hpp"
+#include "Log.hpp"
+#include "Unit.hpp"
+#include "Util.hpp"
#include "helpers.hpp"
#define UNIT_URI "/loolwsd/unit-admin"
diff --git a/loolwsd/test/UnitFonts.cpp b/loolwsd/test/UnitFonts.cpp
index bf82322..cf11d98 100644
--- a/loolwsd/test/UnitFonts.cpp
+++ b/loolwsd/test/UnitFonts.cpp
@@ -9,20 +9,21 @@
#include <dlfcn.h>
#include <ftw.h>
+
#include <cassert>
#include <iostream>
-#include "Common.hpp"
-#include "Util.hpp"
-#include "Unit.hpp"
-#include "LOOLProtocol.hpp"
-#include <dlfcn.h>
-
-#include <Poco/Timestamp.h>
-#include <Poco/StringTokenizer.h>
-#include <Poco/Net/HTTPResponse.h>
#include <Poco/Net/HTTPClientSession.h>
+#include <Poco/Net/HTTPResponse.h>
#include <Poco/Net/HTTPServerRequest.h>
+#include <Poco/StringTokenizer.h>
+#include <Poco/Timestamp.h>
+
+#include "Common.hpp"
+#include "LOOLProtocol.hpp"
+#include "Log.hpp"
+#include "Unit.hpp"
+#include "Util.hpp"
#define UNIT_URI "/loolwsd/unit-font"
diff --git a/loolwsd/test/UnitPrefork.cpp b/loolwsd/test/UnitPrefork.cpp
index cd4bed0..8ed2b94 100644
--- a/loolwsd/test/UnitPrefork.cpp
+++ b/loolwsd/test/UnitPrefork.cpp
@@ -7,26 +7,28 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <dirent.h>
#include <dlfcn.h>
#include <ftw.h>
+#include <sys/types.h>
+
#include <cassert>
#include <iostream>
-#include <sys/types.h>
-#include <dirent.h>
#include <mutex>
#include <condition_variable>
+#include <Poco/Timestamp.h>
+#include <Poco/StringTokenizer.h>
+#include <Poco/Net/WebSocket.h>
+
#include "Common.hpp"
#include "IoUtil.hpp"
#include "LOOLProtocol.hpp"
+#include "Log.hpp"
#include "Unit.hpp"
#include "Util.hpp"
-#include <Poco/Timestamp.h>
-#include <Poco/StringTokenizer.h>
-#include <Poco/Net/WebSocket.h>
-
const int NumToPrefork = 20;
// Inside the WSD process
diff --git a/loolwsd/test/UnitStorage.cpp b/loolwsd/test/UnitStorage.cpp
index eba5f74..306c1c7 100644
--- a/loolwsd/test/UnitStorage.cpp
+++ b/loolwsd/test/UnitStorage.cpp
@@ -7,12 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <dlfcn.h>
-#include <ftw.h>
-#include <cassert>
-#include <iostream>
-
-#include "Util.hpp"
#include "Unit.hpp"
#include "UnitHTTP.hpp"
diff --git a/loolwsd/test/UnitTileCache.cpp b/loolwsd/test/UnitTileCache.cpp
index 00898f2..771f0e3 100644
--- a/loolwsd/test/UnitTileCache.cpp
+++ b/loolwsd/test/UnitTileCache.cpp
@@ -7,16 +7,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <dlfcn.h>
-#include <ftw.h>
-#include <cassert>
-#include <iostream>
#include <fstream>
#include <thread>
-#include "Util.hpp"
+#include "Log.hpp"
#include "Unit.hpp"
#include "UnitHTTP.hpp"
+#include "Util.hpp"
#include "helpers.hpp"
class UnitTileCache: public UnitWSD
diff --git a/loolwsd/test/UnitTimeout.cpp b/loolwsd/test/UnitTimeout.cpp
index f29bf73..6730de2 100644
--- a/loolwsd/test/UnitTimeout.cpp
+++ b/loolwsd/test/UnitTimeout.cpp
@@ -7,16 +7,14 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <dlfcn.h>
-#include <ftw.h>
#include <cassert>
-#include <iostream>
+#include <Poco/Util/Application.h>
+
+#include "Log.hpp"
#include "Util.hpp"
#include "Unit.hpp"
-#include <Poco/Timestamp.h>
-#include <Poco/Util/Application.h>
using Poco::Timestamp;
class UnitTimeout : public UnitWSD
More information about the Libreoffice-commits
mailing list