From 121b3425207bf4d0d567f44f75b1d2b28af889d4 Mon Sep 17 00:00:00 2001 From: Hyunseok Lee Date: Wed, 30 Nov 2016 08:59:39 +0900 Subject: [PATCH] Remove pa_bool_t and replace it with bool refered d806b197144733607b0ecb8678c6ee5d99ccc9ea from upstream [Version] 5.0.102 [Profile] Common [Issue Type] Clean up Change-Id: Iddad0d16b1b7ec1ce6f7b3a1b035aff2b5e46ea0 --- packaging/pulseaudio.spec | 2 +- src/modules/alsa/alsa-util.c | 2 +- src/modules/alsa/alsa-util.h | 2 +- src/modules/bluetooth/module-bluez4-device.c | 4 ++-- src/modules/bluetooth/module-bluez5-device.c | 4 ++-- src/pulsecore/core.h | 8 ++++---- src/pulsecore/macro.h | 7 ------- src/pulsecore/protocol-native.c | 16 ++++++++-------- src/pulsecore/sink-input.c | 6 +++--- src/pulsecore/sink.h | 2 +- src/pulsecore/source.h | 2 +- 11 files changed, 24 insertions(+), 31 deletions(-) diff --git a/packaging/pulseaudio.spec b/packaging/pulseaudio.spec index bf0e5e4..9d3670c 100644 --- a/packaging/pulseaudio.spec +++ b/packaging/pulseaudio.spec @@ -11,7 +11,7 @@ Name: pulseaudio Summary: Improved Linux sound server Version: 5.0 -Release: 101 +Release: 102 Group: Multimedia/Audio License: LGPL-2.1+ URL: http://pulseaudio.org diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 39ab3ed..c0b3f28 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -1466,7 +1466,7 @@ bool pa_alsa_pcm_is_modem(snd_pcm_t *pcm) { } #ifdef __TIZEN__ -pa_bool_t pa_alsa_pcm_is_voip(snd_pcm_t *pcm) { +bool pa_alsa_pcm_is_voip(snd_pcm_t *pcm) { const char *id = NULL; snd_pcm_info_t* info; snd_pcm_info_alloca(&info); diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index bcdf26c..7a556c6 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -159,7 +159,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_ bool pa_alsa_pcm_is_hw(snd_pcm_t *pcm); bool pa_alsa_pcm_is_modem(snd_pcm_t *pcm); #ifdef __TIZEN__ -pa_bool_t pa_alsa_pcm_is_voip(snd_pcm_t *pcm); +bool pa_alsa_pcm_is_voip(snd_pcm_t *pcm); #endif const char* pa_alsa_strerror(int errnum); diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c index 6b775b7..1ece721 100644 --- a/src/modules/bluetooth/module-bluez4-device.c +++ b/src/modules/bluetooth/module-bluez4-device.c @@ -111,7 +111,7 @@ struct a2dp_info { size_t codesize, frame_length; /* SBC Codesize, frame_length. We simply cache those values here */ #ifdef BLUETOOTH_APTX_SUPPORT - pa_bool_t aptx_initialized; /* Keep track if the encoder is initialized */ + bool aptx_initialized; /* Keep track if the encoder is initialized */ void *aptx; /* Codec data */ #endif void* buffer; /* Codec transfer buffer */ @@ -221,7 +221,7 @@ int (*aptx_encode)(void* _state, void* _pcmL, void* _pcmR, void* _buffer); const char *aptx_new_name = "NewAptxEnc"; const char *aptx_encode_name = "aptxbtenc_encodestereo"; -static pa_bool_t pa_load_aptx_sym(void *handle ) +static bool pa_load_aptx_sym(void *handle ) { if (!handle) return FALSE; diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c index 332b21a..809607b 100644 --- a/src/modules/bluetooth/module-bluez5-device.c +++ b/src/modules/bluetooth/module-bluez5-device.c @@ -101,7 +101,7 @@ typedef struct sbc_info { uint8_t min_bitpool; uint8_t max_bitpool; #ifdef BLUETOOTH_APTX_SUPPORT - pa_bool_t aptx_initialized; /* Keep track if the encoder is initialized */ + bool aptx_initialized; /* Keep track if the encoder is initialized */ void *aptx; /* aptx Codec data */ #endif void* buffer; /* Codec transfer buffer */ @@ -248,7 +248,7 @@ int (*aptx_encode)(void* _state, void* _pcmL, void* _pcmR, void* _buffer); const char *aptx_new_name = "NewAptxEnc"; const char *aptx_encode_name = "aptxbtenc_encodestereo"; -static pa_bool_t pa_load_aptx_sym(void *handle ) +static bool pa_load_aptx_sym(void *handle ) { if (!handle) return false; diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h index 9ea76ef..6d29382 100644 --- a/src/pulsecore/core.h +++ b/src/pulsecore/core.h @@ -201,10 +201,10 @@ struct pa_core { pa_hook hooks[PA_CORE_HOOK_MAX]; #ifdef __TIZEN__ - pa_bool_t dump_sink; - pa_bool_t dump_sink_input; - pa_bool_t dump_source; - pa_bool_t dump_source_output; + bool dump_sink; + bool dump_sink_input; + bool dump_source; + bool dump_source_output; int zero_pop_threshold; #endif diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h index 3fd3778..4d5e80f 100644 --- a/src/pulsecore/macro.h +++ b/src/pulsecore/macro.h @@ -57,13 +57,6 @@ #define PA_PAGE_SIZE ((size_t) 4096) #endif -#ifdef __TIZEN__ -typedef int pa_bool_t; -#else -typedef bool pa_bool_t; -#endif - - /* Rounds down */ static inline void* PA_ALIGN_PTR(const void *p) { return (void*) (((size_t) p) & ~(sizeof(void*) - 1)); diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c index 7087223..453fbf1 100644 --- a/src/pulsecore/protocol-native.c +++ b/src/pulsecore/protocol-native.c @@ -1682,7 +1682,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int #ifdef __TIZEN__ if (code == SINK_INPUT_MESSAGE_FLUSH) { pa_log_debug("Requesting rewind due to rewrite. Flush old data in sink"); - pa_sink_input_request_rewind(s->sink_input, 0, FALSE, TRUE, FALSE); + pa_sink_input_request_rewind(s->sink_input, 0, false, true, false); } #endif @@ -4109,10 +4109,10 @@ static void command_set_volume_ramp( if (sink) { pa_log_debug("Client %s changes volume ramp of sink %s.", client_name, sink->name); - pa_sink_set_volume_ramp(sink, &ramp, TRUE, TRUE); + pa_sink_set_volume_ramp(sink, &ramp, true, true); } else if (si) { pa_log_debug("Client %s changes volume ramp of sink input %s.", client_name, pa_strnull(pa_proplist_gets(si->proplist, PA_PROP_MEDIA_NAME))); - pa_sink_input_set_volume_ramp(si, &ramp, TRUE, TRUE); + pa_sink_input_set_volume_ramp(si, &ramp, true, true); } pa_pstream_send_simple_ack(c->pstream, tag); @@ -4668,7 +4668,7 @@ static void command_set_default_sink_or_source(pa_pdispatch *pd, uint32_t comman static void command_set_default_sink_by_api_bus(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) { pa_native_connection *c = PA_NATIVE_CONNECTION(userdata); pa_sink *sink; - pa_bool_t found = FALSE; + bool found = false; const char *api, *bus; const char *api_string, *bus_string, *form_factor; uint32_t idx; @@ -4700,7 +4700,7 @@ static void command_set_default_sink_by_api_bus(pa_pdispatch *pd, uint32_t comma pa_log_debug("Found bus = [%s]\n", bus_string); if(!strcmp(bus, bus_string)) { pa_log_debug(" ** FOUND!!! set default sink to [%s]\n", sink->name); - found = TRUE; + found = true; break; } else { pa_log_debug("No string [%s] match, match with form_factor = internal\n", bus); @@ -4708,7 +4708,7 @@ static void command_set_default_sink_by_api_bus(pa_pdispatch *pd, uint32_t comma if (form_factor) { if(!strcmp(form_factor, "internal")) { pa_log_debug("Found internal device(sink) , set (%s) as default sink", sink->name); - found = TRUE; + found = true; break; } } @@ -4720,7 +4720,7 @@ static void command_set_default_sink_by_api_bus(pa_pdispatch *pd, uint32_t comma pa_log_debug(" Found no bus "); if (!strcmp(DEVICE_BUS_BUILTIN, bus)) { pa_log_debug(" searching bus was builtin, then select this"); - found = TRUE; + found = true; break; } } @@ -4745,7 +4745,7 @@ static void command_set_default_sink_by_api_bus(pa_pdispatch *pd, uint32_t comma static void command_set_default_sink_for_usb(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) { pa_native_connection *c = PA_NATIVE_CONNECTION(userdata); pa_sink *sink; - pa_bool_t found = FALSE; + bool found = false; const char *serial; const char *s; uint32_t idx; diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c index 999527a..612f481 100644 --- a/src/pulsecore/sink-input.c +++ b/src/pulsecore/sink-input.c @@ -849,8 +849,8 @@ void pa_sink_input_put(pa_sink_input *i) { update_n_corked(i, state); i->state = state; - i->corked = FALSE; - i->corked_internal = FALSE; + i->corked = false; + i->corked_internal = false; /* We might need to update the sink's volume if we are in flat volume mode. */ if (pa_sink_flat_volume_enabled(i->sink)) @@ -2157,7 +2157,7 @@ int pa_sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int64_t /* we have ongoing ramp where we take current start values */ pa_cvolume_ramp_start_from(&i->thread_info.ramp, &i->ramp); i->thread_info.ramp = i->ramp; - pa_sink_input_request_rewind(i, 0, TRUE, FALSE, FALSE); + pa_sink_input_request_rewind(i, 0, true, false, false); return 0; case PA_SINK_INPUT_MESSAGE_SET_SOFT_MUTE: diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h index 830a40e..8249556 100644 --- a/src/pulsecore/sink.h +++ b/src/pulsecore/sink.h @@ -314,7 +314,7 @@ struct pa_sink { FILE *dump_fp; pa_hashmap *device_types; void* device_item; - pa_bool_t use_internal_codec; + bool use_internal_codec; #endif void *userdata; diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h index 28c163d..28bfbf4 100644 --- a/src/pulsecore/source.h +++ b/src/pulsecore/source.h @@ -249,7 +249,7 @@ struct pa_source { pa_hashmap *device_types; FILE *dump_fp; void* device_item; - pa_bool_t use_internal_codec; + bool use_internal_codec; #endif void *userdata; -- 2.7.4