From 921151d97a2fb2238ab514324fb95e2732248b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 17 Aug 2017 22:19:39 +0200 Subject: [PATCH] C++ modernize: Pragma once (#6264) * Migrate cpp headers to pragma once --- src/activeobject.h | 6 +----- src/ban.h | 5 +---- src/camera.h | 5 +---- src/cavegen.h | 5 +---- src/chat.h | 6 +----- src/chat_interface.h | 5 +---- src/chatmessage.h | 5 +---- src/client.h | 5 +---- src/client/clientlauncher.h | 5 +---- src/client/inputhandler.h | 5 +---- src/client/joystick_controller.h | 5 +---- src/client/keys.h | 5 +---- src/client/tile.h | 4 +--- src/clientenvironment.h | 5 +---- src/clientiface.h | 6 ++---- src/clientmap.h | 6 +----- src/clientmedia.h | 5 +---- src/clientobject.h | 5 +---- src/clientsimpleobject.h | 5 +---- src/cloudparams.h | 5 +---- src/clouds.h | 7 +------ src/cmake_config.h.in | 6 +----- src/cmake_config_githash.h.in | 6 +----- src/collision.h | 7 +------ src/config.h | 5 +---- src/constants.h | 5 +---- src/content_cao.h | 6 +----- src/content_cso.h | 6 +----- src/content_mapblock.h | 5 +---- src/content_mapnode.h | 5 +---- src/content_nodemeta.h | 6 +----- src/content_sao.h | 5 +---- src/convert_json.h | 9 +++------ src/craftdef.h | 6 +----- src/database-dummy.h | 5 +---- src/database-files.h | 5 +---- src/database-leveldb.h | 5 +---- src/database-postgresql.h | 6 +----- src/database-redis.h | 5 +---- src/database-sqlite3.h | 5 +---- src/database.h | 5 +---- src/daynightratio.h | 6 +----- src/debug.h | 7 +------ src/defaultsettings.h | 5 +---- src/dungeongen.h | 5 +---- src/emerge.h | 5 +---- src/environment.h | 5 +---- src/event.h | 6 +----- src/event_manager.h | 6 +----- src/exceptions.h | 6 +----- src/face_position_cache.h | 5 +---- src/filecache.h | 5 +---- src/filesys.h | 6 +----- src/fontengine.h | 6 ++---- src/game.h | 5 +---- src/gamedef.h | 6 +----- src/gameparams.h | 5 +---- src/genericobject.h | 6 +----- src/gettext.h | 5 +---- src/gettime.h | 5 +---- src/guiChatConsole.h | 7 +------ src/guiEngine.h | 5 +---- src/guiFormSpecMenu.h | 6 +----- src/guiKeyChangeMenu.h | 5 +---- src/guiMainMenu.h | 6 +----- src/guiPasswordChange.h | 5 +---- src/guiPathSelectMenu.h | 5 +---- src/guiTable.h | 7 +------ src/guiVolumeChange.h | 6 +----- src/guiscalingfilter.h | 6 ++---- src/httpfetch.h | 5 +---- src/hud.h | 5 +---- src/imagefilters.h | 5 +---- src/intlGUIEditBox.h | 4 +--- src/inventory.h | 5 +---- src/inventorymanager.h | 6 +----- src/irr_aabb3d.h | 5 +---- src/irr_v2d.h | 5 +---- src/irr_v3d.h | 5 +---- src/irrlicht_changes/CGUITTFont.h | 5 +---- src/irrlicht_changes/irrUString.h | 5 +---- src/irrlicht_changes/static_text.h | 5 +---- src/irrlichttypes.h | 5 +---- src/irrlichttypes_bloated.h | 5 +---- src/irrlichttypes_extrabloated.h | 5 +---- src/itemdef.h | 5 +---- src/itemgroup.h | 5 +---- src/itemstackmetadata.h | 5 +---- src/keycode.h | 5 +---- src/light.h | 5 +---- src/localplayer.h | 5 +---- src/log.h | 6 +----- src/mainmenumanager.h | 6 +----- src/map.h | 5 +---- src/map_settings_manager.h | 5 +---- src/mapblock.h | 5 +---- src/mapblock_mesh.h | 6 +----- src/mapgen.h | 5 +---- src/mapgen_carpathian.h | 5 +---- src/mapgen_flat.h | 5 +---- src/mapgen_fractal.h | 5 +---- src/mapgen_singlenode.h | 5 +---- src/mapgen_v5.h | 5 +---- src/mapgen_v6.h | 5 +---- src/mapgen_v7.h | 5 +---- src/mapgen_valleys.h | 5 +---- src/mapnode.h | 6 +----- src/mapsector.h | 6 +----- src/mesh.h | 9 +++------ src/mesh_generator_thread.h | 5 +---- src/metadata.h | 5 +---- src/mg_biome.h | 6 +----- src/mg_decoration.h | 5 +---- src/mg_ore.h | 5 +---- src/mg_schematic.h | 5 +---- src/minimap.h | 5 +---- src/modalMenu.h | 7 +------ src/modifiedstate.h | 5 +---- src/mods.h | 5 +---- src/nameidmapping.h | 5 +---- src/network/clientopcodes.h | 5 +---- src/network/connection.h | 5 +---- src/network/networkpacket.h | 5 +---- src/network/serveropcodes.h | 5 +---- src/nodedef.h | 5 +---- src/nodemetadata.h | 5 +---- src/nodetimer.h | 6 +----- src/noise.h | 6 +----- src/objdef.h | 5 +---- src/object_properties.h | 5 +---- src/particles.h | 5 +---- src/pathfinder.h | 5 +---- src/player.h | 6 +----- src/porting.h | 6 +----- src/porting_android.h | 6 ++---- src/profiler.h | 6 +----- src/quicktune.h | 12 ++++-------- src/quicktune_shortcutter.h | 6 +----- src/raycast.h | 6 +----- src/reflowscan.h | 5 +---- src/remoteplayer.h | 5 +---- src/rollback.h | 5 +---- src/rollback_interface.h | 5 +---- src/script/common/c_content.h | 5 +---- src/script/common/c_converter.h | 5 +---- src/script/common/c_internal.h | 5 +---- src/script/common/c_types.h | 5 +---- src/script/cpp_api/s_async.h | 5 +---- src/script/cpp_api/s_base.h | 5 +---- src/script/cpp_api/s_client.h | 4 +--- src/script/cpp_api/s_entity.h | 7 +------ src/script/cpp_api/s_env.h | 5 +---- src/script/cpp_api/s_internal.h | 6 +----- src/script/cpp_api/s_inventory.h | 7 +------ src/script/cpp_api/s_item.h | 6 +----- src/script/cpp_api/s_mainmenu.h | 5 +---- src/script/cpp_api/s_node.h | 7 +------ src/script/cpp_api/s_nodemeta.h | 5 +---- src/script/cpp_api/s_player.h | 5 +---- src/script/cpp_api/s_security.h | 6 +----- src/script/cpp_api/s_server.h | 7 +------ src/script/lua_api/l_areastore.h | 5 +---- src/script/lua_api/l_base.h | 5 +---- src/script/lua_api/l_camera.h | 24 ++++++++++++++++++++---- src/script/lua_api/l_client.h | 5 +---- src/script/lua_api/l_craft.h | 5 +---- src/script/lua_api/l_env.h | 5 +---- src/script/lua_api/l_http.h | 5 +---- src/script/lua_api/l_internal.h | 5 +---- src/script/lua_api/l_inventory.h | 5 +---- src/script/lua_api/l_item.h | 7 +------ src/script/lua_api/l_itemstackmeta.h | 5 +---- src/script/lua_api/l_localplayer.h | 5 +---- src/script/lua_api/l_mainmenu.h | 5 +---- src/script/lua_api/l_mapgen.h | 5 +---- src/script/lua_api/l_metadata.h | 6 ++---- src/script/lua_api/l_minimap.h | 5 +---- src/script/lua_api/l_nodemeta.h | 6 ++---- src/script/lua_api/l_nodetimer.h | 5 +---- src/script/lua_api/l_noise.h | 5 +---- src/script/lua_api/l_object.h | 5 +---- src/script/lua_api/l_particles.h | 7 +------ src/script/lua_api/l_rollback.h | 5 +---- src/script/lua_api/l_server.h | 5 +---- src/script/lua_api/l_settings.h | 5 +---- src/script/lua_api/l_sound.h | 5 +---- src/script/lua_api/l_storage.h | 5 +---- src/script/lua_api/l_util.h | 5 +---- src/script/lua_api/l_vmanip.h | 5 +---- src/script/scripting_client.h | 4 +--- src/script/scripting_mainmenu.h | 6 +----- src/script/scripting_server.h | 6 +----- src/serialization.h | 6 +----- src/server.h | 5 +---- src/serverenvironment.h | 5 +---- src/serverlist.h | 5 +---- src/serverobject.h | 6 +----- src/settings.h | 6 +----- src/shader.h | 5 +---- src/sky.h | 5 +---- src/socket.h | 6 +----- src/sound.h | 5 +---- src/sound_openal.h | 6 +----- src/staticobject.h | 6 +----- src/subgame.h | 6 +----- src/terminal_chat_console.h | 5 +---- src/threading/event.h | 5 +---- src/threading/semaphore.h | 5 +---- src/tileanimation.h | 5 +---- src/tool.h | 6 +----- src/touchscreengui.h | 4 +--- src/treegen.h | 4 +--- src/unittest/test.h | 5 +---- src/util/areastore.h | 5 +---- src/util/auth.h | 5 +---- src/util/base64.h | 24 ++++++++++++++++++++---- src/util/basic_macros.h | 5 +---- src/util/container.h | 6 +----- src/util/directiontables.h | 5 +---- src/util/enriched_string.h | 5 +---- src/util/hex.h | 5 +---- src/util/numeric.h | 5 +---- src/util/pointedthing.h | 6 +----- src/util/pointer.h | 6 +----- src/util/serialize.h | 5 +---- src/util/sha1.h | 6 ++---- src/util/sha2.h | 5 +---- src/util/srp.h | 5 +---- src/util/strfnd.h | 6 +----- src/util/string.h | 6 +----- src/util/thread.h | 6 +----- src/util/timetaker.h | 6 +----- src/version.h | 6 +----- src/voxel.h | 6 +----- src/voxelalgorithms.h | 8 +------- src/wieldmesh.h | 4 +--- 236 files changed, 288 insertions(+), 1028 deletions(-) diff --git a/src/activeobject.h b/src/activeobject.h index 4796e168c..b6a0e67af 100644 --- a/src/activeobject.h +++ b/src/activeobject.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 @@ -102,6 +101,3 @@ public: protected: u16 m_id; // 0 is invalid, "no id" }; - -#endif - diff --git a/src/ban.h b/src/ban.h index 44cc94e6e..3e2ab7a87 100644 --- a/src/ban.h +++ b/src/ban.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 BAN_HEADER -#define BAN_HEADER +#pragma once #include "util/string.h" #include "threading/thread.h" @@ -48,5 +47,3 @@ private: StringMap m_ips; bool m_modified = false; }; - -#endif diff --git a/src/camera.h b/src/camera.h index ce80fa9f8..b8de3b1db 100644 --- a/src/camera.h +++ b/src/camera.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 CAMERA_HEADER -#define CAMERA_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "inventory.h" @@ -232,5 +231,3 @@ private: std::list m_nametags; }; - -#endif diff --git a/src/cavegen.h b/src/cavegen.h index db3e091f6..ce146e0cd 100644 --- a/src/cavegen.h +++ b/src/cavegen.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 CAVEGEN_HEADER -#define CAVEGEN_HEADER +#pragma once #define VMANIP_FLAG_CAVE VOXELFLAG_CHECKED1 @@ -241,5 +240,3 @@ private: inline s16 getSurfaceFromHeightmap(v3s16 p); }; - -#endif diff --git a/src/chat.h b/src/chat.h index e3961b3fa..38727c668 100644 --- a/src/chat.h +++ b/src/chat.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 CHAT_HEADER -#define CHAT_HEADER +#pragma once #include #include @@ -287,6 +286,3 @@ private: ChatBuffer m_recent_buffer; ChatPrompt m_prompt; }; - -#endif - diff --git a/src/chat_interface.h b/src/chat_interface.h index 4784821fc..5dc3d3880 100644 --- a/src/chat_interface.h +++ b/src/chat_interface.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 CHAT_INTERFACE_H -#define CHAT_INTERFACE_H +#pragma once #include "util/container.h" #include @@ -78,5 +77,3 @@ struct ChatInterface { MutexedQueue command_queue; // chat backend --> server MutexedQueue outgoing_queue; // server --> chat backend }; - -#endif diff --git a/src/chatmessage.h b/src/chatmessage.h index 3ef855098..06c5ea664 100644 --- a/src/chatmessage.h +++ b/src/chatmessage.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 MT_CHATMESSAGE_H -#define MT_CHATMESSAGE_H +#pragma once #include #include @@ -47,5 +46,3 @@ struct ChatMessage std::wstring sender = L""; std::time_t timestamp = std::time(0); }; - -#endif diff --git a/src/client.h b/src/client.h index 121f825b9..80f4cee40 100644 --- a/src/client.h +++ b/src/client.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 CLIENT_HEADER -#define CLIENT_HEADER +#pragma once #include "network/connection.h" #include "clientenvironment.h" @@ -718,5 +717,3 @@ private: u64 m_csm_flavour_limits = CSMFlavourLimit::CSM_FL_NONE; u32 m_csm_noderange_limit = 8; }; - -#endif // !CLIENT_HEADER diff --git a/src/client/clientlauncher.h b/src/client/clientlauncher.h index 6e3741182..2702895d6 100644 --- a/src/client/clientlauncher.h +++ b/src/client/clientlauncher.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 __CLIENT_LAUNCHER_H__ -#define __CLIENT_LAUNCHER_H__ +#pragma once #include "irrlichttypes_extrabloated.h" #include "client/inputhandler.h" @@ -69,5 +68,3 @@ protected: std::string current_address = "does-not-exist"; int current_port = 0; }; - -#endif diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h index f14e7d801..249336947 100644 --- a/src/client/inputhandler.h +++ b/src/client/inputhandler.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 INPUT_HANDLER_H -#define INPUT_HANDLER_H +#pragma once #include "irrlichttypes_extrabloated.h" #include "joystick_controller.h" @@ -393,5 +392,3 @@ private: bool leftreleased = false; bool rightreleased = false; }; - -#endif diff --git a/src/client/joystick_controller.h b/src/client/joystick_controller.h index 4a2cdf555..6bea282ee 100644 --- a/src/client/joystick_controller.h +++ b/src/client/joystick_controller.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 JOYSTICK_HEADER -#define JOYSTICK_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "keys.h" @@ -168,5 +167,3 @@ private: std::bitset m_past_pressed_keys; std::bitset m_past_released_keys; }; - -#endif diff --git a/src/client/keys.h b/src/client/keys.h index d10c96240..7ee286799 100644 --- a/src/client/keys.h +++ b/src/client/keys.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 KEYS_HEADER -#define KEYS_HEADER +#pragma once #include @@ -114,5 +113,3 @@ public: }; typedef KeyType::T GameKeyType; - -#endif diff --git a/src/client/tile.h b/src/client/tile.h index cd3c3880e..8a8c5bd47 100644 --- a/src/client/tile.h +++ b/src/client/tile.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 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 diff --git a/src/clientenvironment.h b/src/clientenvironment.h index d384bf78c..be8130828 100644 --- a/src/clientenvironment.h +++ b/src/clientenvironment.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 CLIENT_ENVIRONMENT_HEADER -#define CLIENT_ENVIRONMENT_HEADER +#pragma once #include #include "environment.h" @@ -158,5 +157,3 @@ private: std::list m_player_names; v3s16 m_camera_offset; }; - -#endif diff --git a/src/clientiface.h b/src/clientiface.h index 36aa3572d..3ee09317d 100644 --- a/src/clientiface.h +++ b/src/clientiface.h @@ -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 @@ private: static const char *statenames[]; }; - -#endif diff --git a/src/clientmap.h b/src/clientmap.h index 761d124e7..8402bb00d 100644 --- a/src/clientmap.h +++ b/src/clientmap.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 CLIENTMAP_HEADER -#define CLIENTMAP_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "map.h" @@ -137,6 +136,3 @@ private: bool m_cache_bilinear_filter; bool m_cache_anistropic_filter; }; - -#endif - diff --git a/src/clientmedia.h b/src/clientmedia.h index d6eaf4c72..b08b83e4d 100644 --- a/src/clientmedia.h +++ b/src/clientmedia.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 CLIENTMEDIA_HEADER -#define CLIENTMEDIA_HEADER +#pragma once #include "irrlichttypes.h" #include "filecache.h" @@ -147,5 +146,3 @@ private: std::string m_name_bound = ""; }; - -#endif // !CLIENTMEDIA_HEADER diff --git a/src/clientobject.h b/src/clientobject.h index eeed2516d..c85e1ec91 100644 --- a/src/clientobject.h +++ b/src/clientobject.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 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 diff --git a/src/clientsimpleobject.h b/src/clientsimpleobject.h index 6cdeaeff9..f4a40bcd3 100644 --- a/src/clientsimpleobject.h +++ b/src/clientsimpleobject.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 CLIENTSIMPLEOBJECT_HEADER -#define CLIENTSIMPLEOBJECT_HEADER +#pragma once #include "irrlichttypes_bloated.h" class ClientEnvironment; @@ -34,5 +33,3 @@ public: virtual void step(float dtime) {} }; - -#endif diff --git a/src/cloudparams.h b/src/cloudparams.h index dafec4b27..88b5760ee 100644 --- a/src/cloudparams.h +++ b/src/cloudparams.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 CLOUDPARAMS_HEADER -#define CLOUDPARAMS_HEADER +#pragma once struct CloudParams { @@ -29,5 +28,3 @@ struct CloudParams float height; v2f speed; }; - -#endif diff --git a/src/clouds.h b/src/clouds.h index 78d88a02b..a4d810faa 100644 --- a/src/clouds.h +++ b/src/clouds.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 CLOUDS_HEADER -#define CLOUDS_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include @@ -143,7 +142,3 @@ private: bool m_camera_inside_cloud = false; }; - - - -#endif diff --git a/src/cmake_config.h.in b/src/cmake_config.h.in index 4b731020a..81b8c2695 100644 --- a/src/cmake_config.h.in +++ b/src/cmake_config.h.in @@ -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 - diff --git a/src/cmake_config_githash.h.in b/src/cmake_config_githash.h.in index c72960c9f..66870b048 100644 --- a/src/cmake_config_githash.h.in +++ b/src/cmake_config_githash.h.in @@ -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 - diff --git a/src/collision.h b/src/collision.h index d72c6d62f..4d47171ea 100644 --- a/src/collision.h +++ b/src/collision.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 COLLISION_HEADER -#define COLLISION_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include @@ -76,7 +75,3 @@ bool wouldCollideWithCeiling( const std::vector &staticboxes, const aabb3f &movingbox, f32 y_increase, f32 d); - - -#endif - diff --git a/src/config.h b/src/config.h index 0955ea8f5..fc4be6e9e 100644 --- a/src/config.h +++ b/src/config.h @@ -3,8 +3,7 @@ Otherwise use default values */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #define STRINGIFY(x) #x #define STR(x) STRINGIFY(x) @@ -38,5 +37,3 @@ " USE_FREETYPE=" STR(USE_FREETYPE) \ " USE_LUAJIT=" STR(USE_LUAJIT) \ " STATIC_SHAREDIR=" STR(STATIC_SHAREDIR) - -#endif diff --git a/src/constants.h b/src/constants.h index e615d00cd..dd5611ac7 100644 --- a/src/constants.h +++ b/src/constants.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 CONSTANTS_HEADER -#define CONSTANTS_HEADER +#pragma once /* All kinds of constants. @@ -118,5 +117,3 @@ with this program; if not, write to the Free Software Foundation, Inc., #define TTF_DEFAULT_FONT_SIZE (16) #endif #define DEFAULT_FONT_SIZE (10) - -#endif diff --git a/src/content_cao.h b/src/content_cao.h index dc254ad5b..693961348 100644 --- a/src/content_cao.h +++ b/src/content_cao.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 CONTENT_CAO_HEADER -#define CONTENT_CAO_HEADER +#pragma once #include #include "irrlichttypes_extrabloated.h" @@ -214,6 +213,3 @@ public: return m_prop.infotext; } }; - - -#endif diff --git a/src/content_cso.h b/src/content_cso.h index 5007d2526..cc9213175 100644 --- a/src/content_cso.h +++ b/src/content_cso.h @@ -17,14 +17,10 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef CONTENT_CSO_HEADER -#define CONTENT_CSO_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "clientsimpleobject.h" ClientSimpleObject* createSmokePuff(scene::ISceneManager *smgr, ClientEnvironment *env, v3f pos, v2f size); - -#endif - diff --git a/src/content_mapblock.h b/src/content_mapblock.h index d1c8c7caf..aee550d34 100644 --- a/src/content_mapblock.h +++ b/src/content_mapblock.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 CONTENT_MAPBLOCK_HEADER -#define CONTENT_MAPBLOCK_HEADER +#pragma once #include "nodedef.h" #include @@ -146,5 +145,3 @@ public: MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output); void generate(); }; - -#endif diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 9fa4e6d13..76c3f6cd1 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.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 CONTENT_MAPNODE_HEADER -#define CONTENT_MAPNODE_HEADER +#pragma once #include "mapnode.h" @@ -33,5 +32,3 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); // Get legacy node name mapping for loading old blocks class NameIdMapping; void content_mapnode_get_name_id_mapping(NameIdMapping *nimap); - -#endif diff --git a/src/content_nodemeta.h b/src/content_nodemeta.h index 3c632ed4a..b853274f5 100644 --- a/src/content_nodemeta.h +++ b/src/content_nodemeta.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 CONTENT_NODEMETA_HEADER -#define CONTENT_NODEMETA_HEADER +#pragma once #include @@ -33,6 +32,3 @@ class IItemDefManager; void content_nodemeta_deserialize_legacy(std::istream &is, NodeMetadataList *meta, NodeTimerList *timers, IItemDefManager *item_def_mgr); - -#endif - diff --git a/src/content_sao.h b/src/content_sao.h index a986acab0..39822bb62 100644 --- a/src/content_sao.h +++ b/src/content_sao.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 CONTENT_SAO_HEADER -#define CONTENT_SAO_HEADER +#pragma once #include #include "serverobject.h" @@ -412,5 +411,3 @@ public: bool m_physics_override_new_move = true; bool m_physics_override_sent = false; }; - -#endif diff --git a/src/convert_json.h b/src/convert_json.h index b5831884f..d19e70851 100644 --- a/src/convert_json.h +++ b/src/convert_json.h @@ -17,12 +17,9 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __CONVERT_JSON_H__ -#define __CONVERT_JSON_H__ +#pragma once #include -Json::Value fetchJsonValue(const std::string &url, - std::vector *extra_headers); - -#endif +Json::Value fetchJsonValue(const std::string &url, + std::vector *extra_headers); diff --git a/src/craftdef.h b/src/craftdef.h index fddff6cef..781ca0d17 100644 --- a/src/craftdef.h +++ b/src/craftdef.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 CRAFTDEF_HEADER -#define CRAFTDEF_HEADER +#pragma once #include #include @@ -446,6 +445,3 @@ public: }; IWritableCraftDefManager* createCraftDefManager(); - -#endif - diff --git a/src/database-dummy.h b/src/database-dummy.h index c4060d5f1..d65890411 100644 --- a/src/database-dummy.h +++ b/src/database-dummy.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 DATABASE_DUMMY_HEADER -#define DATABASE_DUMMY_HEADER +#pragma once #include #include @@ -44,5 +43,3 @@ public: private: std::map m_database; }; - -#endif diff --git a/src/database-files.h b/src/database-files.h index 888362249..80af42308 100644 --- a/src/database-files.h +++ b/src/database-files.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 DATABASE_FILES_HEADER -#define DATABASE_FILES_HEADER +#pragma once // !!! WARNING !!! // This backend is intended to be used on Minetest 0.4.16 only for the transition backend @@ -42,5 +41,3 @@ private: std::string m_savedir; }; - -#endif diff --git a/src/database-leveldb.h b/src/database-leveldb.h index 1a51f98b6..d30f9f8f5 100644 --- a/src/database-leveldb.h +++ b/src/database-leveldb.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 DATABASE_LEVELDB_HEADER -#define DATABASE_LEVELDB_HEADER +#pragma once #include "config.h" @@ -47,5 +46,3 @@ private: }; #endif // USE_LEVELDB - -#endif diff --git a/src/database-postgresql.h b/src/database-postgresql.h index 8bb72ec6a..94d651e24 100644 --- a/src/database-postgresql.h +++ b/src/database-postgresql.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 DATABASE_POSTGRESQL_HEADER -#define DATABASE_POSTGRESQL_HEADER +#pragma once #include #include @@ -145,6 +144,3 @@ protected: private: bool playerDataExists(const std::string &playername); }; - -#endif - diff --git a/src/database-redis.h b/src/database-redis.h index 1e7909f85..6bea563bc 100644 --- a/src/database-redis.h +++ b/src/database-redis.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 DATABASE_REDIS_HEADER -#define DATABASE_REDIS_HEADER +#pragma once #include "config.h" @@ -50,5 +49,3 @@ private: }; #endif // USE_REDIS - -#endif diff --git a/src/database-sqlite3.h b/src/database-sqlite3.h index ec7a34ad7..8d9f91f21 100644 --- a/src/database-sqlite3.h +++ b/src/database-sqlite3.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 DATABASE_SQLITE3_HEADER -#define DATABASE_SQLITE3_HEADER +#pragma once #include #include @@ -192,5 +191,3 @@ private: sqlite3_stmt *m_stmt_player_metadata_remove = nullptr; sqlite3_stmt *m_stmt_player_metadata_add = nullptr; }; - -#endif diff --git a/src/database.h b/src/database.h index 5a2b844fd..867bca07f 100644 --- a/src/database.h +++ b/src/database.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 DATABASE_HEADER -#define DATABASE_HEADER +#pragma once #include #include @@ -61,5 +60,3 @@ public: virtual bool removePlayer(const std::string &name) = 0; virtual void listPlayers(std::vector &res) = 0; }; - -#endif diff --git a/src/daynightratio.h b/src/daynightratio.h index 3375133ef..3b71ee84e 100644 --- a/src/daynightratio.h +++ b/src/daynightratio.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 DAYNIGHTRATIO_HEADER -#define DAYNIGHTRATIO_HEADER +#pragma once inline u32 time_to_daynight_ratio(float time_of_day, bool smooth) { @@ -64,6 +63,3 @@ inline u32 time_to_daynight_ratio(float time_of_day, bool smooth) return 1000; } } - -#endif - diff --git a/src/debug.h b/src/debug.h index 639ba673d..088ec0b87 100644 --- a/src/debug.h +++ b/src/debug.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 DEBUG_HEADER -#define DEBUG_HEADER +#pragma once #include #include @@ -131,7 +130,3 @@ private: #define BEGIN_DEBUG_EXCEPTION_HANDLER #define END_DEBUG_EXCEPTION_HANDLER #endif - -#endif // DEBUG_HEADER - - diff --git a/src/defaultsettings.h b/src/defaultsettings.h index 21c51396f..c81e88502 100644 --- a/src/defaultsettings.h +++ b/src/defaultsettings.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 DEFAULTSETTINGS_HEADER -#define DEFAULTSETTINGS_HEADER +#pragma once class Settings; @@ -34,5 +33,3 @@ void set_default_settings(Settings *settings); * @param from source settings pointer */ void override_default_settings(Settings *settings, Settings *from); - -#endif diff --git a/src/dungeongen.h b/src/dungeongen.h index 4bd208330..6799db79e 100644 --- a/src/dungeongen.h +++ b/src/dungeongen.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 DUNGEONGEN_HEADER -#define DUNGEONGEN_HEADER +#pragma once #include "voxel.h" #include "noise.h" @@ -109,5 +108,3 @@ public: extern NoiseParams nparams_dungeon_density; extern NoiseParams nparams_dungeon_alt_wall; - -#endif diff --git a/src/emerge.h b/src/emerge.h index cf0a27d63..81b7a0a53 100644 --- a/src/emerge.h +++ b/src/emerge.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 EMERGE_HEADER -#define EMERGE_HEADER +#pragma once #include #include @@ -174,5 +173,3 @@ private: friend class EmergeThread; }; - -#endif diff --git a/src/environment.h b/src/environment.h index 6c45592dc..2b7cbc2dd 100644 --- a/src/environment.h +++ b/src/environment.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 ENVIRONMENT_HEADER -#define ENVIRONMENT_HEADER +#pragma once /* This class is the game's environment. @@ -144,5 +143,3 @@ protected: private: std::mutex m_time_lock; }; - -#endif diff --git a/src/event.h b/src/event.h index 7ab139b59..c53c59d74 100644 --- a/src/event.h +++ b/src/event.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 EVENT_HEADER -#define EVENT_HEADER +#pragma once class MtEvent { @@ -67,6 +66,3 @@ public: virtual void reg(MtEventReceiver *r, const char *type) = 0; virtual void dereg(MtEventReceiver *r, const char *type) = 0; }; - -#endif - diff --git a/src/event_manager.h b/src/event_manager.h index f926922f5..54cd728bd 100644 --- a/src/event_manager.h +++ b/src/event_manager.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 EVENT_MANAGER_HEADER -#define EVENT_MANAGER_HEADER +#pragma once #include "event.h" #include @@ -110,6 +109,3 @@ public: dereg(type, EventManager::receiverReceive, r); } }; - -#endif - diff --git a/src/exceptions.h b/src/exceptions.h index 07fecdaf7..a8a7db74c 100644 --- a/src/exceptions.h +++ b/src/exceptions.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 EXCEPTIONS_HEADER -#define EXCEPTIONS_HEADER +#pragma once #include #include @@ -129,6 +128,3 @@ public: BaseException(s) {} }; - -#endif - diff --git a/src/face_position_cache.h b/src/face_position_cache.h index 29ae0f0a9..36cb06484 100644 --- a/src/face_position_cache.h +++ b/src/face_position_cache.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 FACE_POSITION_CACHE_HEADER -#define FACE_POSITION_CACHE_HEADER +#pragma once #include "irr_v3d.h" @@ -40,5 +39,3 @@ private: static std::unordered_map> cache; static std::mutex cache_mutex; }; - -#endif diff --git a/src/filecache.h b/src/filecache.h index 627ab45ed..96e4c8ba1 100644 --- a/src/filecache.h +++ b/src/filecache.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef FILECACHE_HEADER -#define FILECACHE_HEADER +#pragma once #include #include @@ -41,5 +40,3 @@ private: bool loadByPath(const std::string &path, std::ostream &os); bool updateByPath(const std::string &path, const std::string &data); }; - -#endif diff --git a/src/filesys.h b/src/filesys.h index 94d0c874d..58846a265 100644 --- a/src/filesys.h +++ b/src/filesys.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 FILESYS_HEADER -#define FILESYS_HEADER +#pragma once #include #include @@ -118,6 +117,3 @@ bool safeWriteToFile(const std::string &path, const std::string &content); bool Rename(const std::string &from, const std::string &to); } // namespace fs - -#endif - diff --git a/src/fontengine.h b/src/fontengine.h index 0c97ac77b..0719edfc4 100644 --- a/src/fontengine.h +++ b/src/fontengine.h @@ -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 __FONTENGINE_H__ -#define __FONTENGINE_H__ + +#pragma once #include #include @@ -135,5 +135,3 @@ private: /** interface to access main font engine*/ extern FontEngine* g_fontengine; - -#endif diff --git a/src/game.h b/src/game.h index de3dd769f..22a8d6f9b 100644 --- a/src/game.h +++ b/src/game.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 GAME_HEADER -#define GAME_HEADER +#pragma once #include "irrlichttypes.h" #include @@ -52,5 +51,3 @@ void the_game(bool *kill, bool *reconnect_requested, const SubgameSpec &gamespec, // Used for local game bool simple_singleplayer_mode); - -#endif diff --git a/src/gamedef.h b/src/gamedef.h index 6cd01305f..e7fe6c4ab 100644 --- a/src/gamedef.h +++ b/src/gamedef.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 GAMEDEF_HEADER -#define GAMEDEF_HEADER +#pragma once #include #include @@ -80,6 +79,3 @@ public: virtual bool registerModStorage(ModMetadata *storage) = 0; virtual void unregisterModStorage(const std::string &name) = 0; }; - -#endif - diff --git a/src/gameparams.h b/src/gameparams.h index 4afc0fdce..28794a649 100644 --- a/src/gameparams.h +++ b/src/gameparams.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 GAME_PARAMS_H -#define GAME_PARAMS_H +#pragma once #include "irrlichttypes.h" @@ -31,5 +30,3 @@ struct GameParams SubgameSpec game_spec; bool is_dedicated_server; }; - -#endif diff --git a/src/genericobject.h b/src/genericobject.h index d22d7ef07..3ebc85fa3 100644 --- a/src/genericobject.h +++ b/src/genericobject.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 GENERICOBJECT_HEADER -#define GENERICOBJECT_HEADER +#pragma once #include #include "irrlichttypes_bloated.h" @@ -83,6 +82,3 @@ std::string gob_cmd_update_nametag_attributes(video::SColor color); std::string gob_cmd_update_infant(u16 id, u8 type, const std::string &client_initialization_data); - -#endif - diff --git a/src/gettext.h b/src/gettext.h index b87bdd9cc..d7fc586c0 100644 --- a/src/gettext.h +++ b/src/gettext.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 GETTEXT_HEADER -#define GETTEXT_HEADER +#pragma once #include "config.h" // for USE_GETTEXT #include @@ -59,5 +58,3 @@ inline std::string strgettext(const std::string &text) { return gettext(text.c_str()); } - -#endif diff --git a/src/gettime.h b/src/gettime.h index 4d5a02e1e..bae8b97c0 100644 --- a/src/gettime.h +++ b/src/gettime.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 GETTIME_HEADER -#define GETTIME_HEADER +#pragma once #include "irrlichttypes.h" #include @@ -42,5 +41,3 @@ inline std::string getTimestamp() strftime(cs, 20, "%Y-%m-%d %H:%M:%S", tm); return cs; } - -#endif diff --git a/src/guiChatConsole.h b/src/guiChatConsole.h index 3c39f2da6..ef8a87673 100644 --- a/src/guiChatConsole.h +++ b/src/guiChatConsole.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 GUICHATCONSOLE_HEADER -#define GUICHATCONSOLE_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "modalMenu.h" @@ -132,7 +131,3 @@ private: gui::IGUIFont *m_font = nullptr; v2u32 m_fontsize; }; - - -#endif - diff --git a/src/guiEngine.h b/src/guiEngine.h index 9f59051e8..817d76014 100644 --- a/src/guiEngine.h +++ b/src/guiEngine.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 GUI_ENGINE_H_ -#define GUI_ENGINE_H_ +#pragma once /******************************************************************************/ /* Includes */ @@ -303,5 +302,3 @@ private: }; - -#endif /* GUI_ENGINE_H_ */ diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h index 6d015e5c4..8ea68e8e8 100644 --- a/src/guiFormSpecMenu.h +++ b/src/guiFormSpecMenu.h @@ -17,9 +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 GUIINVENTORYMENU_HEADER -#define GUIINVENTORYMENU_HEADER +#pragma once #include #include @@ -567,5 +565,3 @@ public: std::string m_formspec; }; - -#endif diff --git a/src/guiKeyChangeMenu.h b/src/guiKeyChangeMenu.h index 84807c79f..7cf11d3f9 100644 --- a/src/guiKeyChangeMenu.h +++ b/src/guiKeyChangeMenu.h @@ -19,8 +19,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef GUIKEYCHANGEMENU_HEADER -#define GUIKEYCHANGEMENU_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "modalMenu.h" @@ -73,5 +72,3 @@ private: gui::IGUIStaticText *key_used_text = nullptr; std::vector key_settings; }; - -#endif diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h index c1c3c88a9..0bc5c7be1 100644 --- a/src/guiMainMenu.h +++ b/src/guiMainMenu.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 GUIMAINMENU_HEADER -#define GUIMAINMENU_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "modalMenu.h" @@ -54,6 +53,3 @@ struct MainMenuData { MainMenuData() {} }; - -#endif - diff --git a/src/guiPasswordChange.h b/src/guiPasswordChange.h index bb678fe2c..59f3513b2 100644 --- a/src/guiPasswordChange.h +++ b/src/guiPasswordChange.h @@ -16,8 +16,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef GUIPASSWORDCHANGE_HEADER -#define GUIPASSWORDCHANGE_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "modalMenu.h" @@ -52,5 +51,3 @@ private: std::wstring m_newpass = L""; std::wstring m_newpass_confirm = L""; }; - -#endif diff --git a/src/guiPathSelectMenu.h b/src/guiPathSelectMenu.h index b1877c77a..f69d0acd7 100644 --- a/src/guiPathSelectMenu.h +++ b/src/guiPathSelectMenu.h @@ -17,8 +17,7 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef GUIFILESELECTMENU_H_ -#define GUIFILESELECTMENU_H_ +#pragma once #include @@ -58,5 +57,3 @@ private: std::string m_formname; bool m_file_select_dialog; }; - -#endif /* GUIFILESELECTMENU_H_ */ diff --git a/src/guiTable.h b/src/guiTable.h index f66d0aecb..f9337ff6d 100644 --- a/src/guiTable.h +++ b/src/guiTable.h @@ -17,9 +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 GUITABLE_HEADER -#define GUITABLE_HEADER +#pragma once #include #include @@ -256,6 +254,3 @@ protected: static void alignContent(Cell *cell, s32 xmax, s32 content_width, s32 align); }; - -#endif - diff --git a/src/guiVolumeChange.h b/src/guiVolumeChange.h index 0a743dcdb..7c7e19a86 100644 --- a/src/guiVolumeChange.h +++ b/src/guiVolumeChange.h @@ -17,8 +17,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifndef GUIVOLUMECHANGE_HEADER -#define GUIVOLUMECHANGE_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "modalMenu.h" @@ -44,6 +43,3 @@ public: bool pausesGame() { return true; } }; - -#endif - diff --git a/src/guiscalingfilter.h b/src/guiscalingfilter.h index d956e1412..4661bf8da 100644 --- a/src/guiscalingfilter.h +++ b/src/guiscalingfilter.h @@ -15,8 +15,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 _GUI_SCALING_FILTER_H_ -#define _GUI_SCALING_FILTER_H_ + +#pragma once #include "irrlichttypes_extrabloated.h" @@ -48,5 +48,3 @@ void draw2DImageFilterScaled(video::IVideoDriver *driver, video::ITexture *txr, const core::rect &destrect, const core::rect &srcrect, const core::rect *cliprect = 0, const video::SColor *const colors = 0, bool usealpha = false); - -#endif diff --git a/src/httpfetch.h b/src/httpfetch.h index 5a673d7e6..206576849 100644 --- a/src/httpfetch.h +++ b/src/httpfetch.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 HTTPFETCH_HEADER -#define HTTPFETCH_HEADER +#pragma once #include #include "util/string.h" @@ -113,5 +112,3 @@ void httpfetch_caller_free(unsigned long caller); // Performs a synchronous HTTP request. This blocks and therefore should // only be used from background threads. void httpfetch_sync(const HTTPFetchRequest &fetch_request, HTTPFetchResult &fetch_result); - -#endif // !HTTPFETCH_HEADER diff --git a/src/hud.h b/src/hud.h index 7b208a26e..363909b0b 100644 --- a/src/hud.h +++ b/src/hud.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 HUD_HEADER -#define HUD_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include @@ -197,5 +196,3 @@ void drawItemStack(video::IVideoDriver *driver, ItemRotationKind rotation_kind); #endif - -#endif diff --git a/src/imagefilters.h b/src/imagefilters.h index 28787027f..5676faf85 100644 --- a/src/imagefilters.h +++ b/src/imagefilters.h @@ -16,8 +16,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef _IMAGE_FILTERS_H_ -#define _IMAGE_FILTERS_H_ +#pragma once #include "irrlichttypes_extrabloated.h" @@ -42,5 +41,3 @@ void imageCleanTransparent(video::IImage *src, u32 threshold); * and downscaling. */ void imageScaleNNAA(video::IImage *src, const core::rect &srcrect, video::IImage *dest); - -#endif diff --git a/src/intlGUIEditBox.h b/src/intlGUIEditBox.h index e3fc2755b..941d83c1c 100644 --- a/src/intlGUIEditBox.h +++ b/src/intlGUIEditBox.h @@ -2,8 +2,7 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#ifndef __C_INTL_GUI_EDIT_BOX_H_INCLUDED__ -#define __C_INTL_GUI_EDIT_BOX_H_INCLUDED__ +#pragma once #include "IrrCompileConfig.h" //#ifdef _IRR_COMPILE_WITH_GUI_ @@ -182,4 +181,3 @@ namespace gui } // end namespace irr //#endif // _IRR_COMPILE_WITH_GUI_ -#endif // __C_GUI_EDIT_BOX_H_INCLUDED__ diff --git a/src/inventory.h b/src/inventory.h index 2f8757f1c..c11264213 100644 --- a/src/inventory.h +++ b/src/inventory.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 INVENTORY_HEADER -#define INVENTORY_HEADER +#pragma once #include "debug.h" #include "itemdef.h" @@ -310,5 +309,3 @@ private: IItemDefManager *m_itemdef; bool m_dirty = false; }; - -#endif diff --git a/src/inventorymanager.h b/src/inventorymanager.h index 916b3ea31..53830d5c1 100644 --- a/src/inventorymanager.h +++ b/src/inventorymanager.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 INVENTORYMANAGER_HEADER -#define INVENTORYMANAGER_HEADER +#pragma once #include "inventory.h" #include @@ -244,6 +243,3 @@ struct ICraftAction : public InventoryAction bool getCraftingResult(Inventory *inv, ItemStack &result, std::vector &output_replacements, bool decrementInput, IGameDef *gamedef); - -#endif - diff --git a/src/irr_aabb3d.h b/src/irr_aabb3d.h index 4c6b3f5e6..73bb2db7a 100644 --- a/src/irr_aabb3d.h +++ b/src/irr_aabb3d.h @@ -17,13 +17,10 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef IRR_AABB3D_HEADER -#define IRR_AABB3D_HEADER +#pragma once #include "irrlichttypes.h" #include typedef core::aabbox3d aabb3f; - -#endif diff --git a/src/irr_v2d.h b/src/irr_v2d.h index 617491cf0..a9065766b 100644 --- a/src/irr_v2d.h +++ b/src/irr_v2d.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 IRR_V2D_HEADER -#define IRR_V2D_HEADER +#pragma once #include "irrlichttypes.h" @@ -29,5 +28,3 @@ typedef core::vector2d v2s16; typedef core::vector2d v2s32; typedef core::vector2d v2u32; typedef core::vector2d v2f32; - -#endif diff --git a/src/irr_v3d.h b/src/irr_v3d.h index fa6af3661..21438d635 100644 --- a/src/irr_v3d.h +++ b/src/irr_v3d.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 IRR_V3D_HEADER -#define IRR_V3D_HEADER +#pragma once #include "irrlichttypes.h" @@ -28,5 +27,3 @@ typedef core::vector3df v3f; typedef core::vector3d v3s16; typedef core::vector3d v3u16; typedef core::vector3d v3s32; - -#endif diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h index 7ce898369..43fc69287 100644 --- a/src/irrlicht_changes/CGUITTFont.h +++ b/src/irrlicht_changes/CGUITTFont.h @@ -29,8 +29,7 @@ john@suckerfreegames.com */ -#ifndef __C_GUI_TTFONT_H_INCLUDED__ -#define __C_GUI_TTFONT_H_INCLUDED__ +#pragma once #include #include @@ -390,5 +389,3 @@ namespace gui } // end namespace gui } // end namespace irr - -#endif // __C_GUI_TTFONT_H_INCLUDED__ diff --git a/src/irrlicht_changes/irrUString.h b/src/irrlicht_changes/irrUString.h index 2472eda4d..aead68bab 100644 --- a/src/irrlicht_changes/irrUString.h +++ b/src/irrlicht_changes/irrUString.h @@ -28,8 +28,7 @@ john@suckerfreegames.com */ -#ifndef __IRR_USTRING_H_INCLUDED__ -#define __IRR_USTRING_H_INCLUDED__ +#pragma once #if (__cplusplus > 199711L) || (_MSC_VER >= 1600) || defined(__GXX_EXPERIMENTAL_CXX0X__) # define USTRING_CPP0X @@ -3890,5 +3889,3 @@ class hash : public std::unary_function } // end namespace core } // end namespace irr - -#endif diff --git a/src/irrlicht_changes/static_text.h b/src/irrlicht_changes/static_text.h index 408a12784..de7b47e76 100644 --- a/src/irrlicht_changes/static_text.h +++ b/src/irrlicht_changes/static_text.h @@ -4,8 +4,7 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#ifndef __C_GUI_STATIC_TEXT_H_INCLUDED__ -#define __C_GUI_STATIC_TEXT_H_INCLUDED__ +#pragma once #include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_GUI_ @@ -264,5 +263,3 @@ inline void setStaticText(irr::gui::IGUIStaticText *static_text, const wchar_t * } #endif // _IRR_COMPILE_WITH_GUI_ - -#endif // C_GUI_STATIC_TEXT_H_INCLUDED diff --git a/src/irrlichttypes.h b/src/irrlichttypes.h index 33bfa9ee9..5e03a7fd8 100644 --- a/src/irrlichttypes.h +++ b/src/irrlichttypes.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 IRRLICHTTYPES_HEADER -#define IRRLICHTTYPES_HEADER +#pragma once /* Ensure that is included before , unless building on * MSVC, to address an irrlicht issue: https://sourceforge.net/p/irrlicht/bugs/433/ @@ -62,5 +61,3 @@ using namespace irr; #define U16_MAX 0xFFFF #define U32_MAX 0xFFFFFFFF #define U64_MAX 0xFFFFFFFFFFFFFFFF - -#endif diff --git a/src/irrlichttypes_bloated.h b/src/irrlichttypes_bloated.h index 2caca6fc4..a772a5cb5 100644 --- a/src/irrlichttypes_bloated.h +++ b/src/irrlichttypes_bloated.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 IRRLICHTTYPES_BLOATED_HEADER -#define IRRLICHTTYPES_BLOATED_HEADER +#pragma once #include "irrlichttypes.h" @@ -27,5 +26,3 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "irr_aabb3d.h" #include - -#endif diff --git a/src/irrlichttypes_extrabloated.h b/src/irrlichttypes_extrabloated.h index 464ee7904..83c4ca01b 100644 --- a/src/irrlichttypes_extrabloated.h +++ b/src/irrlichttypes_extrabloated.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 IRRLICHTTYPES_EXTRABLOATED_HEADER -#define IRRLICHTTYPES_EXTRABLOATED_HEADER +#pragma once #include "irrlichttypes_bloated.h" @@ -34,5 +33,3 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #endif - -#endif diff --git a/src/itemdef.h b/src/itemdef.h index 2d7ff570d..4c754f1da 100644 --- a/src/itemdef.h +++ b/src/itemdef.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef ITEMDEF_HEADER -#define ITEMDEF_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include @@ -174,5 +173,3 @@ public: }; IWritableItemDefManager* createItemDefManager(); - -#endif diff --git a/src/itemgroup.h b/src/itemgroup.h index e9d050cd1..fcf720649 100644 --- a/src/itemgroup.h +++ b/src/itemgroup.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 ITEMGROUP_HEADER -#define ITEMGROUP_HEADER +#pragma once #include #include @@ -32,5 +31,3 @@ static inline int itemgroup_get(const ItemGroupList &groups, const std::string & return 0; return i->second; } - -#endif diff --git a/src/itemstackmetadata.h b/src/itemstackmetadata.h index c56c58fd2..843ef4832 100644 --- a/src/itemstackmetadata.h +++ b/src/itemstackmetadata.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 ITEMSTACKMETADATA_HEADER -#define ITEMSTACKMETADATA_HEADER +#pragma once #include "metadata.h" @@ -31,5 +30,3 @@ public: void serialize(std::ostream &os) const; void deSerialize(std::istream &is); }; - -#endif diff --git a/src/keycode.h b/src/keycode.h index b413d0396..9352fa4c0 100644 --- a/src/keycode.h +++ b/src/keycode.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 KEYCODE_HEADER -#define KEYCODE_HEADER +#pragma once #include "irrlichttypes.h" #include "Keycodes.h" @@ -65,5 +64,3 @@ KeyPress getKeySetting(const char *settingname); void clearKeyCache(); irr::EKEY_CODE keyname_to_keycode(const char *name); - -#endif diff --git a/src/light.h b/src/light.h index 30a647581..14fd26d1d 100644 --- a/src/light.h +++ b/src/light.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 LIGHT_HEADER -#define LIGHT_HEADER +#pragma once #include "irrlichttypes.h" @@ -124,5 +123,3 @@ inline u8 blend_light(u32 daylight_factor, u8 lightday, u8 lightnight) l = LIGHT_SUN; return l; } - -#endif diff --git a/src/localplayer.h b/src/localplayer.h index 5c52a9c0e..9965897ac 100644 --- a/src/localplayer.h +++ b/src/localplayer.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 LOCALPLAYER_HEADER -#define LOCALPLAYER_HEADER +#pragma once #include "player.h" #include "environment.h" @@ -183,5 +182,3 @@ private: GenericCAO *m_cao = nullptr; Client *m_client; }; - -#endif diff --git a/src/log.h b/src/log.h index 56492ff86..d02d85a4b 100644 --- a/src/log.h +++ b/src/log.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 LOG_HEADER -#define LOG_HEADER +#pragma once #include #include @@ -212,6 +211,3 @@ extern std::ostream dstream; #define dout_client (*dout_client_ptr) #define derr_client (*derr_client_ptr) #endif - - -#endif diff --git a/src/mainmenumanager.h b/src/mainmenumanager.h index adc40f4ff..2618d3ccf 100644 --- a/src/mainmenumanager.h +++ b/src/mainmenumanager.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 MAINMENUMANAGER_HEADER -#define MAINMENUMANAGER_HEADER +#pragma once /* All kinds of stuff that needs to be exposed from main.cpp @@ -168,6 +167,3 @@ public: }; extern MainGameCallback *g_gamecallback; - -#endif - diff --git a/src/map.h b/src/map.h index c3a1c1897..4dd2b7e30 100644 --- a/src/map.h +++ b/src/map.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 MAP_HEADER -#define MAP_HEADER +#pragma once #include #include @@ -525,5 +524,3 @@ protected: */ std::map m_loaded_blocks; }; - -#endif diff --git a/src/map_settings_manager.h b/src/map_settings_manager.h index 6f41d8517..5baa38455 100644 --- a/src/map_settings_manager.h +++ b/src/map_settings_manager.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 MAP_SETTINGS_MANAGER_HEADER -#define MAP_SETTINGS_MANAGER_HEADER +#pragma once #include @@ -75,5 +74,3 @@ private: Settings *m_map_settings; Settings *m_user_settings; }; - -#endif diff --git a/src/mapblock.h b/src/mapblock.h index e331c4840..d6f99b36c 100644 --- a/src/mapblock.h +++ b/src/mapblock.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 MAPBLOCK_HEADER -#define MAPBLOCK_HEADER +#pragma once #include #include "debug.h" @@ -671,5 +670,3 @@ inline void getNodeSectorPosWithOffset(const v2s16 &p, v2s16 &block, v2s16 &offs Get a quick string to describe what a block actually contains */ std::string analyze_block(MapBlock *block); - -#endif diff --git a/src/mapblock_mesh.h b/src/mapblock_mesh.h index e2a66fbb9..b4bfedb84 100644 --- a/src/mapblock_mesh.h +++ b/src/mapblock_mesh.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 MAPBLOCK_MESH_HEADER -#define MAPBLOCK_MESH_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "client/tile.h" @@ -267,6 +266,3 @@ void final_color_blend(video::SColor *result, // TileFrame vector copy cost very much to client void getNodeTileN(MapNode mn, v3s16 p, u8 tileindex, MeshMakeData *data, TileSpec &tile); void getNodeTile(MapNode mn, v3s16 p, v3s16 dir, MeshMakeData *data, TileSpec &tile); - -#endif - diff --git a/src/mapgen.h b/src/mapgen.h index 931622d3c..8a9b8057e 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -19,8 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_HEADER -#define MAPGEN_HEADER +#pragma once #include "noise.h" #include "nodedef.h" @@ -299,5 +298,3 @@ protected: float cavern_threshold; int lava_depth; }; - -#endif diff --git a/src/mapgen_carpathian.h b/src/mapgen_carpathian.h index 0dfb6fd2c..1e9bbcd31 100644 --- a/src/mapgen_carpathian.h +++ b/src/mapgen_carpathian.h @@ -19,8 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_CARPATHIAN_HEADER -#define MAPGEN_CARPATHIAN_HEADER +#pragma once #include "mapgen.h" @@ -101,5 +100,3 @@ private: float terrainLevelAtPoint(s16 x, s16 z); int generateTerrain(); }; - -#endif \ No newline at end of file diff --git a/src/mapgen_flat.h b/src/mapgen_flat.h index 7c2929d39..d34e4d86c 100644 --- a/src/mapgen_flat.h +++ b/src/mapgen_flat.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_FLAT_HEADER -#define MAPGEN_FLAT_HEADER +#pragma once #include "mapgen.h" @@ -75,5 +74,3 @@ private: float hill_steepness; Noise *noise_terrain; }; - -#endif diff --git a/src/mapgen_fractal.h b/src/mapgen_fractal.h index b3f69cb78..a83c5b317 100644 --- a/src/mapgen_fractal.h +++ b/src/mapgen_fractal.h @@ -21,8 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_FRACTAL_HEADER -#define MAPGEN_FRACTAL_HEADER +#pragma once #include "mapgen.h" @@ -86,5 +85,3 @@ private: float julia_w; Noise *noise_seabed; }; - -#endif diff --git a/src/mapgen_singlenode.h b/src/mapgen_singlenode.h index 5171bfbca..38bc3e020 100644 --- a/src/mapgen_singlenode.h +++ b/src/mapgen_singlenode.h @@ -19,8 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_SINGLENODE_HEADER -#define MAPGEN_SINGLENODE_HEADER +#pragma once #include "mapgen.h" @@ -48,5 +47,3 @@ public: void makeChunk(BlockMakeData *data); int getSpawnLevelAtPoint(v2s16 p); }; - -#endif diff --git a/src/mapgen_v5.h b/src/mapgen_v5.h index 3aaff5878..f5afc3af1 100644 --- a/src/mapgen_v5.h +++ b/src/mapgen_v5.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_V5_HEADER -#define MAPGEN_V5_HEADER +#pragma once #include "mapgen.h" @@ -73,5 +72,3 @@ private: Noise *noise_height; Noise *noise_ground; }; - -#endif diff --git a/src/mapgen_v6.h b/src/mapgen_v6.h index 4a885e2c5..f92e90695 100644 --- a/src/mapgen_v6.h +++ b/src/mapgen_v6.h @@ -19,8 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGENV6_HEADER -#define MAPGENV6_HEADER +#pragma once #include "mapgen.h" #include "noise.h" @@ -169,5 +168,3 @@ public: void placeTreesAndJungleGrass(); virtual void generateCaves(int max_stone_y); }; - -#endif diff --git a/src/mapgen_v7.h b/src/mapgen_v7.h index aec28dfb4..f4d397135 100644 --- a/src/mapgen_v7.h +++ b/src/mapgen_v7.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_V7_HEADER -#define MAPGEN_V7_HEADER +#pragma once #include "mapgen.h" @@ -111,5 +110,3 @@ private: Noise *noise_mountain; Noise *noise_ridge; }; - -#endif diff --git a/src/mapgen_valleys.h b/src/mapgen_valleys.h index 573f598a5..1cb94860c 100644 --- a/src/mapgen_valleys.h +++ b/src/mapgen_valleys.h @@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MAPGEN_VALLEYS_HEADER -#define MAPGEN_VALLEYS_HEADER +#pragma once #include "mapgen.h" @@ -133,5 +132,3 @@ private: virtual void generateCaves(s16 max_stone_y, s16 large_cave_depth); }; - -#endif diff --git a/src/mapnode.h b/src/mapnode.h index 9c56a7e17..200a51207 100644 --- a/src/mapnode.h +++ b/src/mapnode.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 MAPNODE_HEADER -#define MAPNODE_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include "light.h" @@ -304,6 +303,3 @@ private: // Deprecated serialization methods void deSerialize_pre22(u8 *source, u8 version); }; - -#endif - diff --git a/src/mapsector.h b/src/mapsector.h index 9a965932f..ff1ca7be6 100644 --- a/src/mapsector.h +++ b/src/mapsector.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 MAPSECTOR_HEADER -#define MAPSECTOR_HEADER +#pragma once #include "irrlichttypes.h" #include "irr_v2d.h" @@ -135,6 +134,3 @@ public: private: }; #endif - -#endif - diff --git a/src/mesh.h b/src/mesh.h index 423e43aee..35270a999 100644 --- a/src/mesh.h +++ b/src/mesh.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 MESH_HEADER -#define MESH_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "nodedef.h" @@ -90,14 +89,14 @@ void rotateMeshBy6dFacedir(scene::IMesh *mesh, int facedir); */ void rotateMeshXYby (scene::IMesh *mesh, f64 degrees); void rotateMeshXZby (scene::IMesh *mesh, f64 degrees); -void rotateMeshYZby (scene::IMesh *mesh, f64 degrees); +void rotateMeshYZby (scene::IMesh *mesh, f64 degrees); /* * Clone the mesh buffer. * The returned pointer should be dropped. */ scene::IMeshBuffer* cloneMeshBuffer(scene::IMeshBuffer *mesh_buffer); - + /* Clone the mesh. */ @@ -123,5 +122,3 @@ void recalculateBoundingBox(scene::IMesh *src_mesh); Ported from irrlicht 1.8 */ scene::IMesh* createForsythOptimizedMesh(const scene::IMesh *mesh); - -#endif diff --git a/src/mesh_generator_thread.h b/src/mesh_generator_thread.h index 051a0dc88..7df9a4e26 100644 --- a/src/mesh_generator_thread.h +++ b/src/mesh_generator_thread.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 MESH_GENERATOR_THREAD_HEADER -#define MESH_GENERATOR_THREAD_HEADER +#pragma once #include #include @@ -130,5 +129,3 @@ private: protected: virtual void doUpdate(); }; - -#endif diff --git a/src/metadata.h b/src/metadata.h index a8270b4c4..f923e6ff0 100644 --- a/src/metadata.h +++ b/src/metadata.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 METADATA_HEADER -#define METADATA_HEADER +#pragma once #include "irr_v3d.h" #include @@ -57,5 +56,3 @@ protected: StringMap m_stringvars; }; - -#endif diff --git a/src/mg_biome.h b/src/mg_biome.h index 854ada504..e64f36b13 100644 --- a/src/mg_biome.h +++ b/src/mg_biome.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MG_BIOME_HEADER -#define MG_BIOME_HEADER +#pragma once #include "objdef.h" #include "nodedef.h" @@ -228,6 +227,3 @@ private: Server *m_server; }; - - -#endif diff --git a/src/mg_decoration.h b/src/mg_decoration.h index a7fdb97fe..8feaa9850 100644 --- a/src/mg_decoration.h +++ b/src/mg_decoration.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MG_DECORATION_HEADER -#define MG_DECORATION_HEADER +#pragma once #include #include "objdef.h" @@ -149,5 +148,3 @@ public: size_t placeAllDecos(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax, s16 deco_zero_level = 0); }; - -#endif diff --git a/src/mg_ore.h b/src/mg_ore.h index 692cd848e..dea1d4272 100644 --- a/src/mg_ore.h +++ b/src/mg_ore.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MG_ORE_HEADER -#define MG_ORE_HEADER +#pragma once #include #include "objdef.h" @@ -167,5 +166,3 @@ public: size_t placeAllOres(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax, s16 ore_zero_level = 0); }; - -#endif diff --git a/src/mg_schematic.h b/src/mg_schematic.h index 16e967a7c..fc6488c4d 100644 --- a/src/mg_schematic.h +++ b/src/mg_schematic.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MG_SCHEMATIC_HEADER -#define MG_SCHEMATIC_HEADER +#pragma once #include #include "mg_decoration.h" @@ -146,5 +145,3 @@ private: void generate_nodelist_and_update_ids(MapNode *nodes, size_t nodecount, std::vector *usednodes, INodeDefManager *ndef); - -#endif diff --git a/src/minimap.h b/src/minimap.h index f087dbfab..63a0541ab 100644 --- a/src/minimap.h +++ b/src/minimap.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 MINIMAP_HEADER -#define MINIMAP_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #include "util/thread.h" @@ -162,5 +161,3 @@ private: std::mutex m_mutex; std::list m_active_markers; }; - -#endif diff --git a/src/modalMenu.h b/src/modalMenu.h index 7dbf36fbc..eeffc6195 100644 --- a/src/modalMenu.h +++ b/src/modalMenu.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 MODALMENU_HEADER -#define MODALMENU_HEADER +#pragma once #include "irrlichttypes_extrabloated.h" #ifdef HAVE_TOUCHSCREENGUI @@ -140,7 +139,3 @@ private: // wants to launch other menus bool m_allow_focus_removal = false; }; - - -#endif - diff --git a/src/modifiedstate.h b/src/modifiedstate.h index 576c3c576..3eeb55d02 100644 --- a/src/modifiedstate.h +++ b/src/modifiedstate.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 MODIFIEDSTATE_HEADER -#define MODIFIEDSTATE_HEADER +#pragma once enum ModifiedState { @@ -32,5 +31,3 @@ enum ModifiedState MOD_STATE_WRITE_NEEDED = 4, MOD_RESERVED5 = 5, }; - -#endif diff --git a/src/mods.h b/src/mods.h index 697fed38b..63927a9d0 100644 --- a/src/mods.h +++ b/src/mods.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 MODS_HEADER -#define MODS_HEADER +#pragma once #include "irrlichttypes.h" #include @@ -171,5 +170,3 @@ private: std::string m_mod_name; bool m_modified = false; }; - -#endif diff --git a/src/nameidmapping.h b/src/nameidmapping.h index 90aadcf6d..3acb43ef1 100644 --- a/src/nameidmapping.h +++ b/src/nameidmapping.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 NAMEIDMAPPING_HEADER -#define NAMEIDMAPPING_HEADER +#pragma once #include #include @@ -90,5 +89,3 @@ private: IdToNameMap m_id_to_name; NameToIdMap m_name_to_id; }; - -#endif diff --git a/src/network/clientopcodes.h b/src/network/clientopcodes.h index 789c9c0bb..57846f095 100644 --- a/src/network/clientopcodes.h +++ b/src/network/clientopcodes.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef CLIENTOPCODES_HEADER -#define CLIENTOPCODES_HEADER +#pragma once #include "client.h" #include "networkprotocol.h" @@ -49,5 +48,3 @@ struct ServerCommandFactory extern const ToClientCommandHandler toClientCommandTable[TOCLIENT_NUM_MSG_TYPES]; extern const ServerCommandFactory serverCommandFactoryTable[TOSERVER_NUM_MSG_TYPES]; - -#endif diff --git a/src/network/connection.h b/src/network/connection.h index 3dc87b489..bf192870b 100644 --- a/src/network/connection.h +++ b/src/network/connection.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 CONNECTION_HEADER -#define CONNECTION_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include "socket.h" @@ -1068,5 +1067,3 @@ private: }; } // namespace - -#endif diff --git a/src/network/networkpacket.h b/src/network/networkpacket.h index 40a20eb2e..9d9aeb797 100644 --- a/src/network/networkpacket.h +++ b/src/network/networkpacket.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 NETWORKPACKET_HEADER -#define NETWORKPACKET_HEADER +#pragma once #include #include "util/pointer.h" @@ -133,5 +132,3 @@ private: u16 m_command = 0; u16 m_peer_id = 0; }; - -#endif diff --git a/src/network/serveropcodes.h b/src/network/serveropcodes.h index 296b7d471..6df09d5ef 100644 --- a/src/network/serveropcodes.h +++ b/src/network/serveropcodes.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SERVEROPCODES_HEADER -#define SERVEROPCODES_HEADER +#pragma once #include "server.h" #include "networkprotocol.h" @@ -49,5 +48,3 @@ struct ClientCommandFactory extern const ToServerCommandHandler toServerCommandTable[TOSERVER_NUM_MSG_TYPES]; extern const ClientCommandFactory clientCommandFactoryTable[TOCLIENT_NUM_MSG_TYPES]; - -#endif diff --git a/src/nodedef.h b/src/nodedef.h index 6ae729409..aeee81988 100644 --- a/src/nodedef.h +++ b/src/nodedef.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 NODEDEF_HEADER -#define NODEDEF_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include @@ -517,5 +516,3 @@ public: INodeDefManager *m_ndef = nullptr; bool m_resolve_done = false; }; - -#endif diff --git a/src/nodemetadata.h b/src/nodemetadata.h index 4b4cb17c7..40f6dec65 100644 --- a/src/nodemetadata.h +++ b/src/nodemetadata.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 NODEMETADATA_HEADER -#define NODEMETADATA_HEADER +#pragma once #include #include "metadata.h" @@ -95,5 +94,3 @@ private: std::map m_data; }; - -#endif diff --git a/src/nodetimer.h b/src/nodetimer.h index e6a8d7608..36eabafda 100644 --- a/src/nodetimer.h +++ b/src/nodetimer.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 NODETIMER_HEADER -#define NODETIMER_HEADER +#pragma once #include "irr_v3d.h" #include @@ -131,6 +130,3 @@ private: double m_next_trigger_time = -1.0; double m_time = 0.0; }; - -#endif - diff --git a/src/noise.h b/src/noise.h index 53cab5754..ae97b8740 100644 --- a/src/noise.h +++ b/src/noise.h @@ -23,8 +23,7 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef NOISE_HEADER -#define NOISE_HEADER +#pragma once #include "irr_v3d.h" #include "exceptions.h" @@ -232,6 +231,3 @@ inline float easeCurve(float t) } float contour(float v); - -#endif - diff --git a/src/objdef.h b/src/objdef.h index 1b96fa52a..04f067975 100644 --- a/src/objdef.h +++ b/src/objdef.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 OBJDEF_HEADER -#define OBJDEF_HEADER +#pragma once #include "util/basic_macros.h" #include "porting.h" @@ -93,5 +92,3 @@ protected: std::vector m_objects; ObjDefType m_objtype; }; - -#endif diff --git a/src/object_properties.h b/src/object_properties.h index 772807fd9..116921f7d 100644 --- a/src/object_properties.h +++ b/src/object_properties.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 OBJECT_PROPERTIES_HEADER -#define OBJECT_PROPERTIES_HEADER +#pragma once #include #include "irrlichttypes_bloated.h" @@ -60,5 +59,3 @@ struct ObjectProperties void serialize(std::ostream &os) const; void deSerialize(std::istream &is); }; - -#endif diff --git a/src/particles.h b/src/particles.h index 13e73e861..b3c02f4c4 100644 --- a/src/particles.h +++ b/src/particles.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 PARTICLES_HEADER -#define PARTICLES_HEADER +#pragma once #include #include "irrlichttypes_extrabloated.h" @@ -210,5 +209,3 @@ private: std::mutex m_particle_list_lock; std::mutex m_spawner_list_lock; }; - -#endif diff --git a/src/pathfinder.h b/src/pathfinder.h index ba95aaf1c..70f3d6bbc 100644 --- a/src/pathfinder.h +++ b/src/pathfinder.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 PATHFINDER_H_ -#define PATHFINDER_H_ +#pragma once /******************************************************************************/ /* Includes */ @@ -62,5 +61,3 @@ std::vector get_path(ServerEnvironment *env, unsigned int max_jump, unsigned int max_drop, PathAlgorithm algo); - -#endif /* PATHFINDER_H_ */ diff --git a/src/player.h b/src/player.h index 1d9882775..596f04cfa 100644 --- a/src/player.h +++ b/src/player.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 PLAYER_HEADER -#define PLAYER_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include "inventory.h" @@ -174,6 +173,3 @@ private: // and ServerThread std::mutex m_mutex; }; - -#endif - diff --git a/src/porting.h b/src/porting.h index 216553141..4e663390a 100644 --- a/src/porting.h +++ b/src/porting.h @@ -21,8 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Random portability stuff */ -#ifndef PORTING_HEADER -#define PORTING_HEADER +#pragma once #ifdef _WIN32 #ifdef _WIN32_WINNT @@ -332,6 +331,3 @@ void attachOrCreateConsole(void); #ifdef __ANDROID__ #include "porting_android.h" #endif - -#endif // PORTING_HEADER - diff --git a/src/porting_android.h b/src/porting_android.h index e4be0740d..7bdb226aa 100644 --- a/src/porting_android.h +++ b/src/porting_android.h @@ -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 __PORTING_ANDROID_H__ -#define __PORTING_ANDROID_H__ + +#pragma once #ifndef __ANDROID__ #error this include has to be included on android port only! @@ -77,5 +77,3 @@ int getInputDialogState(); std::string getInputDialogValue(); } - -#endif diff --git a/src/profiler.h b/src/profiler.h index cade887e8..fade4c924 100644 --- a/src/profiler.h +++ b/src/profiler.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 PROFILER_HEADER -#define PROFILER_HEADER +#pragma once #include "irrlichttypes.h" #include @@ -198,6 +197,3 @@ private: TimeTaker *m_timer = nullptr; enum ScopeProfilerType m_type; }; - -#endif - diff --git a/src/quicktune.h b/src/quicktune.h index 566fbfc4d..1659e09f1 100644 --- a/src/quicktune.h +++ b/src/quicktune.h @@ -23,7 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., Eg. if you have this constant somewhere that you just can't get right by changing it and recompiling all over again: v3f wield_position = v3f(55, -35, 65); - + Make it look like this: v3f wield_position = v3f(55, -35, 65); QUICKTUNE_AUTONAME(QVT_FLOAT, wield_position.X, 0, 100); @@ -35,19 +35,18 @@ with this program; if not, write to the Free Software Foundation, Inc., keymap_quicktune_next keymap_quicktune_dec keymap_quicktune_inc - + Once you have modified the values at runtime and then quit, the game will print out all the modified values at the end: Modified quicktune values: wield_position.X = 60 wield_position.Y = -30 wield_position.Z = 65 - + The QUICKTUNE macros shouldn't generally be left in committed code. */ -#ifndef QUICKTUNE_HEADER -#define QUICKTUNE_HEADER +#pragma once #include #include @@ -99,6 +98,3 @@ void updateQuicktuneValue(const std::string &name, QuicktuneValue &val); #define QUICKTUNE_AUTONAME(type_, var, min_, max_)\ QUICKTUNE(type_, var, min_, max_, #var) - -#endif - diff --git a/src/quicktune_shortcutter.h b/src/quicktune_shortcutter.h index fe1463c93..c8a449533 100644 --- a/src/quicktune_shortcutter.h +++ b/src/quicktune_shortcutter.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 QVT_SHORTCUTTER_HEADER -#define QVT_SHORTCUTTER_HEADER +#pragma once #include "quicktune.h" @@ -83,6 +82,3 @@ public: setQuicktuneValue(getSelectedName(), val); } }; - -#endif - diff --git a/src/raycast.h b/src/raycast.h index d69d9339b..734efd6ad 100644 --- a/src/raycast.h +++ b/src/raycast.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 SRC_RAYCAST_H_ -#define SRC_RAYCAST_H_ +#pragma once #include "voxelalgorithms.h" #include "util/pointedthing.h" @@ -76,6 +75,3 @@ public: */ bool boxLineCollision(const aabb3f &box, const v3f &start, const v3f &dir, v3f *collision_point, v3s16 *collision_normal); - - -#endif /* SRC_RAYCAST_H_ */ diff --git a/src/reflowscan.h b/src/reflowscan.h index 5b1ef9b5d..e8f70f790 100644 --- a/src/reflowscan.h +++ b/src/reflowscan.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 REFLOWSCAN_H -#define REFLOWSCAN_H +#pragma once #include "util/container.h" #include "irrlichttypes_bloated.h" @@ -46,5 +45,3 @@ private: MapBlock *m_lookup[3 * 3 * 3]; u32 m_lookup_state_bitset; }; - -#endif // REFLOWSCAN_H diff --git a/src/remoteplayer.h b/src/remoteplayer.h index 965dede50..32c78b5ac 100644 --- a/src/remoteplayer.h +++ b/src/remoteplayer.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef REMOTEPLAYER_HEADER -#define REMOTEPLAYER_HEADER +#pragma once #include "player.h" #include "cloudparams.h" @@ -168,5 +167,3 @@ private: CloudParams m_cloud_params; }; - -#endif diff --git a/src/rollback.h b/src/rollback.h index e0b3c7c55..1d9949d15 100644 --- a/src/rollback.h +++ b/src/rollback.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 ROLLBACK_HEADER -#define ROLLBACK_HEADER +#pragma once #include #include "irr_v3d.h" @@ -103,5 +102,3 @@ private: std::vector knownActors; std::vector knownNodes; }; - -#endif diff --git a/src/rollback_interface.h b/src/rollback_interface.h index a5f0c34fc..4b0ad0164 100644 --- a/src/rollback_interface.h +++ b/src/rollback_interface.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 ROLLBACK_INTERFACE_HEADER -#define ROLLBACK_INTERFACE_HEADER +#pragma once #include "irr_v3d.h" #include @@ -159,5 +158,3 @@ private: std::string old_actor; bool old_actor_guess; }; - -#endif diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index 9b8796297..c4440c5d9 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -25,8 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /******************************************************************************/ /******************************************************************************/ -#ifndef C_CONTENT_H_ -#define C_CONTENT_H_ +#pragma once extern "C" { #include @@ -187,5 +186,3 @@ void push_pointed_thing (lua_State *L, const PointedThing & void push_objectRef (lua_State *L, const u16 id); extern struct EnumString es_TileAnimationType[]; - -#endif /* C_CONTENT_H_ */ diff --git a/src/script/common/c_converter.h b/src/script/common/c_converter.h index f7d9294d6..bba01f545 100644 --- a/src/script/common/c_converter.h +++ b/src/script/common/c_converter.h @@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /* not being a script/modapi file!!!!!!!! */ /******************************************************************************/ /******************************************************************************/ -#ifndef C_CONVERTER_H_ -#define C_CONVERTER_H_ +#pragma once #include #include @@ -117,5 +116,3 @@ size_t write_array_slice_float(lua_State *L, int table_index, float *data, v3u16 data_size, v3u16 slice_offset, v3u16 slice_size); size_t write_array_slice_u16(lua_State *L, int table_index, u16 *data, v3u16 data_size, v3u16 slice_offset, v3u16 slice_size); - -#endif /* C_CONVERTER_H_ */ diff --git a/src/script/common/c_internal.h b/src/script/common/c_internal.h index b77f0a7c3..2548ac979 100644 --- a/src/script/common/c_internal.h +++ b/src/script/common/c_internal.h @@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /******************************************************************************/ /******************************************************************************/ -#ifndef C_INTERNAL_H_ -#define C_INTERNAL_H_ +#pragma once extern "C" { #include @@ -106,5 +105,3 @@ void script_error(lua_State *L, int pcall_result, const char *mod, const char *f void script_run_callbacks_f(lua_State *L, int nargs, RunCallbacksMode mode, const char *fxn); void log_deprecated(lua_State *L, const std::string &message); - -#endif /* C_INTERNAL_H_ */ diff --git a/src/script/common/c_types.h b/src/script/common/c_types.h index 056f30251..86bfb0b6b 100644 --- a/src/script/common/c_types.h +++ b/src/script/common/c_types.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 C_TYPES_H_ -#define C_TYPES_H_ +#pragma once extern "C" { #include "lua.h" @@ -60,5 +59,3 @@ public: extern EnumString es_ItemType[]; - -#endif /* C_TYPES_H_ */ diff --git a/src/script/cpp_api/s_async.h b/src/script/cpp_api/s_async.h index aa1559ed1..01c3ad005 100644 --- a/src/script/cpp_api/s_async.h +++ b/src/script/cpp_api/s_async.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 CPP_API_ASYNC_EVENTS_HEADER -#define CPP_API_ASYNC_EVENTS_HEADER +#pragma once #include #include @@ -156,5 +155,3 @@ private: // Counter semaphore for job dispatching Semaphore jobQueueCounter; }; - -#endif // CPP_API_ASYNC_EVENTS_HEADER diff --git a/src/script/cpp_api/s_base.h b/src/script/cpp_api/s_base.h index ff92bdf93..b2c8b4a18 100644 --- a/src/script/cpp_api/s_base.h +++ b/src/script/cpp_api/s_base.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 S_BASE_H_ -#define S_BASE_H_ +#pragma once #include #include @@ -147,5 +146,3 @@ private: GUIEngine *m_guiengine = nullptr; ScriptingType m_type; }; - -#endif /* S_BASE_H_ */ diff --git a/src/script/cpp_api/s_client.h b/src/script/cpp_api/s_client.h index 9133637a6..074a68e39 100644 --- a/src/script/cpp_api/s_client.h +++ b/src/script/cpp_api/s_client.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef S_CLIENT_H_ -#define S_CLIENT_H_ +#pragma once #include "util/pointedthing.h" #include "cpp_api/s_base.h" @@ -60,4 +59,3 @@ public: void setEnv(ClientEnvironment *env); }; -#endif diff --git a/src/script/cpp_api/s_entity.h b/src/script/cpp_api/s_entity.h index 07b06edff..173e24c30 100644 --- a/src/script/cpp_api/s_entity.h +++ b/src/script/cpp_api/s_entity.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 S_ENTITY_H_ -#define S_ENTITY_H_ +#pragma once #include "cpp_api/s_base.h" #include "irr_v3d.h" @@ -45,7 +44,3 @@ public: void luaentity_Rightclick(u16 id, ServerActiveObject *clicker); }; - - - -#endif /* S_ENTITY_H_ */ diff --git a/src/script/cpp_api/s_env.h b/src/script/cpp_api/s_env.h index e07024565..232a08aaf 100644 --- a/src/script/cpp_api/s_env.h +++ b/src/script/cpp_api/s_env.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 S_ENV_H_ -#define S_ENV_H_ +#pragma once #include "cpp_api/s_base.h" #include "irr_v3d.h" @@ -44,5 +43,3 @@ public: void initializeEnvironment(ServerEnvironment *env); }; - -#endif /* S_ENV_H_ */ diff --git a/src/script/cpp_api/s_internal.h b/src/script/cpp_api/s_internal.h index b493cb6fa..fc049f922 100644 --- a/src/script/cpp_api/s_internal.h +++ b/src/script/cpp_api/s_internal.h @@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /******************************************************************************/ /******************************************************************************/ -#ifndef S_INTERNAL_H_ -#define S_INTERNAL_H_ +#pragma once #include #include "common/c_internal.h" @@ -84,6 +83,3 @@ private: lua_State *L = getStack(); \ assert(lua_checkstack(L, 20)); \ StackUnroller stack_unroller(L); - -#endif /* S_INTERNAL_H_ */ - diff --git a/src/script/cpp_api/s_inventory.h b/src/script/cpp_api/s_inventory.h index d1a81de80..93ec7fd42 100644 --- a/src/script/cpp_api/s_inventory.h +++ b/src/script/cpp_api/s_inventory.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 S_INVENTORY_H_ -#define S_INVENTORY_H_ +#pragma once #include "cpp_api/s_base.h" @@ -65,7 +64,3 @@ private: bool getDetachedInventoryCallback( const std::string &name, const char *callbackname); }; - - - -#endif /* S_INVENTORY_H_ */ diff --git a/src/script/cpp_api/s_item.h b/src/script/cpp_api/s_item.h index 6ceb4b559..561f3a553 100644 --- a/src/script/cpp_api/s_item.h +++ b/src/script/cpp_api/s_item.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 S_ITEM_H_ -#define S_ITEM_H_ +#pragma once #include "cpp_api/s_base.h" #include "irr_v3d.h" @@ -58,6 +57,3 @@ protected: void pushPointedThing(const PointedThing& pointed); }; - - -#endif /* S_ITEM_H_ */ diff --git a/src/script/cpp_api/s_mainmenu.h b/src/script/cpp_api/s_mainmenu.h index 8d5895817..f89d5d889 100644 --- a/src/script/cpp_api/s_mainmenu.h +++ b/src/script/cpp_api/s_mainmenu.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 S_MAINMENU_H_ -#define S_MAINMENU_H_ +#pragma once #include "cpp_api/s_base.h" #include "util/string.h" @@ -44,5 +43,3 @@ public: */ void handleMainMenuButtons(const StringMap &fields); }; - -#endif /* S_MAINMENU_H_ */ diff --git a/src/script/cpp_api/s_node.h b/src/script/cpp_api/s_node.h index eb127909d..92f07cee7 100644 --- a/src/script/cpp_api/s_node.h +++ b/src/script/cpp_api/s_node.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 S_NODE_H_ -#define S_NODE_H_ +#pragma once #include "irr_v3d.h" #include "cpp_api/s_base.h" @@ -58,7 +57,3 @@ public: static struct EnumString es_LiquidType[]; static struct EnumString es_NodeBoxType[]; }; - - - -#endif /* S_NODE_H_ */ diff --git a/src/script/cpp_api/s_nodemeta.h b/src/script/cpp_api/s_nodemeta.h index c2ebeba6d..51b8a5eb2 100644 --- a/src/script/cpp_api/s_nodemeta.h +++ b/src/script/cpp_api/s_nodemeta.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 S_NODEMETA_H_ -#define S_NODEMETA_H_ +#pragma once #include "cpp_api/s_base.h" #include "cpp_api/s_item.h" @@ -63,5 +62,3 @@ public: private: }; - -#endif /* S_NODEMETA_H_ */ diff --git a/src/script/cpp_api/s_player.h b/src/script/cpp_api/s_player.h index 9b4611f9e..70b06bfc7 100644 --- a/src/script/cpp_api/s_player.h +++ b/src/script/cpp_api/s_player.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 S_PLAYER_H_ -#define S_PLAYER_H_ +#pragma once #include "cpp_api/s_base.h" #include "irr_v3d.h" @@ -46,5 +45,3 @@ public: void on_playerReceiveFields(ServerActiveObject *player, const std::string &formname, const StringMap &fields); }; - -#endif /* S_PLAYER_H_ */ diff --git a/src/script/cpp_api/s_security.h b/src/script/cpp_api/s_security.h index 059dccef1..c31aff26b 100644 --- a/src/script/cpp_api/s_security.h +++ b/src/script/cpp_api/s_security.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 S_SECURITY_H -#define S_SECURITY_H +#pragma once #include "cpp_api/s_base.h" @@ -75,6 +74,3 @@ private: static int sl_os_rename(lua_State *L); static int sl_os_remove(lua_State *L); }; - -#endif - diff --git a/src/script/cpp_api/s_server.h b/src/script/cpp_api/s_server.h index a63e36320..74de19bee 100644 --- a/src/script/cpp_api/s_server.h +++ b/src/script/cpp_api/s_server.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 S_SERVER_H_ -#define S_SERVER_H_ +#pragma once #include "cpp_api/s_base.h" #include @@ -46,7 +45,3 @@ private: void getAuthHandler(); void readPrivileges(int index, std::set &result); }; - - - -#endif /* S_SERVER_H_ */ diff --git a/src/script/lua_api/l_areastore.h b/src/script/lua_api/l_areastore.h index 9cb6249d0..56acd9083 100644 --- a/src/script/lua_api/l_areastore.h +++ b/src/script/lua_api/l_areastore.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 L_AREA_STORE_H_ -#define L_AREA_STORE_H_ +#pragma once #include "lua_api/l_base.h" @@ -63,5 +62,3 @@ public: static void Register(lua_State *L); }; - -#endif // L_AREA_STORE_H_ diff --git a/src/script/lua_api/l_base.h b/src/script/lua_api/l_base.h index e9b28b36a..0a75b4c1a 100644 --- a/src/script/lua_api/l_base.h +++ b/src/script/lua_api/l_base.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 L_BASE_H_ -#define L_BASE_H_ +#pragma once #include "common/c_types.h" #include "common/c_internal.h" @@ -71,5 +70,3 @@ public: lua_CFunction func, int top); }; - -#endif /* L_BASE_H_ */ diff --git a/src/script/lua_api/l_camera.h b/src/script/lua_api/l_camera.h index c4a0f877c..a7103c9b0 100644 --- a/src/script/lua_api/l_camera.h +++ b/src/script/lua_api/l_camera.h @@ -1,5 +1,23 @@ -#ifndef L_CAMERA_H -#define L_CAMERA_H +/* +Minetest +Copyright (C) 2013-2017 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +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. +*/ + +#pragma once #include "l_base.h" @@ -40,5 +58,3 @@ public: static void Register(lua_State *L); }; - -#endif // L_CAMERA_H diff --git a/src/script/lua_api/l_client.h b/src/script/lua_api/l_client.h index 8a3c7f0e8..791038f7d 100644 --- a/src/script/lua_api/l_client.h +++ b/src/script/lua_api/l_client.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef L_CLIENT_H_ -#define L_CLIENT_H_ +#pragma once #include "lua_api/l_base.h" #include "itemdef.h" @@ -98,5 +97,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif diff --git a/src/script/lua_api/l_craft.h b/src/script/lua_api/l_craft.h index eb2bce706..9002b23ef 100644 --- a/src/script/lua_api/l_craft.h +++ b/src/script/lua_api/l_craft.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 L_CRAFT_H_ -#define L_CRAFT_H_ +#pragma once #include #include @@ -47,5 +46,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif /* L_CRAFT_H_ */ diff --git a/src/script/lua_api/l_env.h b/src/script/lua_api/l_env.h index f380d8d6f..4d295b6eb 100644 --- a/src/script/lua_api/l_env.h +++ b/src/script/lua_api/l_env.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 L_ENV_H_ -#define L_ENV_H_ +#pragma once #include "lua_api/l_base.h" #include "serverenvironment.h" @@ -297,5 +296,3 @@ struct ScriptCallbackState { unsigned int refcount; std::string origin; }; - -#endif /* L_ENV_H_ */ diff --git a/src/script/lua_api/l_http.h b/src/script/lua_api/l_http.h index 077ade691..3d9cdad29 100644 --- a/src/script/lua_api/l_http.h +++ b/src/script/lua_api/l_http.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 L_HTTP_H_ -#define L_HTTP_H_ +#pragma once #include "lua_api/l_base.h" #include "config.h" @@ -46,5 +45,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif /* L_HTTP_H_ */ diff --git a/src/script/lua_api/l_internal.h b/src/script/lua_api/l_internal.h index e9b689931..bbedfe46e 100644 --- a/src/script/lua_api/l_internal.h +++ b/src/script/lua_api/l_internal.h @@ -24,8 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., /******************************************************************************/ /******************************************************************************/ -#ifndef L_INTERNAL_H_ -#define L_INTERNAL_H_ +#pragma once #include "common/c_internal.h" @@ -44,5 +43,3 @@ with this program; if not, write to the Free Software Foundation, Inc., #define GET_ENV_PTR \ MAP_LOCK_REQUIRED; \ GET_ENV_PTR_NO_MAP_LOCK - -#endif /* L_INTERNAL_H_ */ diff --git a/src/script/lua_api/l_inventory.h b/src/script/lua_api/l_inventory.h index 502827a11..f12377ece 100644 --- a/src/script/lua_api/l_inventory.h +++ b/src/script/lua_api/l_inventory.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 L_INVENTORY_H_ -#define L_INVENTORY_H_ +#pragma once #include "lua_api/l_base.h" @@ -126,5 +125,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif /* L_INVENTORY_H_ */ diff --git a/src/script/lua_api/l_item.h b/src/script/lua_api/l_item.h index b4efaefc8..6aa62808b 100644 --- a/src/script/lua_api/l_item.h +++ b/src/script/lua_api/l_item.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 L_ITEM_H_ -#define L_ITEM_H_ +#pragma once #include "lua_api/l_base.h" #include "inventory.h" // ItemStack @@ -147,7 +146,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - - - -#endif /* L_ITEM_H_ */ diff --git a/src/script/lua_api/l_itemstackmeta.h b/src/script/lua_api/l_itemstackmeta.h index 6e841d2dc..cfaece794 100644 --- a/src/script/lua_api/l_itemstackmeta.h +++ b/src/script/lua_api/l_itemstackmeta.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 L_ITEMSTACKMETA_H_ -#define L_ITEMSTACKMETA_H_ +#pragma once #include "lua_api/l_base.h" #include "lua_api/l_metadata.h" @@ -55,5 +54,3 @@ public: static void Register(lua_State *L); }; - -#endif diff --git a/src/script/lua_api/l_localplayer.h b/src/script/lua_api/l_localplayer.h index e618e6be5..dcb5c878c 100644 --- a/src/script/lua_api/l_localplayer.h +++ b/src/script/lua_api/l_localplayer.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 MINETEST_L_LOCALPLAYER_H -#define MINETEST_L_LOCALPLAYER_H +#pragma once #include "l_base.h" @@ -81,5 +80,3 @@ public: static void Register(lua_State *L); }; - -#endif // MINETEST_L_LOCALPLAYER_H diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index 4be07576c..ffaab7dca 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.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 L_MAINMENU_H_ -#define L_MAINMENU_H_ +#pragma once #include "lua_api/l_base.h" @@ -151,5 +150,3 @@ public: static void InitializeAsync(lua_State *L, int top); }; - -#endif /* L_MAINMENU_H_ */ diff --git a/src/script/lua_api/l_mapgen.h b/src/script/lua_api/l_mapgen.h index a26c8b950..89b825be2 100644 --- a/src/script/lua_api/l_mapgen.h +++ b/src/script/lua_api/l_mapgen.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 L_MAPGEN_H_ -#define L_MAPGEN_H_ +#pragma once #include "lua_api/l_base.h" @@ -119,5 +118,3 @@ public: static struct EnumString es_SchematicFormatType[]; static struct EnumString es_NodeResolveMethod[]; }; - -#endif /* L_MAPGEN_H_ */ diff --git a/src/script/lua_api/l_metadata.h b/src/script/lua_api/l_metadata.h index a479e64b0..5a7c7e7f7 100644 --- a/src/script/lua_api/l_metadata.h +++ b/src/script/lua_api/l_metadata.h @@ -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 L_METADATA_H_ -#define L_METADATA_H_ + +#pragma once #include "irrlichttypes_bloated.h" #include "lua_api/l_base.h" @@ -72,5 +72,3 @@ protected: // equals(self, other) static int l_equals(lua_State *L); }; - -#endif /* L_NODEMETA_H_ */ diff --git a/src/script/lua_api/l_minimap.h b/src/script/lua_api/l_minimap.h index d4fbf6330..2d0e6ae9f 100644 --- a/src/script/lua_api/l_minimap.h +++ b/src/script/lua_api/l_minimap.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 L_MINIMAP_H_ -#define L_MINIMAP_H_ +#pragma once #include "l_base.h" @@ -61,5 +60,3 @@ public: static void Register(lua_State *L); }; - -#endif // L_MINIMAP_H_ diff --git a/src/script/lua_api/l_nodemeta.h b/src/script/lua_api/l_nodemeta.h index 72d26ef36..683f79932 100644 --- a/src/script/lua_api/l_nodemeta.h +++ b/src/script/lua_api/l_nodemeta.h @@ -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 L_NODEMETA_H_ -#define L_NODEMETA_H_ + +#pragma once #include "lua_api/l_base.h" #include "lua_api/l_metadata.h" @@ -93,5 +93,3 @@ public: static void Register(lua_State *L); static void RegisterClient(lua_State *L); }; - -#endif /* L_NODEMETA_H_ */ diff --git a/src/script/lua_api/l_nodetimer.h b/src/script/lua_api/l_nodetimer.h index df77ed98f..c7cc76244 100644 --- a/src/script/lua_api/l_nodetimer.h +++ b/src/script/lua_api/l_nodetimer.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 L_NODETIMER_H_ -#define L_NODETIMER_H_ +#pragma once #include "irr_v3d.h" #include "lua_api/l_base.h" @@ -62,5 +61,3 @@ public: static void Register(lua_State *L); }; - -#endif /* L_NODETIMER_H_ */ diff --git a/src/script/lua_api/l_noise.h b/src/script/lua_api/l_noise.h index f252b5ba2..8af4fbd12 100644 --- a/src/script/lua_api/l_noise.h +++ b/src/script/lua_api/l_noise.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 L_NOISE_H_ -#define L_NOISE_H_ +#pragma once #include "irr_v3d.h" #include "lua_api/l_base.h" @@ -193,5 +192,3 @@ public: static void Register(lua_State *L); }; - -#endif /* L_NOISE_H_ */ diff --git a/src/script/lua_api/l_object.h b/src/script/lua_api/l_object.h index 77874f00c..a2438e434 100644 --- a/src/script/lua_api/l_object.h +++ b/src/script/lua_api/l_object.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 L_OBJECT_H_ -#define L_OBJECT_H_ +#pragma once #include "lua_api/l_base.h" #include "irrlichttypes.h" @@ -333,5 +332,3 @@ private: static int l_get_nametag_attributes(lua_State *L); }; - -#endif /* L_OBJECT_H_ */ diff --git a/src/script/lua_api/l_particles.h b/src/script/lua_api/l_particles.h index c593f47e4..122810b6d 100644 --- a/src/script/lua_api/l_particles.h +++ b/src/script/lua_api/l_particles.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 L_PARTICLES_H_ -#define L_PARTICLES_H_ +#pragma once #include "lua_api/l_base.h" @@ -31,7 +30,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - - - -#endif /* L_PARTICLES_H_ */ diff --git a/src/script/lua_api/l_rollback.h b/src/script/lua_api/l_rollback.h index 3b01c0d8b..c26ff634e 100644 --- a/src/script/lua_api/l_rollback.h +++ b/src/script/lua_api/l_rollback.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 L_ROLLBACK_H_ -#define L_ROLLBACK_H_ +#pragma once #include "lua_api/l_base.h" @@ -34,5 +33,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif /* L_ROLLBACK_H_ */ diff --git a/src/script/lua_api/l_server.h b/src/script/lua_api/l_server.h index 251a0ce89..3aa1785a2 100644 --- a/src/script/lua_api/l_server.h +++ b/src/script/lua_api/l_server.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 L_SERVER_H_ -#define L_SERVER_H_ +#pragma once #include "lua_api/l_base.h" @@ -110,5 +109,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif /* L_SERVER_H_ */ diff --git a/src/script/lua_api/l_settings.h b/src/script/lua_api/l_settings.h index a664b4494..500917f0a 100644 --- a/src/script/lua_api/l_settings.h +++ b/src/script/lua_api/l_settings.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 L_SETTINGS_H_ -#define L_SETTINGS_H_ +#pragma once #include "lua_api/l_base.h" @@ -77,5 +76,3 @@ public: static void Register(lua_State *L); }; - -#endif diff --git a/src/script/lua_api/l_sound.h b/src/script/lua_api/l_sound.h index 1f0c1eba1..888a0f30b 100644 --- a/src/script/lua_api/l_sound.h +++ b/src/script/lua_api/l_sound.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef L_SOUND_H_ -#define L_SOUND_H_ +#pragma once #include "lua_api/l_base.h" @@ -32,5 +31,3 @@ private: public: static void Initialize(lua_State *L, int top); }; - -#endif diff --git a/src/script/lua_api/l_storage.h b/src/script/lua_api/l_storage.h index eaf7ec9f6..4e808c393 100644 --- a/src/script/lua_api/l_storage.h +++ b/src/script/lua_api/l_storage.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __L_STORAGE_H__ -#define __L_STORAGE_H__ +#pragma once #include "l_metadata.h" #include "lua_api/l_base.h" @@ -59,5 +58,3 @@ public: static StorageRef *checkobject(lua_State *L, int narg); static ModMetadata *getobject(StorageRef *ref); }; - -#endif /* __L_STORAGE_H__ */ diff --git a/src/script/lua_api/l_util.h b/src/script/lua_api/l_util.h index b75d9db29..b7aafe8d5 100644 --- a/src/script/lua_api/l_util.h +++ b/src/script/lua_api/l_util.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 L_UTIL_H_ -#define L_UTIL_H_ +#pragma once #include "lua_api/l_base.h" @@ -100,5 +99,3 @@ public: static void InitializeAsync(AsyncEngine &engine); }; - -#endif /* L_UTIL_H_ */ diff --git a/src/script/lua_api/l_vmanip.h b/src/script/lua_api/l_vmanip.h index e706f3727..15ab9eef8 100644 --- a/src/script/lua_api/l_vmanip.h +++ b/src/script/lua_api/l_vmanip.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 L_VMANIP_H_ -#define L_VMANIP_H_ +#pragma once #include #include "irr_v3d.h" @@ -80,5 +79,3 @@ public: static void Register(lua_State *L); }; - -#endif /* L_VMANIP_H_ */ diff --git a/src/script/scripting_client.h b/src/script/scripting_client.h index 822bff773..721bb2b05 100644 --- a/src/script/scripting_client.h +++ b/src/script/scripting_client.h @@ -18,8 +18,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_SCRIPTING_H_ -#define CLIENT_SCRIPTING_H_ +#pragma once #include "cpp_api/s_base.h" #include "cpp_api/s_client.h" @@ -41,4 +40,3 @@ public: private: virtual void InitializeModApi(lua_State *L, int top); }; -#endif diff --git a/src/script/scripting_mainmenu.h b/src/script/scripting_mainmenu.h index 8e251af03..9e23bdc1b 100644 --- a/src/script/scripting_mainmenu.h +++ b/src/script/scripting_mainmenu.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 SCRIPTING_MAINMENU_H_ -#define SCRIPTING_MAINMENU_H_ +#pragma once #include "cpp_api/s_base.h" #include "cpp_api/s_mainmenu.h" @@ -47,6 +46,3 @@ private: AsyncEngine asyncEngine; }; - - -#endif /* SCRIPTING_MAINMENU_H_ */ diff --git a/src/script/scripting_server.h b/src/script/scripting_server.h index fd97ea40b..b549a1bc9 100644 --- a/src/script/scripting_server.h +++ b/src/script/scripting_server.h @@ -17,9 +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 SERVER_SCRIPTING_H_ -#define SERVER_SCRIPTING_H_ - +#pragma once #include "cpp_api/s_base.h" #include "cpp_api/s_entity.h" #include "cpp_api/s_env.h" @@ -53,5 +51,3 @@ private: }; void log_deprecated(const std::string &message); - -#endif /* SCRIPTING_GAME_H_ */ diff --git a/src/serialization.h b/src/serialization.h index 4e01db40a..7f8b83382 100644 --- a/src/serialization.h +++ b/src/serialization.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 SERIALIZATION_HEADER -#define SERIALIZATION_HEADER +#pragma once #include "irrlichttypes.h" #include "exceptions.h" @@ -94,6 +93,3 @@ void decompressZlib(std::istream &is, std::ostream &os); void compress(const SharedBuffer &data, std::ostream &os, u8 version); //void compress(const std::string &data, std::ostream &os, u8 version); void decompress(std::istream &is, std::ostream &os, u8 version); - -#endif - diff --git a/src/server.h b/src/server.h index aae589f9a..6955306dd 100644 --- a/src/server.h +++ b/src/server.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 SERVER_HEADER -#define SERVER_HEADER +#pragma once #include "network/connection.h" #include "irr_v3d.h" @@ -654,5 +653,3 @@ private: Shuts down when kill is set to true. */ void dedicated_server_loop(Server &server, bool &kill); - -#endif diff --git a/src/serverenvironment.h b/src/serverenvironment.h index c9f80a4c4..3428d3c99 100644 --- a/src/serverenvironment.h +++ b/src/serverenvironment.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 SERVER_ENVIRONMENT_HEADER -#define SERVER_ENVIRONMENT_HEADER +#pragma once #include "environment.h" #include "mapnode.h" @@ -437,5 +436,3 @@ private: std::unordered_map m_particle_spawners; std::unordered_map m_particle_spawner_attachments; }; - -#endif diff --git a/src/serverlist.h b/src/serverlist.h index 079026199..796b23b98 100644 --- a/src/serverlist.h +++ b/src/serverlist.h @@ -22,8 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "mods.h" #include -#ifndef SERVERLIST_HEADER -#define SERVERLIST_HEADER +#pragma once typedef Json::Value ServerListSpec; @@ -51,5 +50,3 @@ void sendAnnounce(AnnounceAction, u16 port, #endif } // namespace ServerList - -#endif diff --git a/src/serverobject.h b/src/serverobject.h index 8acbd6a19..140ff9f4a 100644 --- a/src/serverobject.h +++ b/src/serverobject.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 SERVEROBJECT_HEADER -#define SERVEROBJECT_HEADER +#pragma once #include #include "irrlichttypes_bloated.h" @@ -258,6 +257,3 @@ private: // Used for creating objects based on type static std::map m_types; }; - -#endif - diff --git a/src/settings.h b/src/settings.h index f0baf41bf..4c128b7b8 100644 --- a/src/settings.h +++ b/src/settings.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 SETTINGS_HEADER -#define SETTINGS_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include "util/string.h" @@ -234,6 +233,3 @@ private: mutable std::mutex m_mutex; }; - -#endif - diff --git a/src/shader.h b/src/shader.h index 1db4cba83..7a7ee3e7b 100644 --- a/src/shader.h +++ b/src/shader.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SHADER_HEADER -#define SHADER_HEADER +#pragma once #include #include "irrlichttypes_bloated.h" @@ -153,5 +152,3 @@ IWritableShaderSource *createShaderSource(); void dumpShaderProgram(std::ostream &output_stream, const std::string &program_type, const std::string &program); - -#endif diff --git a/src/sky.h b/src/sky.h index ed93a9221..b66a4990f 100644 --- a/src/sky.h +++ b/src/sky.h @@ -21,8 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "camera.h" #include "irrlichttypes_extrabloated.h" -#ifndef SKY_HEADER -#define SKY_HEADER +#pragma once #define SKY_MATERIAL_COUNT 5 #define SKY_STAR_COUNT 200 @@ -147,5 +146,3 @@ private: video::ITexture *m_sun_tonemap; video::ITexture *m_moon_tonemap; }; - -#endif diff --git a/src/socket.h b/src/socket.h index b1f1e0875..489818123 100644 --- a/src/socket.h +++ b/src/socket.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 SOCKET_HEADER -#define SOCKET_HEADER +#pragma once #ifdef _WIN32 #ifndef _WIN32_WINNT @@ -133,6 +132,3 @@ private: int m_timeout_ms; int m_addr_family; }; - -#endif - diff --git a/src/sound.h b/src/sound.h index 9447b77ef..b9c847079 100644 --- a/src/sound.h +++ b/src/sound.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 SOUND_HEADER -#define SOUND_HEADER +#pragma once #include #include @@ -121,5 +120,3 @@ public: // Global DummySoundManager singleton extern DummySoundManager dummySoundManager; - -#endif diff --git a/src/sound_openal.h b/src/sound_openal.h index 13d01a5d6..6d538c8f9 100644 --- a/src/sound_openal.h +++ b/src/sound_openal.h @@ -17,12 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SOUND_OPENAL_HEADER -#define SOUND_OPENAL_HEADER +#pragma once #include "sound.h" ISoundManager *createOpenALSoundManager(OnDemandSoundFetcher *fetcher); - -#endif - diff --git a/src/staticobject.h b/src/staticobject.h index fb73befd3..c457f1384 100644 --- a/src/staticobject.h +++ b/src/staticobject.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 STATICOBJECT_HEADER -#define STATICOBJECT_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include @@ -95,6 +94,3 @@ public: private: }; - -#endif - diff --git a/src/subgame.h b/src/subgame.h index dda249a98..8c21973ea 100644 --- a/src/subgame.h +++ b/src/subgame.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 SUBGAME_HEADER -#define SUBGAME_HEADER +#pragma once #include #include @@ -99,6 +98,3 @@ std::vector getAvailableWorlds(); // loads the subgame's config and creates world directory // and world.mt if they don't exist bool loadGameConfAndInitWorld(const std::string &path, const SubgameSpec &gamespec); - -#endif - diff --git a/src/terminal_chat_console.h b/src/terminal_chat_console.h index b656f8872..eae7c6b22 100644 --- a/src/terminal_chat_console.h +++ b/src/terminal_chat_console.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 TERMINAL_CHAT_CONSOLE_H -#define TERMINAL_CHAT_CONSOLE_H +#pragma once #include "chat.h" #include "threading/thread.h" @@ -123,5 +122,3 @@ private: }; extern TerminalChatConsole g_term_console; - -#endif diff --git a/src/threading/event.h b/src/threading/event.h index af91d04c7..ac6bd5129 100644 --- a/src/threading/event.h +++ b/src/threading/event.h @@ -23,8 +23,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef THREADING_EVENT_H -#define THREADING_EVENT_H +#pragma once #include @@ -45,5 +44,3 @@ private: std::mutex mutex; bool notified = false; }; - -#endif diff --git a/src/threading/semaphore.h b/src/threading/semaphore.h index 8ff376666..76a8f48a6 100644 --- a/src/threading/semaphore.h +++ b/src/threading/semaphore.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 THREADING_SEMAPHORE_H -#define THREADING_SEMAPHORE_H +#pragma once #if defined(_WIN32) #include @@ -51,5 +50,3 @@ private: DISABLE_CLASS_COPY(Semaphore); }; - -#endif diff --git a/src/tileanimation.h b/src/tileanimation.h index 9872e7917..0449de0b8 100644 --- a/src/tileanimation.h +++ b/src/tileanimation.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 TILEANIMATION_HEADER -#define TILEANIMATION_HEADER +#pragma once #include #include "irrlichttypes_bloated.h" @@ -58,5 +57,3 @@ struct TileAnimationParams void getTextureModifer(std::ostream &os, v2u32 texture_size, int frame) const; v2f getTextureCoords(v2u32 texture_size, int frame) const; }; - -#endif diff --git a/src/tool.h b/src/tool.h index 67631fe79..f3362d892 100644 --- a/src/tool.h +++ b/src/tool.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 TOOL_HEADER -#define TOOL_HEADER +#pragma once #include "irrlichttypes.h" #include @@ -130,6 +129,3 @@ PunchDamageResult getPunchDamage( const ItemStack *punchitem, float time_from_last_punch ); - -#endif - diff --git a/src/touchscreengui.h b/src/touchscreengui.h index 7d3e4e83b..8dfec47d8 100644 --- a/src/touchscreengui.h +++ b/src/touchscreengui.h @@ -16,8 +16,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef TOUCHSCREENGUI_HEADER -#define TOUCHSCREENGUI_HEADER +#pragma once #include #include @@ -252,4 +251,3 @@ private: AutoHideButtonBar m_rarecontrolsbar; }; extern TouchScreenGUI *g_touchscreengui; -#endif diff --git a/src/treegen.h b/src/treegen.h index 8777c369c..8e5306560 100644 --- a/src/treegen.h +++ b/src/treegen.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 TREEGEN_HEADER -#define TREEGEN_HEADER +#pragma once #include #include "noise.h" @@ -91,4 +90,3 @@ namespace treegen { v3f transposeMatrix(irr::core::matrix4 M ,v3f v); }; // namespace treegen -#endif diff --git a/src/unittest/test.h b/src/unittest/test.h index bf76e8bb2..c4351a67b 100644 --- a/src/unittest/test.h +++ b/src/unittest/test.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 TEST_HEADER -#define TEST_HEADER +#pragma once #include #include @@ -143,5 +142,3 @@ extern content_t t_CONTENT_LAVA; extern content_t t_CONTENT_BRICK; bool run_tests(); - -#endif diff --git a/src/util/areastore.h b/src/util/areastore.h index 8c22c3ad7..e94aa4e2a 100644 --- a/src/util/areastore.h +++ b/src/util/areastore.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 AREA_STORE_H_ -#define AREA_STORE_H_ +#pragma once #include "irr_v3d.h" #include "noise.h" // for PcgRandom @@ -197,5 +196,3 @@ private: }; #endif // USE_SPATIAL - -#endif // AREA_STORE_H_ diff --git a/src/util/auth.h b/src/util/auth.h index 7cdc7d74d..ba827f322 100644 --- a/src/util/auth.h +++ b/src/util/auth.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 AUTH_H -#define AUTH_H +#pragma once /// Gets the base64 encoded legacy password db entry. std::string translate_password(const std::string &name, @@ -46,5 +45,3 @@ std::string encode_srp_verifier(const std::string &verifier, /// and salt components. bool decode_srp_verifier_and_salt(const std::string &encoded, std::string *verifier, std::string *salt); - -#endif diff --git a/src/util/base64.h b/src/util/base64.h index 1cb175518..7f2bf1368 100644 --- a/src/util/base64.h +++ b/src/util/base64.h @@ -1,10 +1,26 @@ -#ifndef BASE64_HEADER -#define BASE64_HEADER +/* +Minetest +Copyright (C) 2013-2017 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +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. +*/ + +#pragma once #include bool base64_is_valid(std::string const& s); std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_decode(std::string const& s); - -#endif // BASE64_HEADER diff --git a/src/util/basic_macros.h b/src/util/basic_macros.h index 71be13a1f..334e342e0 100644 --- a/src/util/basic_macros.h +++ b/src/util/basic_macros.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 BASICMACROS_HEADER -#define BASICMACROS_HEADER +#pragma once #define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) @@ -57,5 +56,3 @@ with this program; if not, write to the Free Software Foundation, Inc., #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" #define PP2(x) "("<<(x).X<<","<<(x).Y<<")" - -#endif diff --git a/src/util/container.h b/src/util/container.h index caaa1c328..af85d80e3 100644 --- a/src/util/container.h +++ b/src/util/container.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 UTIL_CONTAINER_HEADER -#define UTIL_CONTAINER_HEADER +#pragma once #include "../irrlichttypes.h" #include "../exceptions.h" @@ -301,6 +300,3 @@ private: // we can't use std::deque here, because its iterators get invalidated std::list m_queue; }; - -#endif - diff --git a/src/util/directiontables.h b/src/util/directiontables.h index 3cfe0fb3e..ab5b63217 100644 --- a/src/util/directiontables.h +++ b/src/util/directiontables.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 UTIL_DIRECTIONTABLES_HEADER -#define UTIL_DIRECTIONTABLES_HEADER +#pragma once #include "../irrlichttypes.h" #include "../irr_v3d.h" @@ -84,5 +83,3 @@ enum DirectionWallmounted { DWM_ZP, DWM_ZN, }; - -#endif diff --git a/src/util/enriched_string.h b/src/util/enriched_string.h index a3b8feb2a..202d84cb0 100644 --- a/src/util/enriched_string.h +++ b/src/util/enriched_string.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 ENRICHEDSTRING_HEADER -#define ENRICHEDSTRING_HEADER +#pragma once #include #include @@ -87,5 +86,3 @@ private: bool m_has_background = false; irr::video::SColor m_background; }; - -#endif diff --git a/src/util/hex.h b/src/util/hex.h index c205d01da..df22539a5 100644 --- a/src/util/hex.h +++ b/src/util/hex.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 HEX_HEADER -#define HEX_HEADER +#pragma once #include @@ -57,5 +56,3 @@ static inline bool hex_digit_decode(char hexdigit, unsigned char &value) return false; return true; } - -#endif diff --git a/src/util/numeric.h b/src/util/numeric.h index 5143c92e6..36e6fddd0 100644 --- a/src/util/numeric.h +++ b/src/util/numeric.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 UTIL_NUMERIC_HEADER -#define UTIL_NUMERIC_HEADER +#pragma once #include "basic_macros.h" #include "../irrlichttypes.h" @@ -363,5 +362,3 @@ inline u32 npot2(u32 orig) { orig |= orig >> 16; return orig + 1; } - -#endif diff --git a/src/util/pointedthing.h b/src/util/pointedthing.h index f63bcad9d..c13436fcd 100644 --- a/src/util/pointedthing.h +++ b/src/util/pointedthing.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 UTIL_POINTEDTHING_HEADER -#define UTIL_POINTEDTHING_HEADER +#pragma once #include "../irrlichttypes.h" #include "../irr_v3d.h" @@ -98,6 +97,3 @@ struct PointedThing bool operator==(const PointedThing &pt2) const; bool operator!=(const PointedThing &pt2) const; }; - -#endif - diff --git a/src/util/pointer.h b/src/util/pointer.h index f68269882..f018efb20 100644 --- a/src/util/pointer.h +++ b/src/util/pointer.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 UTIL_POINTER_HEADER -#define UTIL_POINTER_HEADER +#pragma once #include "../irrlichttypes.h" #include "../debug.h" // For assert() @@ -227,6 +226,3 @@ inline SharedBuffer SharedBufferFromString(const char *string) SharedBuffer b((u8*)string, strlen(string)+1); return b; } - -#endif - diff --git a/src/util/serialize.h b/src/util/serialize.h index f43480557..0607ff37a 100644 --- a/src/util/serialize.h +++ b/src/util/serialize.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 UTIL_SERIALIZE_HEADER -#define UTIL_SERIALIZE_HEADER +#pragma once #include "../irrlichttypes_bloated.h" #include "../exceptions.h" // for SerializationError @@ -657,5 +656,3 @@ inline void putRawData(std::vector *dest, const void *src, size_t len) { dest->insert(dest->end(), (u8 *)src, (u8 *)src + len); } - -#endif diff --git a/src/util/sha1.h b/src/util/sha1.h index a55f94f44..20f89eae6 100644 --- a/src/util/sha1.h +++ b/src/util/sha1.h @@ -24,7 +24,8 @@ SOFTWARE. */ -#ifndef SHA1_HEADER +#pragma once + typedef unsigned int Uint32; class SHA1 @@ -51,6 +52,3 @@ public: static void storeBigEndianUint32(unsigned char *byte, Uint32 num); static void hexPrinter(unsigned char *c, int l); }; - -#define SHA1_HEADER -#endif diff --git a/src/util/sha2.h b/src/util/sha2.h index 233c85a81..7d746262d 100644 --- a/src/util/sha2.h +++ b/src/util/sha2.h @@ -56,8 +56,7 @@ * [including the GNU Public Licence.] */ -#ifndef HEADER_SHA_H -#define HEADER_SHA_H +#pragma once #include @@ -153,5 +152,3 @@ void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); #ifdef __cplusplus } #endif - -#endif diff --git a/src/util/srp.h b/src/util/srp.h index 2d49b076e..cf2bdec50 100644 --- a/src/util/srp.h +++ b/src/util/srp.h @@ -53,8 +53,7 @@ * hash & prime number pairings. */ -#ifndef SRP_H -#define SRP_H +#pragma once struct SRPVerifier; struct SRPUser; @@ -190,5 +189,3 @@ void srp_user_process_challenge(struct SRPUser *usr, /* bytes_HAMK must be exactly srp_user_get_session_key_length() bytes in size */ void srp_user_verify_session(struct SRPUser *usr, const unsigned char *bytes_HAMK); - -#endif /* Include Guard */ diff --git a/src/util/strfnd.h b/src/util/strfnd.h index a7cd2badb..96cf1b458 100644 --- a/src/util/strfnd.h +++ b/src/util/strfnd.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 STRFND_HEADER -#define STRFND_HEADER +#pragma once #include @@ -77,6 +76,3 @@ public: typedef BasicStrfnd Strfnd; typedef BasicStrfnd WStrfnd; - -#endif - diff --git a/src/util/string.h b/src/util/string.h index c0f4beefb..584ffb73a 100644 --- a/src/util/string.h +++ b/src/util/string.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 UTIL_STRING_HEADER -#define UTIL_STRING_HEADER +#pragma once #include "irrlichttypes_bloated.h" #include @@ -648,6 +647,3 @@ inline const std::string duration_to_string(int sec) return ss.str(); } - - -#endif diff --git a/src/util/thread.h b/src/util/thread.h index 201d09a08..fbd04c08e 100644 --- a/src/util/thread.h +++ b/src/util/thread.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 UTIL_THREAD_HEADER -#define UTIL_THREAD_HEADER +#pragma once #include "../irrlichttypes.h" #include "../threading/thread.h" @@ -228,6 +227,3 @@ protected: private: Semaphore m_update_sem; }; - -#endif - diff --git a/src/util/timetaker.h b/src/util/timetaker.h index 34564ee4b..2988e8133 100644 --- a/src/util/timetaker.h +++ b/src/util/timetaker.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 UTIL_TIMETAKER_HEADER -#define UTIL_TIMETAKER_HEADER +#pragma once #include "../irrlichttypes.h" #include "../gettime.h" @@ -49,6 +48,3 @@ private: TimePrecision m_precision; u64 *m_result = nullptr; }; - -#endif - diff --git a/src/version.h b/src/version.h index 0b803b82c..30bb81fdf 100644 --- a/src/version.h +++ b/src/version.h @@ -17,12 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef VERSION_HEADER -#define VERSION_HEADER +#pragma once extern const char *g_version_string; extern const char *g_version_hash; extern const char *g_build_info; - -#endif - diff --git a/src/voxel.h b/src/voxel.h index 88e2edcc7..599a57de4 100644 --- a/src/voxel.h +++ b/src/voxel.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 VOXEL_HEADER -#define VOXEL_HEADER +#pragma once #include "irrlichttypes.h" #include "irr_v3d.h" @@ -505,6 +504,3 @@ public: static const MapNode ContentIgnoreNode; }; - -#endif - diff --git a/src/voxelalgorithms.h b/src/voxelalgorithms.h index 7203585e4..e8f5f64c7 100644 --- a/src/voxelalgorithms.h +++ b/src/voxelalgorithms.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 VOXELALGORITHMS_HEADER -#define VOXELALGORITHMS_HEADER +#pragma once #include "voxel.h" #include "mapnode.h" @@ -180,8 +179,3 @@ public: }; } // namespace voxalgo - - - -#endif - diff --git a/src/wieldmesh.h b/src/wieldmesh.h index 44bca8e9f..c10ff66a4 100644 --- a/src/wieldmesh.h +++ b/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 WIELDMESH_HEADER -#define WIELDMESH_HEADER +#pragma once #include #include "irrlichttypes_extrabloated.h" @@ -137,4 +136,3 @@ scene::SMesh *getExtrudedMesh(ITextureSource *tsrc, const std::string &imagename void postProcessNodeMesh(scene::SMesh *mesh, const ContentFeatures &f, bool use_shaders, bool set_material, video::E_MATERIAL_TYPE *mattype, std::vector *colors); -#endif