fix clang errors

This commit is contained in:
Felix Buehler 2018-07-08 13:59:21 +02:00
parent a40d7d928f
commit d099a907f6
3 changed files with 84 additions and 79 deletions

View File

@ -88,9 +88,9 @@ extern char *pct_mark;
*outwalk = '\0'; \
if (output_format == O_I3BAR) { \
char *_markup = cfg_getstr(cfg_general, "markup"); \
yajl_gen_string(json_gen, (const unsigned char *) "markup", strlen("markup")); \
yajl_gen_string(json_gen, (const unsigned char *)"markup", strlen("markup")); \
yajl_gen_string(json_gen, (const unsigned char *)_markup, strlen(_markup)); \
yajl_gen_string(json_gen, (const unsigned char *) "full_text", strlen("full_text")); \
yajl_gen_string(json_gen, (const unsigned char *)"full_text", strlen("full_text")); \
yajl_gen_string(json_gen, (const unsigned char *)text, strlen(text)); \
} else { \
printf("%s", text); \
@ -101,7 +101,7 @@ extern char *pct_mark;
do { \
if (output_format == O_I3BAR) { \
yajl_gen_map_open(json_gen); \
yajl_gen_string(json_gen, (const unsigned char *) "name", strlen("name")); \
yajl_gen_string(json_gen, (const unsigned char *)"name", strlen("name")); \
yajl_gen_string(json_gen, (const unsigned char *)name, strlen(name)); \
} \
} while (0)
@ -111,31 +111,31 @@ extern char *pct_mark;
if (output_format == O_I3BAR) { \
char *_align = cfg_getstr(sec, "align"); \
if (_align) { \
yajl_gen_string(json_gen, (const unsigned char *) "align", strlen("align")); \
yajl_gen_string(json_gen, (const unsigned char *)"align", strlen("align")); \
yajl_gen_string(json_gen, (const unsigned char *)_align, strlen(_align)); \
} \
struct min_width *_width = cfg_getptr(sec, "min_width"); \
if (_width) { \
/* if the value can be parsed as a number, we use the numerical value */ \
if (_width->num > 0) { \
yajl_gen_string(json_gen, (const unsigned char *) "min_width", strlen("min_width")); \
yajl_gen_string(json_gen, (const unsigned char *)"min_width", strlen("min_width")); \
yajl_gen_integer(json_gen, _width->num); \
} else { \
yajl_gen_string(json_gen, (const unsigned char *) "min_width", strlen("min_width")); \
yajl_gen_string(json_gen, (const unsigned char *)"min_width", strlen("min_width")); \
yajl_gen_string(json_gen, (const unsigned char *)_width->str, strlen(_width->str)); \
} \
} \
if (cfg_size(sec, "separator") > 0) { \
yajl_gen_string(json_gen, (const unsigned char *) "separator", strlen("separator")); \
yajl_gen_string(json_gen, (const unsigned char *)"separator", strlen("separator")); \
yajl_gen_bool(json_gen, cfg_getbool(sec, "separator")); \
} \
if (cfg_size(sec, "separator_block_width") > 0) { \
yajl_gen_string(json_gen, (const unsigned char *) "separator_block_width", strlen("separator_block_width")); \
yajl_gen_string(json_gen, (const unsigned char *)"separator_block_width", strlen("separator_block_width")); \
yajl_gen_integer(json_gen, cfg_getint(sec, "separator_block_width")); \
} \
const char *_sep = cfg_getstr(cfg_general, "separator"); \
if (strlen(_sep) == 0) { \
yajl_gen_string(json_gen, (const unsigned char *) "separator", strlen("separator")); \
yajl_gen_string(json_gen, (const unsigned char *)"separator", strlen("separator")); \
yajl_gen_bool(json_gen, false); \
} \
yajl_gen_map_close(json_gen); \
@ -151,7 +151,7 @@ extern char *pct_mark;
if (!_val) \
_val = cfg_getstr(cfg_general, colorstr); \
if (output_format == O_I3BAR) { \
yajl_gen_string(json_gen, (const unsigned char *) "color", strlen("color")); \
yajl_gen_string(json_gen, (const unsigned char *)"color", strlen("color")); \
yajl_gen_string(json_gen, (const unsigned char *)_val, strlen(_val)); \
} else { \
outwalk += sprintf(outwalk, "%s", color(colorstr)); \
@ -169,7 +169,7 @@ extern char *pct_mark;
#define INSTANCE(instance) \
do { \
if (output_format == O_I3BAR) { \
yajl_gen_string(json_gen, (const unsigned char *) "instance", strlen("instance")); \
yajl_gen_string(json_gen, (const unsigned char *)"instance", strlen("instance")); \
yajl_gen_string(json_gen, (const unsigned char *)instance, strlen(instance)); \
} \
} while (0)

View File

@ -433,7 +433,10 @@
}
#define CIRCLEQ_HEAD_INITIALIZER(head) \
{ CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
{ \
CIRCLEQ_END(&head) \
, CIRCLEQ_END(&head) \
}
#define CIRCLEQ_ENTRY(type) \
struct { \

View File

@ -14,7 +14,8 @@ typedef struct indexed_volume_s {
char *name;
uint32_t idx;
int volume;
TAILQ_ENTRY(indexed_volume_s) entries;
TAILQ_ENTRY(indexed_volume_s)
entries;
} indexed_volume_t;
static pa_threaded_mainloop *main_loop = NULL;
@ -23,7 +24,8 @@ static pa_mainloop_api *api = NULL;
static bool context_ready = false;
static bool mainloop_thread_running = false;
static uint32_t default_sink_idx = DEFAULT_SINK_INDEX;
TAILQ_HEAD(tailhead, indexed_volume_s) cached_volume =
TAILQ_HEAD(tailhead, indexed_volume_s)
cached_volume =
TAILQ_HEAD_INITIALIZER(cached_volume);
static pthread_mutex_t pulse_mutex = PTHREAD_MUTEX_INITIALIZER;