1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

C++ modernize: Pragma once (#6264)

* Migrate cpp headers to pragma once
This commit is contained in:
Loïc Blot 2017-08-17 22:19:39 +02:00 committed by GitHub
parent c738d1eeab
commit 921151d97a
236 changed files with 288 additions and 1028 deletions

View file

@ -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_

View file

@ -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_ */

View file

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

View file

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

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

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

View file

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

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

@ -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_ */

View file

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

View file

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

View file

@ -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__ */

View file

@ -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_ */

View file

@ -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_ */