Skip to content

Commit

Permalink
Clang format: fix LINT on old PR which doesn't have LINT enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Apr 10, 2017
1 parent 0a88346 commit 0419552
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 30 deletions.
29 changes: 10 additions & 19 deletions src/script/lua_api/l_localplayer.cpp
Expand Up @@ -17,19 +17,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "script/common/c_converter.h"
#include "l_localplayer.h"
#include "l_internal.h"
#include "script/common/c_converter.h"

This comment has been minimized.

Copy link
@sfan5

sfan5 Apr 10, 2017

Member

useless include reordering

This comment has been minimized.

Copy link
@nerzhul

nerzhul Apr 10, 2017

Author Member

fixed in next commit


LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m)
{
m_localplayer = m;
}
LuaLocalPlayer::LuaLocalPlayer(LocalPlayer *m) { m_localplayer = m; }

void LuaLocalPlayer::create(lua_State *L, LocalPlayer *m)
{
LuaLocalPlayer *o = new LuaLocalPlayer(m);
*(void **) (lua_newuserdata(L, sizeof(void *))) = o;
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
luaL_getmetatable(L, className);
lua_setmetatable(L, -2);

Expand Down Expand Up @@ -332,13 +329,10 @@ LuaLocalPlayer *LuaLocalPlayer::checkobject(lua_State *L, int narg)
if (!ud)
luaL_typerror(L, narg, className);

return *(LuaLocalPlayer **) ud;
return *(LuaLocalPlayer **)ud;
}

LocalPlayer *LuaLocalPlayer::getobject(LuaLocalPlayer *ref)
{
return ref->m_localplayer;
}
LocalPlayer *LuaLocalPlayer::getobject(LuaLocalPlayer *ref) { return ref->m_localplayer; }

This comment has been minimized.

Copy link
@sfan5

sfan5 Apr 10, 2017

Member

???

This comment has been minimized.

Copy link
@nerzhul

nerzhul Apr 10, 2017

Author Member

fixed in next commit


LocalPlayer *LuaLocalPlayer::getobject(lua_State *L, int narg)
{
Expand All @@ -351,7 +345,7 @@ LocalPlayer *LuaLocalPlayer::getobject(lua_State *L, int narg)

int LuaLocalPlayer::gc_object(lua_State *L)
{
LuaLocalPlayer *o = *(LuaLocalPlayer **) (lua_touserdata(L, 1));
LuaLocalPlayer *o = *(LuaLocalPlayer **)(lua_touserdata(L, 1));
delete o;
return 0;
}
Expand All @@ -378,14 +372,12 @@ void LuaLocalPlayer::Register(lua_State *L)
lua_pop(L, 1); // Drop metatable

luaL_openlib(L, 0, methods, 0); // fill methodtable
lua_pop(L, 1); // Drop methodtable
lua_pop(L, 1); // Drop methodtable

This comment has been minimized.

Copy link
@sfan5

sfan5 Apr 10, 2017

Member

what?

}

const char LuaLocalPlayer::className[] = "LocalPlayer";
const luaL_reg LuaLocalPlayer::methods[] = {
luamethod(LuaLocalPlayer, get_velocity),
luamethod(LuaLocalPlayer, get_hp),
luamethod(LuaLocalPlayer, get_name),
const luaL_reg LuaLocalPlayer::methods[] = {luamethod(LuaLocalPlayer, get_velocity),
luamethod(LuaLocalPlayer, get_hp), luamethod(LuaLocalPlayer, get_name),

This comment has been minimized.

Copy link
@sfan5

sfan5 Apr 10, 2017

Member

this is pretty ugly

This comment has been minimized.

Copy link
@nerzhul

nerzhul Apr 10, 2017

Author Member

i'm looking for this, i think LINT will have some difficulties about this, i think i will re-apply clang-format with better LINT but make it in whitelist to fix this part

luamethod(LuaLocalPlayer, is_teleported),
luamethod(LuaLocalPlayer, is_attached),
luamethod(LuaLocalPlayer, is_touching_ground),
Expand All @@ -412,5 +404,4 @@ const luaL_reg LuaLocalPlayer::methods[] = {
luamethod(LuaLocalPlayer, get_movement_speed),
luamethod(LuaLocalPlayer, get_movement),

{0, 0}
};
{0, 0}};

This comment has been minimized.

Copy link
@sfan5

sfan5 Apr 10, 2017

Member

this too

This comment has been minimized.

Copy link
@nerzhul

nerzhul Apr 10, 2017

Author Member

fixed in next commit

8 changes: 3 additions & 5 deletions src/script/lua_api/l_localplayer.h
Expand Up @@ -22,12 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,

#include "l_base.h"


class LocalPlayer;

class LuaLocalPlayer : public ModApiBase {
class LuaLocalPlayer : public ModApiBase
{
private:

static const char className[];
static const luaL_Reg methods[];

Expand Down Expand Up @@ -91,5 +90,4 @@ class LuaLocalPlayer : public ModApiBase {
static void Register(lua_State *L);
};


#endif //MINETEST_L_LOCALPLAYER_H
#endif // MINETEST_L_LOCALPLAYER_H
9 changes: 3 additions & 6 deletions src/wieldmesh.h
Expand Up @@ -30,18 +30,15 @@ struct TileSpec;

struct ItemMesh
{
scene::IMesh* mesh;
scene::IMesh *mesh;
/*!
* Stores the color of each mesh buffer.
* If the boolean is true, the color is fixed, else
* palettes can modify it.
*/
std::vector<std::pair<bool, video::SColor> > buffer_colors;
std::vector<std::pair<bool, video::SColor>> buffer_colors;

ItemMesh():
mesh(NULL),
buffer_colors()
{}
ItemMesh() : mesh(NULL), buffer_colors() {}
};

/*
Expand Down

0 comments on commit 0419552

Please sign in to comment.