aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx/songlib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/sfx/songlib.cpp')
-rw-r--r--engines/sci/sfx/songlib.cpp49
1 files changed, 16 insertions, 33 deletions
diff --git a/engines/sci/sfx/songlib.cpp b/engines/sci/sfx/songlib.cpp
index 909de98da9..4adc1efa25 100644
--- a/engines/sci/sfx/songlib.cpp
+++ b/engines/sci/sfx/songlib.cpp
@@ -31,8 +31,7 @@ namespace Sci {
#define debug_stream stderr
-GTimeVal
-song_sleep_time(GTimeVal *lastslept, long ticks) {
+GTimeVal song_sleep_time(GTimeVal *lastslept, long ticks) {
GTimeVal tv;
long timetosleep;
long timeslept; /* Time already slept */
@@ -54,8 +53,7 @@ song_sleep_time(GTimeVal *lastslept, long ticks) {
}
-GTimeVal
-song_next_wakeup_time(GTimeVal *lastslept, long ticks) {
+GTimeVal song_next_wakeup_time(GTimeVal *lastslept, long ticks) {
GTimeVal retval;
retval.tv_sec = lastslept->tv_sec + (ticks / 60);
@@ -70,8 +68,7 @@ song_next_wakeup_time(GTimeVal *lastslept, long ticks) {
}
-song_t *
-song_new(song_handle_t handle, song_iterator_t *it, int priority) {
+song_t *song_new(song_handle_t handle, song_iterator_t *it, int priority) {
song_t *retval;
retval = (song_t*) sci_malloc(sizeof(song_t));
@@ -93,9 +90,7 @@ song_new(song_handle_t handle, song_iterator_t *it, int priority) {
return retval;
}
-
-void
-song_lib_add(songlib_t songlib, song_t *song) {
+void song_lib_add(songlib_t songlib, song_t *song) {
song_t **seeker = NULL;
int pri = song->priority;
@@ -119,8 +114,8 @@ song_lib_add(songlib_t songlib, song_t *song) {
*seeker = song;
}
-static void /* Recursively free a chain of songs */
-_songfree_chain(song_t *song) {
+static void _songfree_chain(song_t *song) {
+ /* Recursively free a chain of songs */
if (song) {
_songfree_chain(song->next);
songit_free(song->it);
@@ -129,22 +124,18 @@ _songfree_chain(song_t *song) {
}
}
-
-void
-song_lib_init(songlib_t *songlib) {
+void song_lib_init(songlib_t *songlib) {
songlib->lib = &(songlib->_s);
songlib->_s = NULL;
}
-void
-song_lib_free(songlib_t songlib) {
+void song_lib_free(songlib_t songlib) {
_songfree_chain(*(songlib.lib));
*(songlib.lib) = NULL;
}
-song_t *
-song_lib_find(songlib_t songlib, song_handle_t handle) {
+song_t *song_lib_find(songlib_t songlib, song_handle_t handle) {
song_t *seeker = *(songlib.lib);
while (seeker) {
@@ -156,9 +147,7 @@ song_lib_find(songlib_t songlib, song_handle_t handle) {
return seeker;
}
-
-song_t *
-song_lib_find_next_active(songlib_t songlib, song_t *other) {
+song_t *song_lib_find_next_active(songlib_t songlib, song_t *other) {
song_t *seeker = other ? other->next : *(songlib.lib);
while (seeker) {
@@ -175,13 +164,11 @@ song_lib_find_next_active(songlib_t songlib, song_t *other) {
return seeker;
}
-song_t *
-song_lib_find_active(songlib_t songlib) {
+song_t *song_lib_find_active(songlib_t songlib) {
return song_lib_find_next_active(songlib, NULL);
}
-int
-song_lib_remove(songlib_t songlib, song_handle_t handle) {
+int song_lib_remove(songlib_t songlib, song_handle_t handle) {
int retval;
song_t *goner = *(songlib.lib);
@@ -211,8 +198,7 @@ song_lib_remove(songlib_t songlib, song_handle_t handle) {
return retval;
}
-void
-song_lib_resort(songlib_t songlib, song_t *song) {
+void song_lib_resort(songlib_t songlib, song_t *song) {
if (*(songlib.lib) == song)
*(songlib.lib) = song->next;
else {
@@ -228,8 +214,7 @@ song_lib_resort(songlib_t songlib, song_t *song) {
song_lib_add(songlib, song);
}
-int
-song_lib_count(songlib_t songlib) {
+int song_lib_count(songlib_t songlib) {
song_t *seeker = *(songlib.lib);
int retval = 0;
@@ -241,15 +226,13 @@ song_lib_count(songlib_t songlib) {
return retval;
}
-void
-song_lib_set_restore_behavior(songlib_t songlib, song_handle_t handle, RESTORE_BEHAVIOR action) {
+void song_lib_set_restore_behavior(songlib_t songlib, song_handle_t handle, RESTORE_BEHAVIOR action) {
song_t *seeker = song_lib_find(songlib, handle);
seeker->restore_behavior = action;
}
-void
-song_lib_dump(songlib_t songlib, int line) {
+void song_lib_dump(songlib_t songlib, int line) {
song_t *seeker = *(songlib.lib);
fprintf(debug_stream, "L%d:", line);