Merge pull request #313 from Xyene/lint-ci

Add clang-format lint step to CI
master
karl 6 years ago committed by GitHub
commit c99741d870
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      .github/workflows/build-mac.yml
  2. 21
      .github/workflows/build.yml
  3. 5
      config.h
  4. 4
      debug.h
  5. 30
      iniparser/src/dictionary.h
  6. 37
      iniparser/src/iniparser.h
  7. 5
      input/alsa.h
  8. 6
      input/fifo.h
  9. 2
      input/portaudio.h
  10. 5
      input/pulse.h
  11. 4
      output/raw.h
  12. 14
      output/terminal_ncurses.h
  13. 3
      output/terminal_noncurses.h

@ -1,17 +0,0 @@
name: build-mac
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
brew install fftw ncurses libtool automake portaudio iniparser
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Generate configure
run: ./autogen.sh
- name: Run ./configure
run: LDFLAGS="-L/usr/local/opt/ncurses/lib" CPPFLAGS="-I/usr/local/opt/ncurses/include" ./configure
- name: Run make
run: make

@ -1,7 +1,12 @@
name: build
on: [push, pull_request]
jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: DoozyX/clang-format-lint-action@v0.5
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@ -15,3 +20,17 @@ jobs:
run: CPPFLAGS=-I/usr/include/iniparser ./configure
- name: Run make
run: make
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
brew install fftw ncurses libtool automake portaudio iniparser
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Generate configure
run: ./autogen.sh
- name: Run ./configure
run: LDFLAGS="-L/usr/local/opt/ncurses/lib" CPPFLAGS="-I/usr/local/opt/ncurses/include" ./configure
- name: Run make
run: make

@ -1,5 +1,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdio.h>
bool load_config(char configPath[255], char supportedInput[255], void* p, bool colorsOnly, void* error);
bool load_config(char configPath[255], char supportedInput[255], void *p, bool colorsOnly,
void *error);

@ -1,7 +1,9 @@
#include <stdio.h>
#ifdef NDEBUG
#define debug(...) do { } while (0)
#define debug(...) \
do { \
} while (0)
#else
#define debug(...) fprintf(stderr, __VA_ARGS__)
#endif

@ -31,7 +31,6 @@ extern "C" {
New types
---------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*/
/**
@brief Dictionary object
@ -43,13 +42,12 @@ extern "C" {
*/
/*-------------------------------------------------------------------------*/
typedef struct _dictionary_ {
int n ; /** Number of entries in dictionary */
ssize_t size ; /** Storage size */
char ** val ; /** List of string values */
char ** key ; /** List of string keys */
unsigned * hash ; /** List of hash values for keys */
} dictionary ;
int n; /** Number of entries in dictionary */
ssize_t size; /** Storage size */
char **val; /** List of string values */
char **key; /** List of string keys */
unsigned *hash; /** List of hash values for keys */
} dictionary;
/*---------------------------------------------------------------------------
Function prototypes
@ -67,7 +65,7 @@ typedef struct _dictionary_ {
by comparing the key itself in last resort.
*/
/*--------------------------------------------------------------------------*/
unsigned dictionary_hash(const char * key);
unsigned dictionary_hash(const char *key);
/*-------------------------------------------------------------------------*/
/**
@ -80,7 +78,7 @@ unsigned dictionary_hash(const char * key);
dictionary, give size=0.
*/
/*--------------------------------------------------------------------------*/
dictionary * dictionary_new(size_t size);
dictionary *dictionary_new(size_t size);
/*-------------------------------------------------------------------------*/
/**
@ -91,7 +89,7 @@ dictionary * dictionary_new(size_t size);
Deallocate a dictionary object and all memory associated to it.
*/
/*--------------------------------------------------------------------------*/
void dictionary_del(dictionary * vd);
void dictionary_del(dictionary *vd);
/*-------------------------------------------------------------------------*/
/**
@ -107,8 +105,7 @@ void dictionary_del(dictionary * vd);
dictionary object, you should not try to free it or modify it.
*/
/*--------------------------------------------------------------------------*/
const char * dictionary_get(const dictionary * d, const char * key, const char * def);
const char *dictionary_get(const dictionary *d, const char *key, const char *def);
/*-------------------------------------------------------------------------*/
/**
@ -136,7 +133,7 @@ const char * dictionary_get(const dictionary * d, const char * key, const char *
This function returns non-zero in case of failure.
*/
/*--------------------------------------------------------------------------*/
int dictionary_set(dictionary * vd, const char * key, const char * val);
int dictionary_set(dictionary *vd, const char *key, const char *val);
/*-------------------------------------------------------------------------*/
/**
@ -149,8 +146,7 @@ int dictionary_set(dictionary * vd, const char * key, const char * val);
key cannot be found.
*/
/*--------------------------------------------------------------------------*/
void dictionary_unset(dictionary * d, const char * key);
void dictionary_unset(dictionary *d, const char *key);
/*-------------------------------------------------------------------------*/
/**
@ -164,7 +160,7 @@ void dictionary_unset(dictionary * d, const char * key);
output file pointers.
*/
/*--------------------------------------------------------------------------*/
void dictionary_dump(const dictionary * d, FILE * out);
void dictionary_dump(const dictionary *d, FILE *out);
#ifdef __cplusplus
}

@ -50,8 +50,7 @@ extern "C" {
*/
/*--------------------------------------------------------------------------*/
int iniparser_getnsec(const dictionary * d);
int iniparser_getnsec(const dictionary *d);
/*-------------------------------------------------------------------------*/
/**
@ -68,8 +67,7 @@ int iniparser_getnsec(const dictionary * d);
*/
/*--------------------------------------------------------------------------*/
const char * iniparser_getsecname(const dictionary * d, int n);
const char *iniparser_getsecname(const dictionary *d, int n);
/*-------------------------------------------------------------------------*/
/**
@ -83,7 +81,7 @@ const char * iniparser_getsecname(const dictionary * d, int n);
*/
/*--------------------------------------------------------------------------*/
void iniparser_dump_ini(const dictionary * d, FILE * f);
void iniparser_dump_ini(const dictionary *d, FILE *f);
/*-------------------------------------------------------------------------*/
/**
@ -98,7 +96,7 @@ void iniparser_dump_ini(const dictionary * d, FILE * f);
*/
/*--------------------------------------------------------------------------*/
void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
void iniparser_dumpsection_ini(const dictionary *d, const char *s, FILE *f);
/*-------------------------------------------------------------------------*/
/**
@ -113,7 +111,7 @@ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
purposes mostly.
*/
/*--------------------------------------------------------------------------*/
void iniparser_dump(const dictionary * d, FILE * f);
void iniparser_dump(const dictionary *d, FILE *f);
/*-------------------------------------------------------------------------*/
/**
@ -123,7 +121,7 @@ void iniparser_dump(const dictionary * d, FILE * f);
@return Number of keys in section
*/
/*--------------------------------------------------------------------------*/
int iniparser_getsecnkeys(const dictionary * d, const char * s);
int iniparser_getsecnkeys(const dictionary *d, const char *s);
/*-------------------------------------------------------------------------*/
/**
@ -141,8 +139,7 @@ int iniparser_getsecnkeys(const dictionary * d, const char * s);
a string allocated in the dictionary; do not free or modify them.
*/
/*--------------------------------------------------------------------------*/
const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);
const char **iniparser_getseckeys(const dictionary *d, const char *s, const char **keys);
/*-------------------------------------------------------------------------*/
/**
@ -159,7 +156,7 @@ const char ** iniparser_getseckeys(const dictionary * d, const char * s, const c
the dictionary, do not free or modify it.
*/
/*--------------------------------------------------------------------------*/
const char * iniparser_getstring(const dictionary * d, const char * key, const char * def);
const char *iniparser_getstring(const dictionary *d, const char *key, const char *def);
/*-------------------------------------------------------------------------*/
/**
@ -188,7 +185,7 @@ const char * iniparser_getstring(const dictionary * d, const char * key, const c
Credits: Thanks to A. Becker for suggesting strtol()
*/
/*--------------------------------------------------------------------------*/
int iniparser_getint(const dictionary * d, const char * key, int notfound);
int iniparser_getint(const dictionary *d, const char *key, int notfound);
/*-------------------------------------------------------------------------*/
/**
@ -203,7 +200,7 @@ int iniparser_getint(const dictionary * d, const char * key, int notfound);
the notfound value is returned.
*/
/*--------------------------------------------------------------------------*/
double iniparser_getdouble(const dictionary * d, const char * key, double notfound);
double iniparser_getdouble(const dictionary *d, const char *key, double notfound);
/*-------------------------------------------------------------------------*/
/**
@ -237,8 +234,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
necessarily have to be 0 or 1.
*/
/*--------------------------------------------------------------------------*/
int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
int iniparser_getboolean(const dictionary *d, const char *key, int notfound);
/*-------------------------------------------------------------------------*/
/**
@ -253,8 +249,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
It is Ok to set val to NULL.
*/
/*--------------------------------------------------------------------------*/
int iniparser_set(dictionary * ini, const char * entry, const char * val);
int iniparser_set(dictionary *ini, const char *entry, const char *val);
/*-------------------------------------------------------------------------*/
/**
@ -266,7 +261,7 @@ int iniparser_set(dictionary * ini, const char * entry, const char * val);
If the given entry can be found, it is deleted from the dictionary.
*/
/*--------------------------------------------------------------------------*/
void iniparser_unset(dictionary * ini, const char * entry);
void iniparser_unset(dictionary *ini, const char *entry);
/*-------------------------------------------------------------------------*/
/**
@ -280,7 +275,7 @@ void iniparser_unset(dictionary * ini, const char * entry);
of querying for the presence of sections in a dictionary.
*/
/*--------------------------------------------------------------------------*/
int iniparser_find_entry(const dictionary * ini, const char * entry) ;
int iniparser_find_entry(const dictionary *ini, const char *entry);
/*-------------------------------------------------------------------------*/
/**
@ -296,7 +291,7 @@ int iniparser_find_entry(const dictionary * ini, const char * entry) ;
The returned dictionary must be freed using iniparser_freedict().
*/
/*--------------------------------------------------------------------------*/
dictionary * iniparser_load(const char * ininame);
dictionary *iniparser_load(const char *ininame);
/*-------------------------------------------------------------------------*/
/**
@ -309,7 +304,7 @@ dictionary * iniparser_load(const char * ininame);
gets out of the current context.
*/
/*--------------------------------------------------------------------------*/
void iniparser_freedict(dictionary * d);
void iniparser_freedict(dictionary *d);
#ifdef __cplusplus
}

@ -1,4 +1,3 @@
//header file for alsa, part of cava.
void* input_alsa(void* data);
// header file for alsa, part of cava.
void *input_alsa(void *data);

@ -1,3 +1,3 @@
//header files for fifo, part of cava
void* input_fifo(void* data);
int write_to_fftw_input_buffers(int16_t buf[], int16_t frames, void* data);
// header files for fifo, part of cava
void *input_fifo(void *data);
int write_to_fftw_input_buffers(int16_t buf[], int16_t frames, void *data);

@ -1 +1 @@
void* input_portaudio(void *audiodata);
void *input_portaudio(void *audiodata);

@ -1,5 +1,4 @@
//header file for pulse, part of cava.
// header file for pulse, part of cava.
void* input_pulse(void* data);
void *input_pulse(void *data);
void getPulseDefaultSink();

@ -1,2 +1,2 @@
int print_raw_out(int bars_count, int fd, int is_binary, int bit_format,
int ascii_range, char bar_delim, char frame_delim, int const f[200]);
int print_raw_out(int bars_count, int fd, int is_binary, int bit_format, int ascii_range,
char bar_delim, char frame_delim, int const f[200]);

@ -1,8 +1,8 @@
void init_terminal_ncurses(char* const fg_color_string,
char* const bg_color_string, int predef_fg_color, int predef_bg_color, int gradient,
int gradient_count, char **gradient_colors,int* width, int* height);
void get_terminal_dim_ncurses(int* width, int* height);
int draw_terminal_ncurses(int is_tty, int terminal_height, int terminal_width,
int bars_count, int bar_width, int bar_spacing, int rest, const int f[200],
int flastd[200], int gradient);
void init_terminal_ncurses(char *const fg_color_string, char *const bg_color_string,
int predef_fg_color, int predef_bg_color, int gradient,
int gradient_count, char **gradient_colors, int *width, int *height);
void get_terminal_dim_ncurses(int *width, int *height);
int draw_terminal_ncurses(int is_tty, int terminal_height, int terminal_width, int bars_count,
int bar_width, int bar_spacing, int rest, const int f[200],
int flastd[200], int gradient);
void cleanup_terminal_ncurses(void);

@ -1,4 +1,5 @@
int init_terminal_noncurses(int col, int bgcol, int w, int h, int bw);
void get_terminal_dim_noncurses(int *w, int *h);
int draw_terminal_noncurses(int virt, int height, int width, int bars, int bw, int bs, int rest, int f[200], int flastd[200]);
int draw_terminal_noncurses(int virt, int height, int width, int bars, int bw, int bs, int rest,
int f[200], int flastd[200]);
void cleanup_terminal_noncurses(void);

Loading…
Cancel
Save