aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-17 22:19:39 +0200
committerGitHub <noreply@github.com>2017-08-17 22:19:39 +0200
commit921151d97a2fb2238ab514324fb95e2732248b96 (patch)
tree0723ab1f2c4df22492b4c2221d2974020d4dfd3d /src/script/lua_api
parentc738d1eeabbbe9164a25f6b69bc7ec1a3b44b051 (diff)
downloadminetest-921151d97a2fb2238ab514324fb95e2732248b96.tar.gz
minetest-921151d97a2fb2238ab514324fb95e2732248b96.tar.bz2
minetest-921151d97a2fb2238ab514324fb95e2732248b96.zip
C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_areastore.h5
-rw-r--r--src/script/lua_api/l_base.h5
-rw-r--r--src/script/lua_api/l_camera.h24
-rw-r--r--src/script/lua_api/l_client.h5
-rw-r--r--src/script/lua_api/l_craft.h5
-rw-r--r--src/script/lua_api/l_env.h5
-rw-r--r--src/script/lua_api/l_http.h5
-rw-r--r--src/script/lua_api/l_internal.h5
-rw-r--r--src/script/lua_api/l_inventory.h5
-rw-r--r--src/script/lua_api/l_item.h7
-rw-r--r--src/script/lua_api/l_itemstackmeta.h5
-rw-r--r--src/script/lua_api/l_localplayer.h5
-rw-r--r--src/script/lua_api/l_mainmenu.h5
-rw-r--r--src/script/lua_api/l_mapgen.h5
-rw-r--r--src/script/lua_api/l_metadata.h6
-rw-r--r--src/script/lua_api/l_minimap.h5
-rw-r--r--src/script/lua_api/l_nodemeta.h6
-rw-r--r--src/script/lua_api/l_nodetimer.h5
-rw-r--r--src/script/lua_api/l_noise.h5
-rw-r--r--src/script/lua_api/l_object.h5
-rw-r--r--src/script/lua_api/l_particles.h7
-rw-r--r--src/script/lua_api/l_rollback.h5
-rw-r--r--src/script/lua_api/l_server.h5
-rw-r--r--src/script/lua_api/l_settings.h5
-rw-r--r--src/script/lua_api/l_sound.h5
-rw-r--r--src/script/lua_api/l_storage.h5
-rw-r--r--src/script/lua_api/l_util.h5
-rw-r--r--src/script/lua_api/l_vmanip.h5
28 files changed, 49 insertions, 116 deletions
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 <celeron55@gmail.com>
+
+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 <string>
#include <vector>
@@ -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 <map>
#include "irr_v3d.h"
@@ -80,5 +79,3 @@ public:
static void Register(lua_State *L);
};
-
-#endif /* L_VMANIP_H_ */