[vlc-commits] lua: small macro factorization

Rémi Denis-Courmont git at videolan.org
Mon Oct 28 18:11:48 CET 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Oct 28 19:10:35 2013 +0200| [d35df2cf43f122c4f15326ba4d95fefdab8776d2] | committer: Rémi Denis-Courmont

lua: small macro factorization

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d35df2cf43f122c4f15326ba4d95fefdab8776d2
---

 modules/lua/libs/net.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/lua/libs/net.c b/modules/lua/libs/net.c
index b74174e..74ffe93 100644
--- a/modules/lua/libs/net.c
+++ b/modules/lua/libs/net.c
@@ -514,15 +514,15 @@ void luaopen_net_intf( lua_State *L )
 {
     lua_newtable( L );
     luaL_register( L, NULL, vlclua_net_intf_reg );
-#define ADD_CONSTANT( name, value )    \
-    lua_pushinteger( L, value ); \
-    lua_setfield( L, -2, name );
-    ADD_CONSTANT( "POLLIN", POLLIN )
-    ADD_CONSTANT( "POLLPRI", POLLPRI )
-    ADD_CONSTANT( "POLLOUT", POLLOUT )
-    ADD_CONSTANT( "POLLERR", POLLERR )
-    ADD_CONSTANT( "POLLHUP", POLLHUP )
-    ADD_CONSTANT( "POLLNVAL", POLLNVAL )
+#define ADD_CONSTANT( value )    \
+    lua_pushinteger( L, POLL##value ); \
+    lua_setfield( L, -2, "POLL"#value );
+    ADD_CONSTANT( IN )
+    ADD_CONSTANT( PRI )
+    ADD_CONSTANT( OUT )
+    ADD_CONSTANT( ERR )
+    ADD_CONSTANT( HUP )
+    ADD_CONSTANT( NVAL )
     lua_setfield( L, -2, "net" );
 }
 



More information about the vlc-commits mailing list