Fix build errors and warnings if not using ncurses

master
Adrian Rossiter 8 years ago
parent cbe6d5672e
commit 45627faa42
  1. 30
      cava.c
  2. 1
      output/terminal_noncurses.c

@ -91,7 +91,11 @@ int should_reload = 0;
void cleanup(void) void cleanup(void)
{ {
if (output_mode == 1 || output_mode == 2 ) { if (output_mode == 1 || output_mode == 2 ) {
#ifdef NCURSES
cleanup_terminal_ncurses(); cleanup_terminal_ncurses();
#else
;
#endif
} }
else if (output_mode ==3 ) { else if (output_mode ==3 ) {
cleanup_terminal_noncurses(); cleanup_terminal_noncurses();
@ -124,8 +128,8 @@ static bool is_loop_device_for_sure(const char * text) {
static bool directory_exists(const char * path) { static bool directory_exists(const char * path) {
DIR * const dir = opendir(path); DIR * const dir = opendir(path);
bool exists;// = dir != NULL; bool exists;// = dir != NULL;
if (dir == NULL) exists = FALSE; if (dir == NULL) exists = false;
else exists = TRUE; else exists = true;
closedir(dir); closedir(dir);
return exists; return exists;
} }
@ -423,8 +427,8 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
bool reloadConf = FALSE; bool reloadConf = false;
bool senseLow = TRUE; bool senseLow = true;
while (!reloadConf) {//jumbing back to this loop means that you resized the screen while (!reloadConf) {//jumbing back to this loop means that you resized the screen
for (i = 0; i < 200; i++) { for (i = 0; i < 200; i++) {
@ -586,7 +590,7 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
if (p.stereo) bars = bars * 2; if (p.stereo) bars = bars * 2;
bool resizeTerminal = FALSE; bool resizeTerminal = false;
while (!resizeTerminal) { while (!resizeTerminal) {
@ -604,11 +608,11 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
break; break;
case 68: // key right case 68: // key right
p.bw++; p.bw++;
resizeTerminal = TRUE; resizeTerminal = true;
break; break;
case 67: // key left case 67: // key left
if (p.bw > 1) p.bw--; if (p.bw > 1) p.bw--;
resizeTerminal = TRUE; resizeTerminal = true;
break; break;
case 'r': //reload config case 'r': //reload config
should_reload = 1; should_reload = 1;
@ -616,12 +620,12 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
case 'c': //change forground color case 'c': //change forground color
if (p.col < 7) p.col++; if (p.col < 7) p.col++;
else p.col = 0; else p.col = 0;
resizeTerminal = TRUE; resizeTerminal = true;
break; break;
case 'b': //change backround color case 'b': //change backround color
if (p.bgcol < 7) p.bgcol++; if (p.bgcol < 7) p.bgcol++;
else p.bgcol = 0; else p.bgcol = 0;
resizeTerminal = TRUE; resizeTerminal = true;
break; break;
case 'q': case 'q':
@ -631,8 +635,8 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
if (should_reload) { if (should_reload) {
reloadConf = TRUE; reloadConf = true;
resizeTerminal = TRUE; resizeTerminal = true;
should_reload = 0; should_reload = 0;
} }
@ -771,7 +775,7 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
if (p.autosens) { if (p.autosens) {
for (o = 0; o < bars; o++) { for (o = 0; o < bars; o++) {
if (f[o] > height ) { if (f[o] > height ) {
senseLow = FALSE; senseLow = false;
p.sens = p.sens * 0.985; p.sens = p.sens * 0.985;
break; break;
} }
@ -806,7 +810,7 @@ as of 0.4.0 all options are specified in config file, see in '/home/username/.co
} }
//terminal has been resized breaking to recalibrating values //terminal has been resized breaking to recalibrating values
if (rc == -1) resizeTerminal = TRUE; if (rc == -1) resizeTerminal = true;
if (p.framerate <= 1) { if (p.framerate <= 1) {
req.tv_sec = 1 / (float)p.framerate; req.tv_sec = 1 / (float)p.framerate;

@ -1,6 +1,7 @@
#include <locale.h> #include <locale.h>
#include <wchar.h> #include <wchar.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <termios.h> #include <termios.h>
#include <unistd.h> #include <unistd.h>

Loading…
Cancel
Save