From 207df8e2b0e8341cc0e483e3d7d645c726b2f9ad Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 5 Nov 2008 11:44:00 +0100 Subject: [PATCH] luaa: change deprecate() with more useful info Signed-off-by: Julien Danjou --- client.c | 6 +++--- hooks.c | 2 +- luaa.c | 4 ++-- luaa.h | 5 ++--- mouse.c | 2 +- screen.c | 2 +- statusbar.c | 2 +- titlebar.c | 2 +- widget.c | 6 +++--- 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/client.c b/client.c index 7a82bb8f..6f3f2f93 100644 --- a/client.c +++ b/client.c @@ -943,7 +943,7 @@ luaA_client_visible_get(lua_State *L) luaA_checkscreen(screen); - deprecate(); + deprecate(L); lua_newtable(L); @@ -1167,7 +1167,7 @@ luaA_client_geometry(lua_State *L) static int luaA_client_coords(lua_State *L) { - deprecate(); + deprecate(L); return luaA_client_geometry(L); } @@ -1208,7 +1208,7 @@ luaA_client_fullgeometry(lua_State *L) static int luaA_client_fullcoords(lua_State *L) { - deprecate(); + deprecate(L); return luaA_client_fullgeometry(L); } diff --git a/hooks.c b/hooks.c index e62aaed9..ed711508 100644 --- a/hooks.c +++ b/hooks.c @@ -98,7 +98,7 @@ luaA_hooks_mouse_enter(lua_State *L) static int luaA_hooks_mouse_over(lua_State *L) { - deprecate(); + deprecate(L); return luaA_hooks_mouse_enter(L); } diff --git a/luaa.c b/luaa.c index deb88f8f..fc89fbb2 100644 --- a/luaa.c +++ b/luaa.c @@ -175,7 +175,7 @@ luaA_font(lua_State *L) static int luaA_font_set(lua_State *L) { - deprecate(); + deprecate(L); return luaA_font(L); } @@ -240,7 +240,7 @@ luaA_colors(lua_State *L) static int luaA_colors_set(lua_State *L) { - deprecate(); + deprecate(L); return luaA_colors(L); } diff --git a/luaa.h b/luaa.h index 02e87d94..c113c684 100644 --- a/luaa.h +++ b/luaa.h @@ -35,9 +35,8 @@ /** Type for Lua function */ typedef int luaA_ref; -#define deprecate() _warn(__LINE__, \ - __FUNCTION__, \ - "This function is deprecated and will be removed.") +#define deprecate(L) luaA_warn(L, "%s: This function is deprecated and will be removed.", \ + __FUNCTION__) #define DO_LUA_NEW(decl, type, prefix, lua_type, type_ref) \ decl int \ diff --git a/mouse.c b/mouse.c index e0f31314..5bbcac3c 100644 --- a/mouse.c +++ b/mouse.c @@ -1374,7 +1374,7 @@ luaA_mouse_coords(lua_State *L) static int luaA_mouse_new(lua_State *L) { - deprecate(); + deprecate(L); return luaA_button_new(L); } diff --git a/screen.c b/screen.c index 40169d6c..82d21dd6 100644 --- a/screen.c +++ b/screen.c @@ -500,7 +500,7 @@ luaA_screen_index(lua_State *L) switch(a_tokenize(buf, len)) { case A_TK_COORDS: - deprecate(); + deprecate(L); case A_TK_GEOMETRY: luaA_pusharea(L, s->geometry); break; diff --git a/statusbar.c b/statusbar.c index df18ba73..81b7ea3b 100644 --- a/statusbar.c +++ b/statusbar.c @@ -33,7 +33,7 @@ static int luaA_statusbar_new(lua_State *L) { - deprecate(); + deprecate(L); return luaA_wibox_new(L); } diff --git a/titlebar.c b/titlebar.c index 130f9c13..f4ee6e82 100644 --- a/titlebar.c +++ b/titlebar.c @@ -157,7 +157,7 @@ titlebar_geometry_compute(client_t *c, area_t geometry, area_t *res) static int luaA_titlebar_new(lua_State *L) { - deprecate(); + deprecate(L); return luaA_wibox_new(L); } diff --git a/widget.c b/widget.c index 39cf9e1c..d59caa76 100644 --- a/widget.c +++ b/widget.c @@ -358,7 +358,7 @@ widget_invalidate_bywidget(widget_t *widget) static int luaA_widget_mouse_add(lua_State *L) { - deprecate(); + deprecate(L); return 0; } @@ -392,8 +392,8 @@ luaA_widget_new(lua_State *L) if(!a_strcmp(type, "tasklist") || !a_strcmp(type, "taglist")) { - deprecate(); - luaA_warn(L, "requesting old widgets, return a table to allow smooth execution\n"); + deprecate(L); + luaA_warn(L, "requesting old widgets, return a table to allow smooth execution.\n"); lua_newtable(L); lua_pushcfunction(L, luaA_widget_mouse_add); lua_setfield(L, -2, "mouse_add");