From ada6056c89b3d63281cc38cab8eede5171e3c799 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 10 Aug 2009 15:32:32 +0200 Subject: [PATCH] color: do not take pointer to push Signed-off-by: Julien Danjou --- client.c | 2 +- color.c | 10 +++++----- color.h | 2 +- luaa.c | 4 ++-- wibox.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/client.c b/client.c index 5a8df3f76..a5d15be3e 100644 --- a/client.c +++ b/client.c @@ -1761,7 +1761,7 @@ luaA_client_index(lua_State *L) lua_pushnumber(L, c->border); break; case A_TK_BORDER_COLOR: - luaA_pushxcolor(L, &c->border_color); + luaA_pushxcolor(L, c->border_color); break; case A_TK_TITLEBAR: return wibox_push(L, c->titlebar); diff --git a/color.c b/color.c index 51365729e..0fb929ca1 100644 --- a/color.c +++ b/color.c @@ -294,12 +294,12 @@ xcolor_to_color(const xcolor_t *xcol, color_t *col) * \return The number of elements pushed on stack. */ int -luaA_pushxcolor(lua_State *L, const xcolor_t *c) +luaA_pushxcolor(lua_State *L, const xcolor_t c) { - uint8_t r = (unsigned)c->red * 0xff / 0xffff; - uint8_t g = (unsigned)c->green * 0xff / 0xffff; - uint8_t b = (unsigned)c->blue * 0xff / 0xffff; - uint8_t a = (unsigned)c->alpha * 0xff / 0xffff; + uint8_t r = (unsigned) c.red * 0xff / 0xffff; + uint8_t g = (unsigned) c.green * 0xff / 0xffff; + uint8_t b = (unsigned) c.blue * 0xff / 0xffff; + uint8_t a = (unsigned) c.alpha * 0xff / 0xffff; char s[10]; int len; /* do not print alpha if it's full */ diff --git a/color.h b/color.h index 0b3e21bfd..5f60ea4dd 100644 --- a/color.h +++ b/color.h @@ -76,7 +76,7 @@ bool xcolor_init_reply(xcolor_init_request_t); bool xcolor_to_color(const xcolor_t *, color_t *); -int luaA_pushxcolor(lua_State *, const xcolor_t *); +int luaA_pushxcolor(lua_State *, const xcolor_t); int luaA_pushcolor(lua_State *, const color_t *); #endif diff --git a/luaa.c b/luaa.c index 5f7d23b60..cef0fff6c 100644 --- a/luaa.c +++ b/luaa.c @@ -558,10 +558,10 @@ luaA_awesome_index(lua_State *L) lua_pushstring(L, globalconf.conffile); break; case A_TK_FG: - luaA_pushxcolor(L, &globalconf.colors.fg); + luaA_pushxcolor(L, globalconf.colors.fg); break; case A_TK_BG: - luaA_pushxcolor(L, &globalconf.colors.bg); + luaA_pushxcolor(L, globalconf.colors.bg); break; case A_TK_VERSION: lua_pushliteral(L, AWESOME_VERSION); diff --git a/wibox.c b/wibox.c index bdfa37601..a37ea2d7c 100644 --- a/wibox.c +++ b/wibox.c @@ -861,7 +861,7 @@ luaA_wibox_index(lua_State *L) lua_pushnumber(L, wibox->border.width); break; case A_TK_BORDER_COLOR: - luaA_pushxcolor(L, &wibox->border.color); + luaA_pushxcolor(L, wibox->border.color); break; case A_TK_ALIGN: if(wibox->type == WIBOX_TYPE_NORMAL) @@ -869,10 +869,10 @@ luaA_wibox_index(lua_State *L) lua_pushstring(L, draw_align_tostr(wibox->align)); break; case A_TK_FG: - luaA_pushxcolor(L, &wibox->ctx.fg); + luaA_pushxcolor(L, wibox->ctx.fg); break; case A_TK_BG: - luaA_pushxcolor(L, &wibox->ctx.bg); + luaA_pushxcolor(L, wibox->ctx.bg); break; case A_TK_BG_IMAGE: luaA_object_push_item(L, 1, wibox->bg_image);