Skip to content

Commit

Permalink
Use #pragma once
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Tor Lillqvist <[email protected]>
  • Loading branch information
Tor Lillqvist committed Apr 18, 2020
1 parent 21dfba7 commit 4eb5987
Show file tree
Hide file tree
Showing 58 changed files with 76 additions and 207 deletions.
5 changes: 1 addition & 4 deletions common/Authorization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

// WOPI Authorization

#ifndef INCLUDED_AUTHORIZATION_HPP
#define INCLUDED_AUTHORIZATION_HPP
#pragma once

#include <string>

Expand Down Expand Up @@ -51,6 +50,4 @@ class Authorization
void authorizeRequest(Poco::Net::HTTPRequest& request) const;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 2 additions & 4 deletions common/Clipboard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/

// Clipboard abstraction.
#ifndef INCLUDED_CLIPBOARD_HPP
#define INCLUDED_CLIPBOARD_HPP

#pragma once

#include <string>
#include <vector>
Expand Down Expand Up @@ -142,6 +142,4 @@ class ClipboardCache
}
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 2 additions & 4 deletions common/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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: */
5 changes: 1 addition & 4 deletions common/Crypto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -39,6 +38,4 @@ class SupportKey {

#endif

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/FileUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -98,6 +97,4 @@ namespace FileUtil

} // end namespace FileUtil

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/JsonUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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: */

5 changes: 1 addition & 4 deletions common/LOOLWebSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -157,6 +156,4 @@ class LOOLWebSocket : public Poco::Net::WebSocket
}
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/Log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -409,6 +408,4 @@ namespace Log
} \
} while (false)

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/Message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -184,6 +183,4 @@ class Message
const Type _type;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/MessageQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -253,6 +252,4 @@ class TileQueue : public MessageQueue
std::vector<int> _viewOrder;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
2 changes: 2 additions & 0 deletions common/Png.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions common/Protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -346,6 +345,4 @@ namespace LOOLProtocol
}
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/Rectangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -124,6 +123,4 @@ struct Rectangle

}

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 2 additions & 4 deletions common/Seccomp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand All @@ -24,6 +24,4 @@ namespace Rlimit {
bool handleSetrlimitCommand(const StringVector& tokens);
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/Session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -291,6 +290,4 @@ class Session : public MessageHandlerInterface
int _canonicalViewId;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
2 changes: 2 additions & 0 deletions common/SigUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ namespace SigUtil

bool getTerminationFlag()
{
LOG_TRC("getTerminationFlag: " << (TerminationFlag ? "YES" : "NO"));
return TerminationFlag;
}

void setTerminationFlag()
{
LOG_TRC("setTerminationFlag");
TerminationFlag = true;
}

Expand Down
5 changes: 1 addition & 4 deletions common/SigUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -83,6 +82,4 @@ namespace SigUtil

} // end namespace SigUtil

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
2 changes: 2 additions & 0 deletions common/SpookyV2.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
// slower than MD5.
//

#pragma once

#include <stddef.h>

#ifdef _MSC_VER
Expand Down
5 changes: 1 addition & 4 deletions common/StringVector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -77,6 +76,4 @@ class StringVector
bool equals(size_t index, const StringVector& other, size_t otherIndex);
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 2 additions & 4 deletions common/Unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -300,6 +300,4 @@ class UnitKit : public UnitBase
}
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
6 changes: 2 additions & 4 deletions common/UnitHTTP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -157,6 +157,4 @@ class UnitWebSocket
}
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
5 changes: 1 addition & 4 deletions common/Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -1005,6 +1004,4 @@ int main(int argc, char**argv)

} // end namespace Util

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
2 changes: 2 additions & 0 deletions common/security.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Place for simple security-related code.
*/

#pragma once

#include <sys/mount.h>
#include <sys/types.h>

Expand Down
5 changes: 1 addition & 4 deletions kit/ChildSession.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -336,6 +335,4 @@ class ChildSession final : public Session
bool _copyToClipboard;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Loading

0 comments on commit 4eb5987

Please sign in to comment.