aboutsummaryrefslogtreecommitdiffstats
path: root/src/list_window.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-16 19:11:36 +0200
committerMax Kellermann <max@duempel.org>2008-09-16 19:11:36 +0200
commit995f5d3e3b6b7f35e44dfe050b7741b67ce13014 (patch)
tree0f0cb4a2e28c4c973762bfad2fe57d0a69668359 /src/list_window.c
parentff86aacd52311a9da80a147226d28f46b35f2ef8 (diff)
downloadmpd-995f5d3e3b6b7f35e44dfe050b7741b67ce13014.tar.gz
mpd-995f5d3e3b6b7f35e44dfe050b7741b67ce13014.tar.xz
mpd-995f5d3e3b6b7f35e44dfe050b7741b67ce13014.zip
code style, indent with tabs II
Follow the same code style als MPD itself.
Diffstat (limited to '')
-rw-r--r--src/list_window.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/list_window.c b/src/list_window.c
index 967f56a7b..01e15c0c5 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -310,50 +310,49 @@ list_window_init_state(void)
list_window_state_t *
list_window_free_state(list_window_state_t *state)
{
- if( state )
- {
- if( state->list )
- {
- GList *list = state->list;
- while( list )
- {
- g_free(list->data);
- list->data = NULL;
- list = list->next;
- }
- g_list_free(state->list);
- state->list = NULL;
+ if (state) {
+ if (state->list) {
+ GList *list = state->list;
+
+ while (list) {
+ g_free(list->data);
+ list->data = NULL;
+ list = list->next;
+ }
+
+ g_list_free(state->list);
+ state->list = NULL;
+ }
+
+ g_free(state);
}
- g_free(state);
- }
- return NULL;
+
+ return NULL;
}
-void
+void
list_window_push_state(list_window_state_t *state, list_window_t *lw)
{
- if( state )
- {
- list_window_t *tmp = g_malloc(sizeof(list_window_t));
- memcpy(tmp, lw, sizeof(list_window_t));
- state->list = g_list_prepend(state->list, (gpointer) tmp);
- list_window_reset(lw);
- }
+ if (state) {
+ list_window_t *tmp = g_malloc(sizeof(list_window_t));
+ memcpy(tmp, lw, sizeof(list_window_t));
+ state->list = g_list_prepend(state->list, (gpointer) tmp);
+ list_window_reset(lw);
+ }
}
bool
list_window_pop_state(list_window_state_t *state, list_window_t *lw)
{
- if( state && state->list )
- {
- list_window_t *tmp = state->list->data;
-
- memcpy(lw, tmp, sizeof(list_window_t));
- g_free(tmp);
- state->list->data = NULL;
- state->list = g_list_delete_link(state->list, state->list);
- }
-
- // return TRUE if there are still states in the list
- return (state && state->list) ? TRUE : FALSE;
+ if (state && state->list) {
+ list_window_t *tmp = state->list->data;
+
+ memcpy(lw, tmp, sizeof(list_window_t));
+ g_free(tmp);
+ state->list->data = NULL;
+ state->list = g_list_delete_link(state->list, state->list);
+ }
+
+ // return TRUE if there are still states in the list
+ return (state && state->list) ? TRUE : FALSE;
}