Skip to content

Commit 42125c6

Browse files
committed
Run clang-format over all header files
1 parent 716fc16 commit 42125c6

File tree

11 files changed

+54
-61
lines changed

11 files changed

+54
-61
lines changed

config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <stdarg.h>
2-
#include <stdio.h>
32
#include <stdbool.h>
3+
#include <stdio.h>
44

5-
bool load_config(char configPath[255], char supportedInput[255], void* p, bool colorsOnly, void* error);
5+
bool load_config(char configPath[255], char supportedInput[255], void *p, bool colorsOnly,
6+
void *error);

debug.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include <stdio.h>
22

33
#ifdef NDEBUG
4-
#define debug(...) do { } while (0)
4+
#define debug(...) \
5+
do { \
6+
} while (0)
57
#else
68
#define debug(...) fprintf(stderr, __VA_ARGS__)
79
#endif

iniparser/src/dictionary.h

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extern "C" {
3131
New types
3232
---------------------------------------------------------------------------*/
3333

34-
3534
/*-------------------------------------------------------------------------*/
3635
/**
3736
@brief Dictionary object
@@ -43,13 +42,12 @@ extern "C" {
4342
*/
4443
/*-------------------------------------------------------------------------*/
4544
typedef struct _dictionary_ {
46-
int n ; /** Number of entries in dictionary */
47-
ssize_t size ; /** Storage size */
48-
char ** val ; /** List of string values */
49-
char ** key ; /** List of string keys */
50-
unsigned * hash ; /** List of hash values for keys */
51-
} dictionary ;
52-
45+
int n; /** Number of entries in dictionary */
46+
ssize_t size; /** Storage size */
47+
char **val; /** List of string values */
48+
char **key; /** List of string keys */
49+
unsigned *hash; /** List of hash values for keys */
50+
} dictionary;
5351

5452
/*---------------------------------------------------------------------------
5553
Function prototypes
@@ -67,7 +65,7 @@ typedef struct _dictionary_ {
6765
by comparing the key itself in last resort.
6866
*/
6967
/*--------------------------------------------------------------------------*/
70-
unsigned dictionary_hash(const char * key);
68+
unsigned dictionary_hash(const char *key);
7169

7270
/*-------------------------------------------------------------------------*/
7371
/**
@@ -80,7 +78,7 @@ unsigned dictionary_hash(const char * key);
8078
dictionary, give size=0.
8179
*/
8280
/*--------------------------------------------------------------------------*/
83-
dictionary * dictionary_new(size_t size);
81+
dictionary *dictionary_new(size_t size);
8482

8583
/*-------------------------------------------------------------------------*/
8684
/**
@@ -91,7 +89,7 @@ dictionary * dictionary_new(size_t size);
9189
Deallocate a dictionary object and all memory associated to it.
9290
*/
9391
/*--------------------------------------------------------------------------*/
94-
void dictionary_del(dictionary * vd);
92+
void dictionary_del(dictionary *vd);
9593

9694
/*-------------------------------------------------------------------------*/
9795
/**
@@ -107,8 +105,7 @@ void dictionary_del(dictionary * vd);
107105
dictionary object, you should not try to free it or modify it.
108106
*/
109107
/*--------------------------------------------------------------------------*/
110-
const char * dictionary_get(const dictionary * d, const char * key, const char * def);
111-
108+
const char *dictionary_get(const dictionary *d, const char *key, const char *def);
112109

113110
/*-------------------------------------------------------------------------*/
114111
/**
@@ -136,7 +133,7 @@ const char * dictionary_get(const dictionary * d, const char * key, const char *
136133
This function returns non-zero in case of failure.
137134
*/
138135
/*--------------------------------------------------------------------------*/
139-
int dictionary_set(dictionary * vd, const char * key, const char * val);
136+
int dictionary_set(dictionary *vd, const char *key, const char *val);
140137

141138
/*-------------------------------------------------------------------------*/
142139
/**
@@ -149,8 +146,7 @@ int dictionary_set(dictionary * vd, const char * key, const char * val);
149146
key cannot be found.
150147
*/
151148
/*--------------------------------------------------------------------------*/
152-
void dictionary_unset(dictionary * d, const char * key);
153-
149+
void dictionary_unset(dictionary *d, const char *key);
154150

155151
/*-------------------------------------------------------------------------*/
156152
/**
@@ -164,7 +160,7 @@ void dictionary_unset(dictionary * d, const char * key);
164160
output file pointers.
165161
*/
166162
/*--------------------------------------------------------------------------*/
167-
void dictionary_dump(const dictionary * d, FILE * out);
163+
void dictionary_dump(const dictionary *d, FILE *out);
168164

169165
#ifdef __cplusplus
170166
}

iniparser/src/iniparser.h

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ extern "C" {
5050
*/
5151
/*--------------------------------------------------------------------------*/
5252

53-
int iniparser_getnsec(const dictionary * d);
54-
53+
int iniparser_getnsec(const dictionary *d);
5554

5655
/*-------------------------------------------------------------------------*/
5756
/**
@@ -68,8 +67,7 @@ int iniparser_getnsec(const dictionary * d);
6867
*/
6968
/*--------------------------------------------------------------------------*/
7069

71-
const char * iniparser_getsecname(const dictionary * d, int n);
72-
70+
const char *iniparser_getsecname(const dictionary *d, int n);
7371

7472
/*-------------------------------------------------------------------------*/
7573
/**
@@ -83,7 +81,7 @@ const char * iniparser_getsecname(const dictionary * d, int n);
8381
*/
8482
/*--------------------------------------------------------------------------*/
8583

86-
void iniparser_dump_ini(const dictionary * d, FILE * f);
84+
void iniparser_dump_ini(const dictionary *d, FILE *f);
8785

8886
/*-------------------------------------------------------------------------*/
8987
/**
@@ -98,7 +96,7 @@ void iniparser_dump_ini(const dictionary * d, FILE * f);
9896
*/
9997
/*--------------------------------------------------------------------------*/
10098

101-
void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
99+
void iniparser_dumpsection_ini(const dictionary *d, const char *s, FILE *f);
102100

103101
/*-------------------------------------------------------------------------*/
104102
/**
@@ -113,7 +111,7 @@ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
113111
purposes mostly.
114112
*/
115113
/*--------------------------------------------------------------------------*/
116-
void iniparser_dump(const dictionary * d, FILE * f);
114+
void iniparser_dump(const dictionary *d, FILE *f);
117115

118116
/*-------------------------------------------------------------------------*/
119117
/**
@@ -123,7 +121,7 @@ void iniparser_dump(const dictionary * d, FILE * f);
123121
@return Number of keys in section
124122
*/
125123
/*--------------------------------------------------------------------------*/
126-
int iniparser_getsecnkeys(const dictionary * d, const char * s);
124+
int iniparser_getsecnkeys(const dictionary *d, const char *s);
127125

128126
/*-------------------------------------------------------------------------*/
129127
/**
@@ -141,8 +139,7 @@ int iniparser_getsecnkeys(const dictionary * d, const char * s);
141139
a string allocated in the dictionary; do not free or modify them.
142140
*/
143141
/*--------------------------------------------------------------------------*/
144-
const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);
145-
142+
const char **iniparser_getseckeys(const dictionary *d, const char *s, const char **keys);
146143

147144
/*-------------------------------------------------------------------------*/
148145
/**
@@ -159,7 +156,7 @@ const char ** iniparser_getseckeys(const dictionary * d, const char * s, const c
159156
the dictionary, do not free or modify it.
160157
*/
161158
/*--------------------------------------------------------------------------*/
162-
const char * iniparser_getstring(const dictionary * d, const char * key, const char * def);
159+
const char *iniparser_getstring(const dictionary *d, const char *key, const char *def);
163160

164161
/*-------------------------------------------------------------------------*/
165162
/**
@@ -188,7 +185,7 @@ const char * iniparser_getstring(const dictionary * d, const char * key, const c
188185
Credits: Thanks to A. Becker for suggesting strtol()
189186
*/
190187
/*--------------------------------------------------------------------------*/
191-
int iniparser_getint(const dictionary * d, const char * key, int notfound);
188+
int iniparser_getint(const dictionary *d, const char *key, int notfound);
192189

193190
/*-------------------------------------------------------------------------*/
194191
/**
@@ -203,7 +200,7 @@ int iniparser_getint(const dictionary * d, const char * key, int notfound);
203200
the notfound value is returned.
204201
*/
205202
/*--------------------------------------------------------------------------*/
206-
double iniparser_getdouble(const dictionary * d, const char * key, double notfound);
203+
double iniparser_getdouble(const dictionary *d, const char *key, double notfound);
207204

208205
/*-------------------------------------------------------------------------*/
209206
/**
@@ -237,8 +234,7 @@ double iniparser_getdouble(const dictionary * d, const char * key, double notfou
237234
necessarily have to be 0 or 1.
238235
*/
239236
/*--------------------------------------------------------------------------*/
240-
int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
241-
237+
int iniparser_getboolean(const dictionary *d, const char *key, int notfound);
242238

243239
/*-------------------------------------------------------------------------*/
244240
/**
@@ -253,8 +249,7 @@ int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
253249
It is Ok to set val to NULL.
254250
*/
255251
/*--------------------------------------------------------------------------*/
256-
int iniparser_set(dictionary * ini, const char * entry, const char * val);
257-
252+
int iniparser_set(dictionary *ini, const char *entry, const char *val);
258253

259254
/*-------------------------------------------------------------------------*/
260255
/**
@@ -266,7 +261,7 @@ int iniparser_set(dictionary * ini, const char * entry, const char * val);
266261
If the given entry can be found, it is deleted from the dictionary.
267262
*/
268263
/*--------------------------------------------------------------------------*/
269-
void iniparser_unset(dictionary * ini, const char * entry);
264+
void iniparser_unset(dictionary *ini, const char *entry);
270265

271266
/*-------------------------------------------------------------------------*/
272267
/**
@@ -280,7 +275,7 @@ void iniparser_unset(dictionary * ini, const char * entry);
280275
of querying for the presence of sections in a dictionary.
281276
*/
282277
/*--------------------------------------------------------------------------*/
283-
int iniparser_find_entry(const dictionary * ini, const char * entry) ;
278+
int iniparser_find_entry(const dictionary *ini, const char *entry);
284279

285280
/*-------------------------------------------------------------------------*/
286281
/**
@@ -296,7 +291,7 @@ int iniparser_find_entry(const dictionary * ini, const char * entry) ;
296291
The returned dictionary must be freed using iniparser_freedict().
297292
*/
298293
/*--------------------------------------------------------------------------*/
299-
dictionary * iniparser_load(const char * ininame);
294+
dictionary *iniparser_load(const char *ininame);
300295

301296
/*-------------------------------------------------------------------------*/
302297
/**
@@ -309,7 +304,7 @@ dictionary * iniparser_load(const char * ininame);
309304
gets out of the current context.
310305
*/
311306
/*--------------------------------------------------------------------------*/
312-
void iniparser_freedict(dictionary * d);
307+
void iniparser_freedict(dictionary *d);
313308

314309
#ifdef __cplusplus
315310
}

input/alsa.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//header file for alsa, part of cava.
2-
3-
void* input_alsa(void* data);
1+
// header file for alsa, part of cava.
42

3+
void *input_alsa(void *data);

input/fifo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
//header files for fifo, part of cava
2-
void* input_fifo(void* data);
3-
int write_to_fftw_input_buffers(int16_t buf[], int16_t frames, void* data);
1+
// header files for fifo, part of cava
2+
void *input_fifo(void *data);
3+
int write_to_fftw_input_buffers(int16_t buf[], int16_t frames, void *data);

input/portaudio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
void* input_portaudio(void *audiodata);
1+
void *input_portaudio(void *audiodata);

input/pulse.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
//header file for pulse, part of cava.
1+
// header file for pulse, part of cava.
22

3-
void* input_pulse(void* data);
3+
void *input_pulse(void *data);
44
void getPulseDefaultSink();
5-

output/raw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
int print_raw_out(int bars_count, int fd, int is_binary, int bit_format,
2-
int ascii_range, char bar_delim, char frame_delim, int const f[200]);
1+
int print_raw_out(int bars_count, int fd, int is_binary, int bit_format, int ascii_range,
2+
char bar_delim, char frame_delim, int const f[200]);

output/terminal_ncurses.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
void init_terminal_ncurses(char* const fg_color_string,
2-
char* const bg_color_string, int predef_fg_color, int predef_bg_color, int gradient,
3-
int gradient_count, char **gradient_colors,int* width, int* height);
4-
void get_terminal_dim_ncurses(int* width, int* height);
5-
int draw_terminal_ncurses(int is_tty, int terminal_height, int terminal_width,
6-
int bars_count, int bar_width, int bar_spacing, int rest, const int f[200],
7-
int flastd[200], int gradient);
1+
void init_terminal_ncurses(char *const fg_color_string, char *const bg_color_string,
2+
int predef_fg_color, int predef_bg_color, int gradient,
3+
int gradient_count, char **gradient_colors, int *width, int *height);
4+
void get_terminal_dim_ncurses(int *width, int *height);
5+
int draw_terminal_ncurses(int is_tty, int terminal_height, int terminal_width, int bars_count,
6+
int bar_width, int bar_spacing, int rest, const int f[200],
7+
int flastd[200], int gradient);
88
void cleanup_terminal_ncurses(void);

0 commit comments

Comments
 (0)