color: do not take pointer to push

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-10 15:32:32 +02:00
parent 45702de158
commit ada6056c89
5 changed files with 12 additions and 12 deletions

View File

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

10
color.c
View File

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

View File

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

4
luaa.c
View File

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

View File

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