Merge pull request #209 from antiprism/issue207

Fix build errors and warnings if not using ncurses
master
karl 8 years ago committed by GitHub
commit 77656fe8b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      cava.c
  2. 1
      output/terminal_noncurses.c

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

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

Loading…
Cancel
Save