Skip to content

Commit

Permalink
C++ modernize: Pragma once (#6264)
Browse files Browse the repository at this point in the history
* Migrate cpp headers to pragma once
  • Loading branch information
nerzhul authored Aug 17, 2017
1 parent c738d1e commit 921151d
Show file tree
Hide file tree
Showing 236 changed files with 288 additions and 1,028 deletions.
6 changes: 1 addition & 5 deletions src/activeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef ACTIVEOBJECT_HEADER
#define ACTIVEOBJECT_HEADER
#pragma once

#include "irr_aabb3d.h"
#include <string>
Expand Down Expand Up @@ -102,6 +101,3 @@ class ActiveObject
protected:
u16 m_id; // 0 is invalid, "no id"
};

#endif

5 changes: 1 addition & 4 deletions src/ban.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef BAN_HEADER
#define BAN_HEADER
#pragma once

#include "util/string.h"
#include "threading/thread.h"
Expand Down Expand Up @@ -48,5 +47,3 @@ class BanManager
StringMap m_ips;
bool m_modified = false;
};

#endif
5 changes: 1 addition & 4 deletions src/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CAMERA_HEADER
#define CAMERA_HEADER
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "inventory.h"
Expand Down Expand Up @@ -232,5 +231,3 @@ class Camera

std::list<Nametag *> m_nametags;
};

#endif
5 changes: 1 addition & 4 deletions src/cavegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CAVEGEN_HEADER
#define CAVEGEN_HEADER
#pragma once

#define VMANIP_FLAG_CAVE VOXELFLAG_CHECKED1

Expand Down Expand Up @@ -241,5 +240,3 @@ class CavesV6

inline s16 getSurfaceFromHeightmap(v3s16 p);
};

#endif
6 changes: 1 addition & 5 deletions src/chat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CHAT_HEADER
#define CHAT_HEADER
#pragma once

#include <string>
#include <vector>
Expand Down Expand Up @@ -287,6 +286,3 @@ class ChatBackend
ChatBuffer m_recent_buffer;
ChatPrompt m_prompt;
};

#endif

5 changes: 1 addition & 4 deletions src/chat_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CHAT_INTERFACE_H
#define CHAT_INTERFACE_H
#pragma once

#include "util/container.h"
#include <string>
Expand Down Expand Up @@ -78,5 +77,3 @@ struct ChatInterface {
MutexedQueue<ChatEvent *> command_queue; // chat backend --> server
MutexedQueue<ChatEvent *> outgoing_queue; // server --> chat backend
};

#endif
5 changes: 1 addition & 4 deletions src/chatmessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef MT_CHATMESSAGE_H
#define MT_CHATMESSAGE_H
#pragma once

#include <string>
#include <ctime>
Expand Down Expand Up @@ -47,5 +46,3 @@ struct ChatMessage
std::wstring sender = L"";
std::time_t timestamp = std::time(0);
};

#endif
5 changes: 1 addition & 4 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CLIENT_HEADER
#define CLIENT_HEADER
#pragma once

#include "network/connection.h"
#include "clientenvironment.h"
Expand Down Expand Up @@ -718,5 +717,3 @@ class Client : public con::PeerHandler, public InventoryManager, public IGameDef
u64 m_csm_flavour_limits = CSMFlavourLimit::CSM_FL_NONE;
u32 m_csm_noderange_limit = 8;
};

#endif // !CLIENT_HEADER
5 changes: 1 addition & 4 deletions src/client/clientlauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef __CLIENT_LAUNCHER_H__
#define __CLIENT_LAUNCHER_H__
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "client/inputhandler.h"
Expand Down Expand Up @@ -69,5 +68,3 @@ class ClientLauncher
std::string current_address = "does-not-exist";
int current_port = 0;
};

#endif
5 changes: 1 addition & 4 deletions src/client/inputhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef INPUT_HANDLER_H
#define INPUT_HANDLER_H
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "joystick_controller.h"
Expand Down Expand Up @@ -393,5 +392,3 @@ class RandomInputHandler : public InputHandler
bool leftreleased = false;
bool rightreleased = false;
};

#endif
5 changes: 1 addition & 4 deletions src/client/joystick_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef JOYSTICK_HEADER
#define JOYSTICK_HEADER
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "keys.h"
Expand Down Expand Up @@ -168,5 +167,3 @@ class JoystickController {
std::bitset<KeyType::INTERNAL_ENUM_COUNT> m_past_pressed_keys;
std::bitset<KeyType::INTERNAL_ENUM_COUNT> m_past_released_keys;
};

#endif