core: Annotate variables only used within assert()s to be PA_UNUSED

supresses a warning when compiling with NDEBUG:

pulsecore/aupdate.c: In function 'pa_aupdate_read_end':
pulsecore/aupdate.c:82:14: warning: variable 'n' set but not used [-Wunused-but-set-variable]
     unsigned n;

pulsecore/sink-input.c: In function 'pa_sink_input_unlink':
pulsecore/sink-input.c:648:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

pulsecore/sink-input.c: In function 'find_filter_sink_input':
pulsecore/sink-input.c:1523:14: warning: unused variable 'i' [-Wunused-variable]
     unsigned i = 0;

pulsecore/sink-input.c: In function 'pa_sink_input_start_move':
pulsecore/sink-input.c:1569:27: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *p = NULL;

  CC       pulsecore/libpulsecore_5.0_la-sink.lo
pulsecore/sink.c: In function 'pa_sink_unlink':
pulsecore/sink.c:673:24: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_sink_input *i, *j = NULL;

   pulsecore/source-output.c: In function 'find_filter_source_output':
pulsecore/source-output.c:1179:9: warning: unused variable 'i' [-Wunused-variable]
     int i = 0;

  CC       pulsecore/libpulsecore_5.0_la-source.lo
pulsecore/source.c: In function 'pa_source_unlink':
pulsecore/source.c:616:27: warning: variable 'j' set but not used [-Wunused-but-set-variable]
     pa_source_output *o, *j = NULL;

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2014-11-09 17:34:11 +01:00 committed by Peter Meerwald
parent 87d188b46c
commit 68cc36140b
7 changed files with 10 additions and 10 deletions

View file

@ -320,7 +320,7 @@ static DBusMessage *profile_new_connection(DBusConnection *conn, DBusMessage *m,
pa_bluetooth_profile_t p; pa_bluetooth_profile_t p;
DBusMessage *r; DBusMessage *r;
int fd; int fd;
const char *sender, *path, *handler; const char *sender, *path, PA_UNUSED *handler;
DBusMessageIter arg_i; DBusMessageIter arg_i;
char *pathfd; char *pathfd;
struct transport_rfcomm *trfc; struct transport_rfcomm *trfc;
@ -331,7 +331,7 @@ static DBusMessage *profile_new_connection(DBusConnection *conn, DBusMessage *m,
} }
handler = dbus_message_get_path(m); handler = dbus_message_get_path(m);
pa_assert (pa_streq(handler, HSP_AG_PROFILE)); pa_assert(pa_streq(handler, HSP_AG_PROFILE));
pa_assert(dbus_message_iter_get_arg_type(&arg_i) == DBUS_TYPE_OBJECT_PATH); pa_assert(dbus_message_iter_get_arg_type(&arg_i) == DBUS_TYPE_OBJECT_PATH);
dbus_message_iter_get_basic(&arg_i, &path); dbus_message_iter_get_basic(&arg_i, &path);

View file

@ -79,7 +79,7 @@ unsigned pa_aupdate_read_begin(pa_aupdate *a) {
} }
void pa_aupdate_read_end(pa_aupdate *a) { void pa_aupdate_read_end(pa_aupdate *a) {
unsigned n; unsigned PA_UNUSED n;
pa_assert(a); pa_assert(a);

View file

@ -644,7 +644,7 @@ static void sink_input_set_state(pa_sink_input *i, pa_sink_input_state_t state)
/* Called from main context */ /* Called from main context */
void pa_sink_input_unlink(pa_sink_input *i) { void pa_sink_input_unlink(pa_sink_input *i) {
bool linked; bool linked;
pa_source_output *o, *p = NULL; pa_source_output *o, PA_UNUSED *p = NULL;
pa_assert(i); pa_assert(i);
pa_assert_ctl_context(); pa_assert_ctl_context();
@ -1519,7 +1519,7 @@ bool pa_sink_input_may_move(pa_sink_input *i) {
} }
static bool find_filter_sink_input(pa_sink_input *target, pa_sink *s) { static bool find_filter_sink_input(pa_sink_input *target, pa_sink *s) {
int i = 0; unsigned PA_UNUSED i = 0;
while (s && s->input_to_master) { while (s && s->input_to_master) {
if (s->input_to_master == target) if (s->input_to_master == target)
return true; return true;
@ -1565,7 +1565,7 @@ bool pa_sink_input_may_move_to(pa_sink_input *i, pa_sink *dest) {
/* Called from main context */ /* Called from main context */
int pa_sink_input_start_move(pa_sink_input *i) { int pa_sink_input_start_move(pa_sink_input *i) {
pa_source_output *o, *p = NULL; pa_source_output *o, PA_UNUSED *p = NULL;
struct volume_factor_entry *v; struct volume_factor_entry *v;
void *state = NULL; void *state = NULL;
int r; int r;

View file

@ -669,7 +669,7 @@ void pa_sink_put(pa_sink* s) {
/* Called from main context */ /* Called from main context */
void pa_sink_unlink(pa_sink* s) { void pa_sink_unlink(pa_sink* s) {
bool linked; bool linked;
pa_sink_input *i, *j = NULL; pa_sink_input *i, PA_UNUSED *j = NULL;
pa_assert(s); pa_assert(s);
pa_assert_ctl_context(); pa_assert_ctl_context();

View file

@ -1175,7 +1175,7 @@ bool pa_source_output_may_move(pa_source_output *o) {
} }
static bool find_filter_source_output(pa_source_output *target, pa_source *s) { static bool find_filter_source_output(pa_source_output *target, pa_source *s) {
int i = 0; unsigned PA_UNUSED i = 0;
while (s && s->output_from_master) { while (s && s->output_from_master) {
if (s->output_from_master == target) if (s->output_from_master == target)
return true; return true;

View file

@ -612,7 +612,7 @@ void pa_source_put(pa_source *s) {
/* Called from main context */ /* Called from main context */
void pa_source_unlink(pa_source *s) { void pa_source_unlink(pa_source *s) {
bool linked; bool linked;
pa_source_output *o, *j = NULL; pa_source_output *o, PA_UNUSED *j = NULL;
pa_assert(s); pa_assert(s);
pa_assert_ctl_context(); pa_assert_ctl_context();

View file

@ -36,7 +36,7 @@
START_TEST (format_test) { START_TEST (format_test) {
pa_format_info *f1 = NULL, *f2 = NULL; pa_format_info *f1 = NULL, *f2 = NULL;
int rates1[] = { 32000, 44100, 48000 }, i, temp_int1 = -1, temp_int2 = -1, *temp_int_array; int rates1[] = { 32000, 44100, 48000 }, i, temp_int1 = -1, PA_UNUSED temp_int2 = -1, *temp_int_array;
const char *strings[] = { "thing1", "thing2", "thing3" }; const char *strings[] = { "thing1", "thing2", "thing3" };
char *temp_str, **temp_str_array; char *temp_str, **temp_str_array;