Skip to content
Permalink
Browse files

C++ modernize: Pragma once (#6264)

* Migrate cpp headers to pragma once
  • Loading branch information...
nerzhul committed Aug 17, 2017
1 parent c738d1e commit 921151d97a2fb2238ab514324fb95e2732248b96
Showing with 288 additions and 1,028 deletions.
  1. +1 −5 src/activeobject.h
  2. +1 −4 src/ban.h
  3. +1 −4 src/camera.h
  4. +1 −4 src/cavegen.h
  5. +1 −5 src/chat.h
  6. +1 −4 src/chat_interface.h
  7. +1 −4 src/chatmessage.h
  8. +1 −4 src/client.h
  9. +1 −4 src/client/clientlauncher.h
  10. +1 −4 src/client/inputhandler.h
  11. +1 −4 src/client/joystick_controller.h
  12. +1 −4 src/client/keys.h
  13. +1 −3 src/client/tile.h
  14. +1 −4 src/clientenvironment.h
  15. +2 −4 src/clientiface.h
  16. +1 −5 src/clientmap.h
  17. +1 −4 src/clientmedia.h
  18. +1 −4 src/clientobject.h
  19. +1 −4 src/clientsimpleobject.h
  20. +1 −4 src/cloudparams.h
  21. +1 −6 src/clouds.h
  22. +1 −5 src/cmake_config.h.in
  23. +1 −5 src/cmake_config_githash.h.in
  24. +1 −6 src/collision.h
  25. +1 −4 src/config.h
  26. +1 −4 src/constants.h
  27. +1 −5 src/content_cao.h
  28. +1 −5 src/content_cso.h
  29. +1 −4 src/content_mapblock.h
  30. +1 −4 src/content_mapnode.h
  31. +1 −5 src/content_nodemeta.h
  32. +1 −4 src/content_sao.h
  33. +3 −6 src/convert_json.h
  34. +1 −5 src/craftdef.h
  35. +1 −4 src/database-dummy.h
  36. +1 −4 src/database-files.h
  37. +1 −4 src/database-leveldb.h
  38. +1 −5 src/database-postgresql.h
  39. +1 −4 src/database-redis.h
  40. +1 −4 src/database-sqlite3.h
  41. +1 −4 src/database.h
  42. +1 −5 src/daynightratio.h
  43. +1 −6 src/debug.h
  44. +1 −4 src/defaultsettings.h
  45. +1 −4 src/dungeongen.h
  46. +1 −4 src/emerge.h
  47. +1 −4 src/environment.h
  48. +1 −5 src/event.h
  49. +1 −5 src/event_manager.h
  50. +1 −5 src/exceptions.h
  51. +1 −4 src/face_position_cache.h
  52. +1 −4 src/filecache.h
  53. +1 −5 src/filesys.h
  54. +2 −4 src/fontengine.h
  55. +1 −4 src/game.h
  56. +1 −5 src/gamedef.h
  57. +1 −4 src/gameparams.h
  58. +1 −5 src/genericobject.h
  59. +1 −4 src/gettext.h
  60. +1 −4 src/gettime.h
  61. +1 −6 src/guiChatConsole.h
  62. +1 −4 src/guiEngine.h
  63. +1 −5 src/guiFormSpecMenu.h
  64. +1 −4 src/guiKeyChangeMenu.h
  65. +1 −5 src/guiMainMenu.h
  66. +1 −4 src/guiPasswordChange.h
  67. +1 −4 src/guiPathSelectMenu.h
  68. +1 −6 src/guiTable.h
  69. +1 −5 src/guiVolumeChange.h
  70. +2 −4 src/guiscalingfilter.h
  71. +1 −4 src/httpfetch.h
  72. +1 −4 src/hud.h
  73. +1 −4 src/imagefilters.h
  74. +1 −3 src/intlGUIEditBox.h
  75. +1 −4 src/inventory.h
  76. +1 −5 src/inventorymanager.h
  77. +1 −4 src/irr_aabb3d.h
  78. +1 −4 src/irr_v2d.h
  79. +1 −4 src/irr_v3d.h
  80. +1 −4 src/irrlicht_changes/CGUITTFont.h
  81. +1 −4 src/irrlicht_changes/irrUString.h
  82. +1 −4 src/irrlicht_changes/static_text.h
  83. +1 −4 src/irrlichttypes.h
  84. +1 −4 src/irrlichttypes_bloated.h
  85. +1 −4 src/irrlichttypes_extrabloated.h
  86. +1 −4 src/itemdef.h
  87. +1 −4 src/itemgroup.h
  88. +1 −4 src/itemstackmetadata.h
  89. +1 −4 src/keycode.h
  90. +1 −4 src/light.h
  91. +1 −4 src/localplayer.h
  92. +1 −5 src/log.h
  93. +1 −5 src/mainmenumanager.h
  94. +1 −4 src/map.h
  95. +1 −4 src/map_settings_manager.h
  96. +1 −4 src/mapblock.h
  97. +1 −5 src/mapblock_mesh.h
  98. +1 −4 src/mapgen.h
  99. +1 −4 src/mapgen_carpathian.h
  100. +1 −4 src/mapgen_flat.h
  101. +1 −4 src/mapgen_fractal.h
  102. +1 −4 src/mapgen_singlenode.h
  103. +1 −4 src/mapgen_v5.h
  104. +1 −4 src/mapgen_v6.h
  105. +1 −4 src/mapgen_v7.h
  106. +1 −4 src/mapgen_valleys.h
  107. +1 −5 src/mapnode.h
  108. +1 −5 src/mapsector.h
  109. +3 −6 src/mesh.h
  110. +1 −4 src/mesh_generator_thread.h
  111. +1 −4 src/metadata.h
  112. +1 −5 src/mg_biome.h
  113. +1 −4 src/mg_decoration.h
  114. +1 −4 src/mg_ore.h
  115. +1 −4 src/mg_schematic.h
  116. +1 −4 src/minimap.h
  117. +1 −6 src/modalMenu.h
  118. +1 −4 src/modifiedstate.h
  119. +1 −4 src/mods.h
  120. +1 −4 src/nameidmapping.h
  121. +1 −4 src/network/clientopcodes.h
  122. +1 −4 src/network/connection.h
  123. +1 −4 src/network/networkpacket.h
  124. +1 −4 src/network/serveropcodes.h
  125. +1 −4 src/nodedef.h
  126. +1 −4 src/nodemetadata.h
  127. +1 −5 src/nodetimer.h
  128. +1 −5 src/noise.h
  129. +1 −4 src/objdef.h
  130. +1 −4 src/object_properties.h
  131. +1 −4 src/particles.h
  132. +1 −4 src/pathfinder.h
  133. +1 −5 src/player.h
  134. +1 −5 src/porting.h
  135. +2 −4 src/porting_android.h
  136. +1 −5 src/profiler.h
  137. +4 −8 src/quicktune.h
  138. +1 −5 src/quicktune_shortcutter.h
  139. +1 −5 src/raycast.h
  140. +1 −4 src/reflowscan.h
  141. +1 −4 src/remoteplayer.h
  142. +1 −4 src/rollback.h
  143. +1 −4 src/rollback_interface.h
  144. +1 −4 src/script/common/c_content.h
  145. +1 −4 src/script/common/c_converter.h
  146. +1 −4 src/script/common/c_internal.h
  147. +1 −4 src/script/common/c_types.h
  148. +1 −4 src/script/cpp_api/s_async.h
  149. +1 −4 src/script/cpp_api/s_base.h
  150. +1 −3 src/script/cpp_api/s_client.h
  151. +1 −6 src/script/cpp_api/s_entity.h
  152. +1 −4 src/script/cpp_api/s_env.h
  153. +1 −5 src/script/cpp_api/s_internal.h
  154. +1 −6 src/script/cpp_api/s_inventory.h
  155. +1 −5 src/script/cpp_api/s_item.h
  156. +1 −4 src/script/cpp_api/s_mainmenu.h
  157. +1 −6 src/script/cpp_api/s_node.h
  158. +1 −4 src/script/cpp_api/s_nodemeta.h
  159. +1 −4 src/script/cpp_api/s_player.h
  160. +1 −5 src/script/cpp_api/s_security.h
  161. +1 −6 src/script/cpp_api/s_server.h
  162. +1 −4 src/script/lua_api/l_areastore.h
  163. +1 −4 src/script/lua_api/l_base.h
  164. +20 −4 src/script/lua_api/l_camera.h
  165. +1 −4 src/script/lua_api/l_client.h
  166. +1 −4 src/script/lua_api/l_craft.h
  167. +1 −4 src/script/lua_api/l_env.h
  168. +1 −4 src/script/lua_api/l_http.h
  169. +1 −4 src/script/lua_api/l_internal.h
  170. +1 −4 src/script/lua_api/l_inventory.h
  171. +1 −6 src/script/lua_api/l_item.h
  172. +1 −4 src/script/lua_api/l_itemstackmeta.h
  173. +1 −4 src/script/lua_api/l_localplayer.h
  174. +1 −4 src/script/lua_api/l_mainmenu.h
  175. +1 −4 src/script/lua_api/l_mapgen.h
  176. +2 −4 src/script/lua_api/l_metadata.h
  177. +1 −4 src/script/lua_api/l_minimap.h
  178. +2 −4 src/script/lua_api/l_nodemeta.h
  179. +1 −4 src/script/lua_api/l_nodetimer.h
  180. +1 −4 src/script/lua_api/l_noise.h
  181. +1 −4 src/script/lua_api/l_object.h
  182. +1 −6 src/script/lua_api/l_particles.h
  183. +1 −4 src/script/lua_api/l_rollback.h
  184. +1 −4 src/script/lua_api/l_server.h
  185. +1 −4 src/script/lua_api/l_settings.h
  186. +1 −4 src/script/lua_api/l_sound.h
  187. +1 −4 src/script/lua_api/l_storage.h
  188. +1 −4 src/script/lua_api/l_util.h
  189. +1 −4 src/script/lua_api/l_vmanip.h
  190. +1 −3 src/script/scripting_client.h
  191. +1 −5 src/script/scripting_mainmenu.h
  192. +1 −5 src/script/scripting_server.h
  193. +1 −5 src/serialization.h
  194. +1 −4 src/server.h
  195. +1 −4 src/serverenvironment.h
  196. +1 −4 src/serverlist.h
  197. +1 −5 src/serverobject.h
  198. +1 −5 src/settings.h
  199. +1 −4 src/shader.h
  200. +1 −4 src/sky.h
  201. +1 −5 src/socket.h
  202. +1 −4 src/sound.h
  203. +1 −5 src/sound_openal.h
  204. +1 −5 src/staticobject.h
  205. +1 −5 src/subgame.h
  206. +1 −4 src/terminal_chat_console.h
  207. +1 −4 src/threading/event.h
  208. +1 −4 src/threading/semaphore.h
  209. +1 −4 src/tileanimation.h
  210. +1 −5 src/tool.h
  211. +1 −3 src/touchscreengui.h
  212. +1 −3 src/treegen.h
  213. +1 −4 src/unittest/test.h
  214. +1 −4 src/util/areastore.h
  215. +1 −4 src/util/auth.h
  216. +20 −4 src/util/base64.h
  217. +1 −4 src/util/basic_macros.h
  218. +1 −5 src/util/container.h
  219. +1 −4 src/util/directiontables.h
  220. +1 −4 src/util/enriched_string.h
  221. +1 −4 src/util/hex.h
  222. +1 −4 src/util/numeric.h
  223. +1 −5 src/util/pointedthing.h
  224. +1 −5 src/util/pointer.h
  225. +1 −4 src/util/serialize.h
  226. +2 −4 src/util/sha1.h
  227. +1 −4 src/util/sha2.h
  228. +1 −4 src/util/srp.h
  229. +1 −5 src/util/strfnd.h
  230. +1 −5 src/util/string.h
  231. +1 −5 src/util/thread.h
  232. +1 −5 src/util/timetaker.h
  233. +1 −5 src/version.h
  234. +1 −5 src/voxel.h
  235. +1 −7 src/voxelalgorithms.h
  236. +1 −3 src/wieldmesh.h
@@ -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>
@@ -102,6 +101,3 @@ class ActiveObject
protected:
u16 m_id; // 0 is invalid, "no id"
};

#endif

@@ -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"
@@ -48,5 +47,3 @@ class BanManager
StringMap m_ips;
bool m_modified = false;
};

#endif
@@ -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"
@@ -232,5 +231,3 @@ class Camera

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

#endif
@@ -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

@@ -241,5 +240,3 @@ class CavesV6

inline s16 getSurfaceFromHeightmap(v3s16 p);
};

#endif
@@ -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>
@@ -287,6 +286,3 @@ class ChatBackend
ChatBuffer m_recent_buffer;
ChatPrompt m_prompt;
};

#endif

@@ -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>
@@ -78,5 +77,3 @@ struct ChatInterface {
MutexedQueue<ChatEvent *> command_queue; // chat backend --> server
MutexedQueue<ChatEvent *> outgoing_queue; // server --> chat backend
};

#endif
@@ -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>
@@ -47,5 +46,3 @@ struct ChatMessage
std::wstring sender = L"";
std::time_t timestamp = std::time(0);
};

#endif
@@ -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"
@@ -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
@@ -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"
@@ -69,5 +68,3 @@ class ClientLauncher
std::string current_address = "does-not-exist";
int current_port = 0;
};

#endif
@@ -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"
@@ -393,5 +392,3 @@ class RandomInputHandler : public InputHandler
bool leftreleased = false;
bool rightreleased = false;
};

#endif
@@ -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"
@@ -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
@@ -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 KEYS_HEADER
#define KEYS_HEADER
#pragma once

#include <list>

@@ -114,5 +113,3 @@ class KeyType
};

typedef KeyType::T GameKeyType;

#endif
@@ -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 TILE_HEADER
#define TILE_HEADER
#pragma once

#include "irrlichttypes.h"
#include "irr_v3d.h"
@@ -330,4 +329,3 @@ struct TileSpec
//! The first is base texture, the second is overlay.
TileLayer layers[MAX_TILE_LAYERS];
};
#endif
@@ -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_ENVIRONMENT_HEADER
#define CLIENT_ENVIRONMENT_HEADER
#pragma once

#include <ISceneManager.h>
#include "environment.h"
@@ -158,5 +157,3 @@ class ClientEnvironment : public Environment
std::list<std::string> m_player_names;
v3s16 m_camera_offset;
};

#endif
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _CLIENTIFACE_H_
#define _CLIENTIFACE_H_

#pragma once

#include "irr_v3d.h" // for irrlicht datatypes

@@ -500,5 +500,3 @@ class ClientInterface {

static const char *statenames[];
};

#endif
@@ -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 CLIENTMAP_HEADER
#define CLIENTMAP_HEADER
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "map.h"
@@ -137,6 +136,3 @@ class ClientMap : public Map, public scene::ISceneNode
bool m_cache_bilinear_filter;
bool m_cache_anistropic_filter;
};

#endif

@@ -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 CLIENTMEDIA_HEADER
#define CLIENTMEDIA_HEADER
#pragma once

#include "irrlichttypes.h"
#include "filecache.h"
@@ -147,5 +146,3 @@ class ClientMediaDownloader
std::string m_name_bound = "";

};

#endif // !CLIENTMEDIA_HEADER
@@ -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 CLIENTOBJECT_HEADER
#define CLIENTOBJECT_HEADER
#pragma once

#include "irrlichttypes_extrabloated.h"
#include "activeobject.h"
@@ -106,5 +105,3 @@ struct DistanceSortedActiveObject
return d < other.d;
}
};

#endif
@@ -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 CLIENTSIMPLEOBJECT_HEADER
#define CLIENTSIMPLEOBJECT_HEADER
#pragma once

#include "irrlichttypes_bloated.h"
class ClientEnvironment;
@@ -34,5 +33,3 @@ class ClientSimpleObject

virtual void step(float dtime) {}
};

#endif
@@ -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 CLOUDPARAMS_HEADER
#define CLOUDPARAMS_HEADER
#pragma once

struct CloudParams
{
@@ -29,5 +28,3 @@ struct CloudParams
float height;
v2f speed;
};

#endif
@@ -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 CLOUDS_HEADER
#define CLOUDS_HEADER
#pragma once

#include "irrlichttypes_extrabloated.h"
#include <iostream>
@@ -143,7 +142,3 @@ class Clouds : public scene::ISceneNode
bool m_camera_inside_cloud = false;

};



#endif
@@ -1,7 +1,6 @@
// Filled in by the build system

#ifndef CMAKE_CONFIG_H
#define CMAKE_CONFIG_H
#pragma once

#define PROJECT_NAME "@PROJECT_NAME@"
#define PROJECT_NAME_C "@PROJECT_NAME_CAPITALIZED@"
@@ -34,6 +33,3 @@
#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
#cmakedefine01 CURSES_HAVE_NCURSESW_NCURSES_H
#cmakedefine01 CURSES_HAVE_NCURSESW_CURSES_H

#endif

@@ -1,10 +1,6 @@
// Filled in by the build system
// Separated from cmake_config.h to avoid excessive rebuilds on every commit

#ifndef CMAKE_CONFIG_GITHASH_H
#define CMAKE_CONFIG_GITHASH_H
#pragma once

#define VERSION_GITHASH "@VERSION_GITHASH@"

#endif

@@ -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 COLLISION_HEADER
#define COLLISION_HEADER
#pragma once

#include "irrlichttypes_bloated.h"
#include <vector>
@@ -76,7 +75,3 @@ bool wouldCollideWithCeiling(
const std::vector<aabb3f> &staticboxes,
const aabb3f &movingbox,
f32 y_increase, f32 d);


#endif

Oops, something went wrong.

0 comments on commit 921151d

Please sign in to comment.
You can’t perform that action at this time.