summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-19 19:02:44 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-19 19:02:44 +0200
commit0afb0992eef469356d0675cc928777f3d8bb80d7 (patch)
tree157e33430c9682f53eaef19a4ff48eadea0eb342
parentc615620964630e8e10b914c6200d414a2748b96f (diff)
downloadpianobar-windows-0afb0992eef469356d0675cc928777f3d8bb80d7.tar.gz
pianobar-windows-0afb0992eef469356d0675cc928777f3d8bb80d7.tar.bz2
pianobar-windows-0afb0992eef469356d0675cc928777f3d8bb80d7.zip
Fix some warnings
Move BarTransformIfShared to ui_act.c and add unistd.h needed by read ()
-rw-r--r--src/ui.c17
-rw-r--r--src/ui_act.c18
2 files changed, 19 insertions, 16 deletions
diff --git a/src/ui.c b/src/ui.c
index a56fd06..098ac87 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -23,6 +23,7 @@ THE SOFTWARE.
/* everything that interacts with the user */
#include <stdio.h>
+#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <readline/readline.h>
@@ -344,19 +345,3 @@ void BarStationFromGenre (PianoHandle_t *ph) {
BarUiPrintPianoStatus (PianoCreateStation (ph, "sh", curStation->id));
}
-/* transform station if necessary to allow changes like rename, rate, ...
- * @param piano handle
- * @param transform this station
- * @return 0 = error, 1 = everything went well
- */
-int BarTransformIfShared (PianoHandle_t *ph, PianoStation_t *station) {
- /* shared stations must be transformed */
- if (!station->isCreator) {
- BarUiMsg ("Transforming station... ");
- if (BarUiPrintPianoStatus (PianoTransformShared (ph, station)) !=
- PIANO_RET_OK) {
- return 0;
- }
- }
- return 1;
-}
diff --git a/src/ui_act.c b/src/ui_act.c
index 41b1356..f027594 100644
--- a/src/ui_act.c
+++ b/src/ui_act.c
@@ -23,6 +23,7 @@ THE SOFTWARE.
/* functions responding to user's keystrokes */
#include <string.h>
+#include <unistd.h>
/* needed by readline */
#include <stdio.h>
#include <readline/readline.h>
@@ -38,6 +39,23 @@ THE SOFTWARE.
BarUiMsg ("No song playing.\n"); \
return; }
+/* transform station if necessary to allow changes like rename, rate, ...
+ * @param piano handle
+ * @param transform this station
+ * @return 0 = error, 1 = everything went well
+ */
+int BarTransformIfShared (PianoHandle_t *ph, PianoStation_t *station) {
+ /* shared stations must be transformed */
+ if (!station->isCreator) {
+ BarUiMsg ("Transforming station... ");
+ if (BarUiPrintPianoStatus (PianoTransformShared (ph, station)) !=
+ PIANO_RET_OK) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
/* print current shortcut configuration
*/
void BarUiActHelp (BAR_KS_ARGS) {