* mu-msg-prio: some coding updates

This commit is contained in:
Dirk-Jan C. Binnema 2010-11-21 15:43:11 +02:00
parent 29ed5fbcf3
commit 04305eadaa
2 changed files with 11 additions and 18 deletions

View File

@ -34,23 +34,17 @@ mu_msg_prio_name (MuMsgPrio prio)
MuMsgPrio
mu_msg_prio_from_char (char k)
{
switch (k) {
case 'l': return MU_MSG_PRIO_LOW;
case 'n': return MU_MSG_PRIO_NORMAL;
case 'h': return MU_MSG_PRIO_HIGH;
default: g_return_val_if_reached (MU_MSG_PRIO_NONE);
}
g_return_val_if_fail (k == 'l' || k == 'n' || k == 'h',
MU_MSG_PRIO_NONE);
return (MuMsgPrio)k;
}
char
mu_msg_prio_to_char (MuMsgPrio prio)
mu_msg_prio_char (MuMsgPrio prio)
{
switch (prio) {
case MU_MSG_PRIO_LOW : return 'l';
case MU_MSG_PRIO_NORMAL : return 'n';
case MU_MSG_PRIO_HIGH : return 'h';
default : g_return_val_if_reached (0);
}
g_return_val_if_fail (prio == 'l' || prio == 'n' || prio == 'h',
0);
return (char)prio;
}

View File

@ -25,9 +25,9 @@
G_BEGIN_DECLS
enum _MuMsgPrio {
MU_MSG_PRIO_LOW,
MU_MSG_PRIO_NORMAL,
MU_MSG_PRIO_HIGH
MU_MSG_PRIO_LOW = 'l',
MU_MSG_PRIO_NORMAL = 'n',
MU_MSG_PRIO_HIGH = 'h'
};
typedef enum _MuMsgPrio MuMsgPrio;
@ -66,8 +66,7 @@ MuMsgPrio mu_msg_prio_from_char (char k) G_GNUC_CONST;
*
* @return a shortcut character or 0 in case of error
*/
char mu_msg_prio_to_char (MuMsgPrio prio) G_GNUC_CONST;
char mu_msg_prio_char (MuMsgPrio prio) G_GNUC_CONST;
typedef void (*MuMsgPrioForeachFunc) (MuMsgPrio prio, gpointer user_data);
/**