util: position_tostr() return const

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-01 16:33:24 +02:00
parent 99fe611d31
commit a816ce0440
2 changed files with 8 additions and 14 deletions

View File

@ -124,23 +124,17 @@ position_fromstr(const char *pos, ssize_t len)
* \param p The position. * \param p The position.
* \return A position string. * \return A position string.
*/ */
char * const char *
position_tostr(position_t p) position_tostr(position_t p)
{ {
switch(p) switch(p)
{ {
case Top: case Top: return "top";
return a_strdup("top"); case Bottom: return "bottom";
case Bottom: case Right: return "right";
return a_strdup("bottom"); case Left: return "left";
case Right: case Auto: return "auto";
return a_strdup("right"); default: return "off";
case Left:
return a_strdup("left");
case Auto:
return a_strdup("auto");
default:
return a_strdup("off");
} }
} }

View File

@ -324,7 +324,7 @@ void _warn(int, const char *, const char *, ...)
__attribute__ ((format(printf, 3, 4))); __attribute__ ((format(printf, 3, 4)));
position_t position_fromstr(const char *, ssize_t); position_t position_fromstr(const char *, ssize_t);
char * position_tostr(position_t); const char * position_tostr(position_t);
void *name_func_lookup(const char *, const name_func_link_t *); void *name_func_lookup(const char *, const name_func_link_t *);
const char * name_func_rlookup(void *, const name_func_link_t *); const char * name_func_rlookup(void *, const name_func_link_t *);
void a_exec(const char *); void a_exec(const char *);