From d806b197144733607b0ecb8678c6ee5d99ccc9ea Mon Sep 17 00:00:00 2001 From: "poljar (Damir Jelić)" Date: Thu, 27 Jun 2013 19:28:09 +0200 Subject: Remove pa_bool_t and replace it with bool. commands used for this (executed from the pulseaudio/src directory): find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \ -a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \ -a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \ -a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \ -exec sed -i -e 's/\bpa_bool_t\b/bool/g' \ -e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \; and: sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \ -e '181,194!s/\bTRUE\b/true/' -e \ '181,194!s/\bFALSE\b/false/' pulsecore/macro.h --- src/daemon/cmdline.c | 4 +- src/daemon/cpulimit.c | 6 +- src/daemon/daemon-conf.c | 76 +++---- src/daemon/daemon-conf.h | 4 +- src/daemon/main.c | 38 ++-- src/daemon/server-lookup.c | 8 +- src/modules/alsa/alsa-mixer.c | 200 ++++++++--------- src/modules/alsa/alsa-mixer.h | 40 ++-- src/modules/alsa/alsa-sink.c | 160 ++++++------- src/modules/alsa/alsa-source.c | 144 ++++++------ src/modules/alsa/alsa-ucm.c | 26 +-- src/modules/alsa/alsa-util.c | 80 +++---- src/modules/alsa/alsa-util.h | 38 ++-- src/modules/alsa/module-alsa-card.c | 30 +-- src/modules/alsa/module-alsa-sink.c | 2 +- src/modules/alsa/module-alsa-source.c | 2 +- src/modules/dbus/iface-card.c | 2 +- src/modules/dbus/iface-client.c | 2 +- src/modules/dbus/iface-core.c | 14 +- src/modules/dbus/iface-device.c | 64 +++--- src/modules/dbus/iface-module.c | 2 +- src/modules/dbus/iface-stream.c | 26 +-- src/modules/dbus/module-dbus-protocol.c | 36 +-- src/modules/echo-cancel/adrian.c | 6 +- src/modules/echo-cancel/echo-cancel.h | 14 +- src/modules/echo-cancel/module-echo-cancel.c | 82 +++---- src/modules/echo-cancel/null.c | 4 +- src/modules/echo-cancel/speex.c | 24 +- src/modules/echo-cancel/webrtc.cc | 30 +-- src/modules/gconf/module-gconf.c | 8 +- src/modules/jack/module-jack-sink.c | 12 +- src/modules/jack/module-jack-source.c | 12 +- src/modules/jack/module-jackdbus-detect.c | 16 +- src/modules/macosx/module-bonjour-publish.c | 4 +- src/modules/macosx/module-coreaudio-detect.c | 14 +- src/modules/macosx/module-coreaudio-device.c | 40 ++-- src/modules/module-always-sink.c | 14 +- src/modules/module-augment-properties.c | 14 +- src/modules/module-card-restore.c | 14 +- src/modules/module-cli.c | 10 +- src/modules/module-combine-sink.c | 72 +++--- src/modules/module-combine.c | 4 +- src/modules/module-console-kit.c | 6 +- src/modules/module-default-device-restore.c | 12 +- src/modules/module-defs.h.m4 | 2 +- src/modules/module-detect.c | 6 +- src/modules/module-device-manager.c | 80 +++---- src/modules/module-device-restore.c | 140 ++++++------ src/modules/module-equalizer-sink.c | 68 +++--- src/modules/module-esound-compat-spawnfd.c | 4 +- src/modules/module-esound-compat-spawnpid.c | 4 +- src/modules/module-esound-sink.c | 22 +- src/modules/module-filter-apply.c | 88 ++++---- src/modules/module-filter-heuristics.c | 12 +- src/modules/module-hal-detect-compat.c | 6 +- src/modules/module-intended-roles.c | 30 +-- src/modules/module-ladspa-sink.c | 40 ++-- src/modules/module-lirc.c | 16 +- src/modules/module-loopback.c | 42 ++-- src/modules/module-match.c | 2 +- src/modules/module-mmkbd-evdev.c | 12 +- src/modules/module-native-protocol-fd.c | 4 +- src/modules/module-null-sink.c | 4 +- src/modules/module-null-source.c | 4 +- src/modules/module-pipe-sink.c | 4 +- src/modules/module-pipe-source.c | 4 +- src/modules/module-position-event-sounds.c | 2 +- src/modules/module-protocol-stub.c | 8 +- src/modules/module-remap-sink.c | 14 +- src/modules/module-rescue-streams.c | 10 +- src/modules/module-role-cork.c | 36 +-- src/modules/module-rygel-media-server.c | 36 +-- src/modules/module-sine-source.c | 4 +- src/modules/module-sine.c | 8 +- src/modules/module-solaris.c | 42 ++-- src/modules/module-stream-restore.c | 176 +++++++-------- src/modules/module-suspend-on-idle.c | 10 +- src/modules/module-switch-on-connect.c | 6 +- src/modules/module-switch-on-port-available.c | 12 +- src/modules/module-systemd-login.c | 2 +- src/modules/module-tunnel.c | 146 ++++++------ src/modules/module-udev-detect.c | 48 ++-- src/modules/module-virtual-sink.c | 24 +- src/modules/module-virtual-source.c | 22 +- src/modules/module-virtual-surround-sink.c | 24 +- src/modules/module-volume-restore.c | 6 +- src/modules/module-waveout.c | 10 +- src/modules/module-zeroconf-discover.c | 16 +- src/modules/module-zeroconf-publish.c | 16 +- src/modules/oss/module-oss.c | 100 ++++----- src/modules/raop/module-raop-discover.c | 10 +- src/modules/raop/module-raop-sink.c | 14 +- src/modules/raop/raop_client.c | 4 +- src/modules/reserve-wrap.c | 4 +- src/modules/reserve-wrap.h | 2 +- src/modules/rtp/headerlist.c | 8 +- src/modules/rtp/module-rtp-recv.c | 22 +- src/modules/rtp/module-rtp-send.c | 8 +- src/modules/rtp/rtp.c | 4 +- src/modules/rtp/rtsp_client.c | 2 +- src/modules/rtp/sap.c | 4 +- src/modules/rtp/sap.h | 4 +- src/modules/rtp/sdp.c | 6 +- src/modules/x11/module-x11-bell.c | 4 +- src/modules/x11/module-x11-cork-request.c | 4 +- src/modules/x11/module-x11-publish.c | 6 +- src/modules/x11/module-x11-xsmp.c | 10 +- src/modules/xen/module-xenpv-sink.c | 4 +- src/pulse/channelmap.c | 8 +- src/pulse/channelmap.h | 2 +- src/pulse/client-conf-x11.c | 8 +- src/pulse/client-conf.c | 24 +- src/pulse/client-conf.h | 4 +- src/pulse/context.c | 28 +-- src/pulse/ext-device-manager.c | 4 +- src/pulse/ext-device-restore.c | 4 +- src/pulse/ext-stream-restore.c | 6 +- src/pulse/fork-detect.c | 6 +- src/pulse/format.c | 14 +- src/pulse/internal.h | 42 ++-- src/pulse/introspect.c | 38 ++-- src/pulse/mainloop.c | 80 +++---- src/pulse/proplist.c | 20 +- src/pulse/scache.c | 4 +- src/pulse/simple.c | 6 +- src/pulse/stream.c | 170 +++++++------- src/pulse/thread-mainloop.c | 2 +- src/pulse/utf8.c | 18 +- src/pulse/volume.c | 24 +- src/pulse/volume.h | 2 +- src/pulsecore/asyncmsgq.c | 18 +- src/pulsecore/asyncmsgq.h | 6 +- src/pulsecore/asyncq.c | 26 +-- src/pulsecore/asyncq.h | 4 +- src/pulsecore/atomic.h | 34 +-- src/pulsecore/aupdate.c | 8 +- src/pulsecore/auth-cookie.c | 2 +- src/pulsecore/auth-cookie.h | 2 +- src/pulsecore/authkey.c | 8 +- src/pulsecore/authkey.h | 4 +- src/pulsecore/bitset.c | 10 +- src/pulsecore/bitset.h | 6 +- src/pulsecore/card.c | 8 +- src/pulsecore/card.h | 10 +- src/pulsecore/cli-command.c | 310 +++++++++++++------------- src/pulsecore/cli-command.h | 10 +- src/pulsecore/cli-text.c | 20 +- src/pulsecore/cli.c | 6 +- src/pulsecore/conf-parser.c | 10 +- src/pulsecore/conf-parser.h | 2 +- src/pulsecore/core-rtclock.c | 10 +- src/pulsecore/core-rtclock.h | 4 +- src/pulsecore/core-scache.c | 16 +- src/pulsecore/core-scache.h | 4 +- src/pulsecore/core-subscribe.c | 6 +- src/pulsecore/core-util.c | 86 +++---- src/pulsecore/core-util.h | 28 +-- src/pulsecore/core.c | 30 +-- src/pulsecore/core.h | 20 +- src/pulsecore/cpu-arm.c | 6 +- src/pulsecore/cpu-arm.h | 2 +- src/pulsecore/cpu-orc.c | 6 +- src/pulsecore/cpu-orc.h | 2 +- src/pulsecore/cpu-x86.c | 6 +- src/pulsecore/cpu-x86.h | 2 +- src/pulsecore/database-gdbm.c | 4 +- src/pulsecore/database-simple.c | 18 +- src/pulsecore/database-tdb.c | 4 +- src/pulsecore/database.h | 4 +- src/pulsecore/dbus-shared.c | 2 +- src/pulsecore/dbus-util.c | 16 +- src/pulsecore/dbus-util.h | 4 +- src/pulsecore/hashmap.c | 2 +- src/pulsecore/hashmap.h | 4 +- src/pulsecore/hook-list.c | 6 +- src/pulsecore/hook-list.h | 4 +- src/pulsecore/idxset.c | 2 +- src/pulsecore/idxset.h | 4 +- src/pulsecore/iochannel.c | 56 ++--- src/pulsecore/iochannel.h | 14 +- src/pulsecore/ioline.c | 24 +- src/pulsecore/ioline.h | 4 +- src/pulsecore/lock-autospawn.c | 10 +- src/pulsecore/lock-autospawn.h | 4 +- src/pulsecore/log.c | 12 +- src/pulsecore/log.h | 2 +- src/pulsecore/macro.h | 12 +- src/pulsecore/memblock.c | 44 ++-- src/pulsecore/memblock.h | 16 +- src/pulsecore/memblockq.c | 54 ++--- src/pulsecore/memblockq.h | 10 +- src/pulsecore/memchunk.c | 2 +- src/pulsecore/memchunk.h | 4 +- src/pulsecore/memtrap.c | 8 +- src/pulsecore/memtrap.h | 2 +- src/pulsecore/mime-type.c | 20 +- src/pulsecore/mime-type.h | 2 +- src/pulsecore/mix.c | 2 +- src/pulsecore/mix.h | 2 +- src/pulsecore/modargs.c | 2 +- src/pulsecore/modargs.h | 2 +- src/pulsecore/modinfo.c | 4 +- src/pulsecore/modinfo.h | 2 +- src/pulsecore/module.c | 20 +- src/pulsecore/module.h | 14 +- src/pulsecore/msgobject.c | 2 +- src/pulsecore/msgobject.h | 2 +- src/pulsecore/mutex-posix.c | 10 +- src/pulsecore/mutex-win32.c | 6 +- src/pulsecore/mutex.h | 6 +- src/pulsecore/namereg.c | 24 +- src/pulsecore/namereg.h | 6 +- src/pulsecore/object.c | 4 +- src/pulsecore/object.h | 24 +- src/pulsecore/once.c | 12 +- src/pulsecore/once.h | 2 +- src/pulsecore/parseaddr.c | 8 +- src/pulsecore/parseaddr.h | 2 +- src/pulsecore/pdispatch.c | 4 +- src/pulsecore/pdispatch.h | 2 +- src/pulsecore/pid.c | 4 +- src/pulsecore/play-memblockq.c | 4 +- src/pulsecore/proplist-util.c | 6 +- src/pulsecore/protocol-dbus.c | 20 +- src/pulsecore/protocol-esound.c | 50 ++--- src/pulsecore/protocol-esound.h | 2 +- src/pulsecore/protocol-http.c | 2 +- src/pulsecore/protocol-native.c | 258 ++++++++++----------- src/pulsecore/protocol-native.h | 2 +- src/pulsecore/protocol-simple.c | 26 +-- src/pulsecore/protocol-simple.h | 4 +- src/pulsecore/pstream.c | 44 ++-- src/pulsecore/pstream.h | 6 +- src/pulsecore/random.c | 6 +- src/pulsecore/ratelimit.c | 8 +- src/pulsecore/ratelimit.h | 4 +- src/pulsecore/refcnt.h | 4 +- src/pulsecore/rtpoll.c | 44 ++-- src/pulsecore/rtpoll.h | 6 +- src/pulsecore/sample-util.c | 4 +- src/pulsecore/sample-util.h | 2 +- src/pulsecore/shm.c | 10 +- src/pulsecore/shm.h | 6 +- src/pulsecore/shmasyncq.h | 4 +- src/pulsecore/sink-input.c | 174 +++++++-------- src/pulsecore/sink-input.h | 74 +++--- src/pulsecore/sink.c | 230 +++++++++---------- src/pulsecore/sink.h | 98 ++++---- src/pulsecore/socket-client.c | 8 +- src/pulsecore/socket-client.h | 4 +- src/pulsecore/socket-server.c | 16 +- src/pulsecore/socket-server.h | 16 +- src/pulsecore/socket-util.c | 10 +- src/pulsecore/socket-util.h | 4 +- src/pulsecore/sound-file-stream.c | 4 +- src/pulsecore/source-output.c | 128 +++++------ src/pulsecore/source-output.h | 68 +++--- src/pulsecore/source.c | 174 +++++++-------- src/pulsecore/source.h | 84 +++---- src/pulsecore/strbuf.c | 2 +- src/pulsecore/strbuf.h | 2 +- src/pulsecore/tagstruct.c | 12 +- src/pulsecore/tagstruct.h | 4 +- src/pulsecore/thread-mq.c | 2 +- src/pulsecore/thread-posix.c | 6 +- src/pulsecore/time-smoother.c | 36 +-- src/pulsecore/time-smoother.h | 10 +- src/tests/asyncq-test.c | 4 +- src/tests/cpu-test.c | 142 ++++++------ src/tests/interpol-test.c | 16 +- src/tests/lock-autospawn-test.c | 8 +- src/tests/mainloop-test.c | 4 +- src/tests/mcalign-test.c | 2 +- src/tests/memblock-test.c | 6 +- src/tests/memblockq-test.c | 20 +- src/tests/mix-special-test.c | 12 +- src/tests/mix-test.c | 4 +- src/tests/remix-test.c | 2 +- src/tests/resampler-test.c | 10 +- src/tests/smoother-test.c | 4 +- src/tests/stripnul.c | 4 +- src/tests/thread-mainloop-test.c | 2 +- src/tests/thread-test.c | 2 +- src/utils/pacat.c | 36 +-- src/utils/pacmd.c | 22 +- src/utils/pactl.c | 34 +-- src/utils/padsp.c | 2 +- src/utils/pax11publish.c | 2 +- 288 files changed, 3360 insertions(+), 3360 deletions(-) (limited to 'src') diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index a6ceb8b80..6361a3df5 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -215,7 +215,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d case ARG_START: conf->cmd = PA_CMD_START; - conf->daemonize = TRUE; + conf->daemonize = true; break; case ARG_CHECK: @@ -318,7 +318,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d break; case 'n': - conf->load_default_script_file = FALSE; + conf->load_default_script_file = false; break; case ARG_LOG_TARGET: diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index 0abbac023..7c753978d 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -80,7 +80,7 @@ static pa_io_event *io_event = NULL; static struct sigaction sigaction_prev; /* Nonzero after pa_cpu_limit_init() */ -static pa_bool_t installed = FALSE; +static bool installed = false; /* The current state of operation */ static enum { @@ -209,7 +209,7 @@ int pa_cpu_limit_init(pa_mainloop_api *m) { return -1; } - installed = TRUE; + installed = true; reset_cpu_time(CPUTIME_INTERVAL_SOFT); @@ -230,7 +230,7 @@ void pa_cpu_limit_done(void) { if (installed) { pa_assert_se(sigaction(SIGXCPU, &sigaction_prev, NULL) >= 0); - installed = FALSE; + installed = false; } } diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 4cc348571..5a480cc00 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -62,39 +62,39 @@ static const pa_daemon_conf default_conf = { .cmd = PA_CMD_DAEMON, - .daemonize = FALSE, - .fail = TRUE, - .high_priority = TRUE, + .daemonize = false, + .fail = true, + .high_priority = true, .nice_level = -11, - .realtime_scheduling = TRUE, + .realtime_scheduling = true, .realtime_priority = 5, /* Half of JACK's default rtprio */ - .disallow_module_loading = FALSE, - .disallow_exit = FALSE, - .flat_volumes = TRUE, + .disallow_module_loading = false, + .disallow_exit = false, + .flat_volumes = true, .exit_idle_time = 20, .scache_idle_time = 20, .script_commands = NULL, .dl_search_path = NULL, - .load_default_script_file = TRUE, + .load_default_script_file = true, .default_script_file = NULL, .log_target = NULL, .log_level = PA_LOG_NOTICE, .log_backtrace = 0, - .log_meta = FALSE, - .log_time = FALSE, + .log_meta = false, + .log_time = false, .resample_method = PA_RESAMPLER_AUTO, - .disable_remixing = FALSE, - .disable_lfe_remixing = TRUE, + .disable_remixing = false, + .disable_lfe_remixing = true, .config_file = NULL, - .use_pid_file = TRUE, - .system_instance = FALSE, + .use_pid_file = true, + .system_instance = false, #ifdef HAVE_DBUS .local_server_type = PA_SERVER_TYPE_UNSET, /* The actual default is _USER, but we have to detect when the user doesn't specify this option. */ #endif - .no_cpu_limit = TRUE, - .disable_shm = FALSE, - .lock_memory = FALSE, - .deferred_volume = TRUE, + .no_cpu_limit = true, + .disable_shm = false, + .lock_memory = false, + .deferred_volume = true, .default_n_fragments = 4, .default_fragment_size_msec = 25, .deferred_volume_safety_margin_usec = 8000, @@ -104,42 +104,42 @@ static const pa_daemon_conf default_conf = { .default_channel_map = { .channels = 2, .map = { PA_CHANNEL_POSITION_LEFT, PA_CHANNEL_POSITION_RIGHT } }, .shm_size = 0 #ifdef HAVE_SYS_RESOURCE_H - ,.rlimit_fsize = { .value = 0, .is_set = FALSE }, - .rlimit_data = { .value = 0, .is_set = FALSE }, - .rlimit_stack = { .value = 0, .is_set = FALSE }, - .rlimit_core = { .value = 0, .is_set = FALSE } + ,.rlimit_fsize = { .value = 0, .is_set = false }, + .rlimit_data = { .value = 0, .is_set = false }, + .rlimit_stack = { .value = 0, .is_set = false }, + .rlimit_core = { .value = 0, .is_set = false } #ifdef RLIMIT_RSS - ,.rlimit_rss = { .value = 0, .is_set = FALSE } + ,.rlimit_rss = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NPROC - ,.rlimit_nproc = { .value = 0, .is_set = FALSE } + ,.rlimit_nproc = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NOFILE - ,.rlimit_nofile = { .value = 256, .is_set = TRUE } + ,.rlimit_nofile = { .value = 256, .is_set = true } #endif #ifdef RLIMIT_MEMLOCK - ,.rlimit_memlock = { .value = 0, .is_set = FALSE } + ,.rlimit_memlock = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_AS - ,.rlimit_as = { .value = 0, .is_set = FALSE } + ,.rlimit_as = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_LOCKS - ,.rlimit_locks = { .value = 0, .is_set = FALSE } + ,.rlimit_locks = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_SIGPENDING - ,.rlimit_sigpending = { .value = 0, .is_set = FALSE } + ,.rlimit_sigpending = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_MSGQUEUE - ,.rlimit_msgqueue = { .value = 0, .is_set = FALSE } + ,.rlimit_msgqueue = { .value = 0, .is_set = false } #endif #ifdef RLIMIT_NICE - ,.rlimit_nice = { .value = 31, .is_set = TRUE } /* nice level of -11 */ + ,.rlimit_nice = { .value = 31, .is_set = true } /* nice level of -11 */ #endif #ifdef RLIMIT_RTPRIO - ,.rlimit_rtprio = { .value = 9, .is_set = TRUE } /* One below JACK's default for the server */ + ,.rlimit_rtprio = { .value = 9, .is_set = true } /* One below JACK's default for the server */ #endif #ifdef RLIMIT_RTTIME - ,.rlimit_rttime = { .value = PA_USEC_PER_SEC, .is_set = TRUE } + ,.rlimit_rttime = { .value = PA_USEC_PER_SEC, .is_set = true } #endif #endif }; @@ -375,8 +375,8 @@ static int parse_alternate_sample_rate(pa_config_parser_state *state) { struct channel_conf_info { pa_daemon_conf *conf; - pa_bool_t default_sample_spec_set; - pa_bool_t default_channel_map_set; + bool default_sample_spec_set; + bool default_channel_map_set; }; static int parse_sample_channels(pa_config_parser_state *state) { @@ -393,7 +393,7 @@ static int parse_sample_channels(pa_config_parser_state *state) { } i->conf->default_sample_spec.channels = (uint8_t) n; - i->default_sample_spec_set = TRUE; + i->default_sample_spec_set = true; return 0; } @@ -409,7 +409,7 @@ static int parse_channel_map(pa_config_parser_state *state) { return -1; } - i->default_channel_map_set = TRUE; + i->default_channel_map_set = true; return 0; } @@ -616,7 +616,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { goto finish; } - ci.default_channel_map_set = ci.default_sample_spec_set = FALSE; + ci.default_channel_map_set = ci.default_sample_spec_set = false; ci.conf = c; r = f ? pa_config_parse(c->config_file, f, table, NULL, NULL) : 0; diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 067ff21b5..20225c053 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -52,14 +52,14 @@ typedef enum pa_daemon_conf_cmd { #ifdef HAVE_SYS_RESOURCE_H typedef struct pa_rlimit { rlim_t value; - pa_bool_t is_set; + bool is_set; } pa_rlimit; #endif /* A structure containing configuration data for the PulseAudio server . */ typedef struct pa_daemon_conf { pa_daemon_conf_cmd_t cmd; - pa_bool_t daemonize, + bool daemonize, fail, high_priority, realtime_scheduling, diff --git a/src/daemon/main.c b/src/daemon/main.c index 9bb852cbd..5b4e0053b 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -202,12 +202,12 @@ static int change_user(void) { if (!pa_streq(pw->pw_dir, PA_SYSTEM_RUNTIME_PATH)) pa_log_warn(_("Home directory of user '%s' is not '%s', ignoring."), PA_SYSTEM_USER, PA_SYSTEM_RUNTIME_PATH); - if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, TRUE) < 0) { + if (pa_make_secure_dir(PA_SYSTEM_RUNTIME_PATH, 0755, pw->pw_uid, gr->gr_gid, true) < 0) { pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_RUNTIME_PATH, pa_cstrerror(errno)); return -1; } - if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, TRUE) < 0) { + if (pa_make_secure_dir(PA_SYSTEM_STATE_PATH, 0700, pw->pw_uid, gr->gr_gid, true) < 0) { pa_log(_("Failed to create '%s': %s"), PA_SYSTEM_STATE_PATH, pa_cstrerror(errno)); return -1; } @@ -402,8 +402,8 @@ int main(int argc, char *argv[]) { char *s; char *configured_address; int r = 0, retval = 1, d = 0; - pa_bool_t valid_pid_file = FALSE; - pa_bool_t ltdl_init = FALSE; + bool valid_pid_file = false; + bool ltdl_init = false; int passed_fd = -1; const char *e; #ifdef HAVE_FORK @@ -415,12 +415,12 @@ int main(int argc, char *argv[]) { struct timeval win32_tv; #endif int autospawn_fd = -1; - pa_bool_t autospawn_locked = FALSE; + bool autospawn_locked = false; #ifdef HAVE_DBUS pa_dbusobj_server_lookup *server_lookup = NULL; /* /org/pulseaudio/server_lookup */ pa_dbus_connection *lookup_service_bus = NULL; /* Always the user bus. */ pa_dbus_connection *server_bus = NULL; /* The bus where we reserve org.pulseaudio.Server, either the user or the system bus. */ - pa_bool_t start_server; + bool start_server; #endif pa_log_set_ident("pulseaudio"); @@ -522,10 +522,10 @@ int main(int argc, char *argv[]) { break; case PA_SERVER_TYPE_USER: case PA_SERVER_TYPE_NONE: - conf->system_instance = FALSE; + conf->system_instance = false; break; case PA_SERVER_TYPE_SYSTEM: - conf->system_instance = TRUE; + conf->system_instance = true; break; default: pa_assert_not_reached(); @@ -535,13 +535,13 @@ int main(int argc, char *argv[]) { if (!start_server && conf->local_server_type == PA_SERVER_TYPE_SYSTEM) { pa_log_notice(_("System mode refused for non-root user. Only starting the D-Bus server lookup service.")); - conf->system_instance = FALSE; + conf->system_instance = false; } #endif LTDL_SET_PRELOADED_SYMBOLS(); pa_ltdl_init(); - ltdl_init = TRUE; + ltdl_init = true; if (conf->dl_search_path) lt_dlsetsearchpath(conf->dl_search_path); @@ -685,7 +685,7 @@ int main(int argc, char *argv[]) { * recover (i.e. autospawn) from a crash. */ char *ufn; - pa_bool_t start_anyway = FALSE; + bool start_anyway = false; if ((ufn = pa_runtime_path(PA_NATIVE_DEFAULT_UNIX_SOCKET))) { char *id; @@ -730,7 +730,7 @@ int main(int argc, char *argv[]) { if (conf->system_instance && !conf->disable_shm) { pa_log_notice(_("Running in system mode, forcibly disabling SHM mode!")); - conf->disable_shm = TRUE; + conf->disable_shm = true; } if (conf->system_instance && conf->exit_idle_time >= 0) { @@ -748,12 +748,12 @@ int main(int argc, char *argv[]) { goto finish; } - if ((pa_autospawn_lock_acquire(TRUE) < 0)) { + if ((pa_autospawn_lock_acquire(true) < 0)) { pa_log("Failed to acquire autospawn lock"); goto finish; } - autospawn_locked = TRUE; + autospawn_locked = true; } if (conf->daemonize) { @@ -806,9 +806,9 @@ int main(int argc, char *argv[]) { * to close it in the child */ pa_autospawn_lock_release(); - pa_autospawn_lock_done(TRUE); + pa_autospawn_lock_done(true); - autospawn_locked = FALSE; + autospawn_locked = false; autospawn_fd = -1; } @@ -992,7 +992,7 @@ int main(int argc, char *argv[]) { goto finish; } - valid_pid_file = TRUE; + valid_pid_file = true; } pa_disable_sigpipe(); @@ -1110,7 +1110,7 @@ int main(int argc, char *argv[]) { * any modules to be loaded. We haven't loaded any so far, so one might * think there's no way to contact the server, but receiving certain * signals could still cause modules to load. */ - conf->disallow_module_loading = TRUE; + conf->disallow_module_loading = true; } #endif @@ -1161,7 +1161,7 @@ finish: if (autospawn_locked) pa_autospawn_lock_release(); - pa_autospawn_lock_done(FALSE); + pa_autospawn_lock_done(false); } #ifdef OS_IS_WIN32 diff --git a/src/daemon/server-lookup.c b/src/daemon/server-lookup.c index 9bdc69919..82c88510a 100644 --- a/src/daemon/server-lookup.c +++ b/src/daemon/server-lookup.c @@ -42,7 +42,7 @@ struct pa_dbusobj_server_lookup { pa_core *core; pa_dbus_connection *conn; - pa_bool_t path_registered; + bool path_registered; }; static const char introspection[] = @@ -82,7 +82,7 @@ static void unregister_cb(DBusConnection *conn, void *user_data) { pa_assert(sl); pa_assert(sl->path_registered); - sl->path_registered = FALSE; + sl->path_registered = false; } static DBusHandlerResult handle_introspect(DBusConnection *conn, DBusMessage *msg, pa_dbusobj_server_lookup *sl) { @@ -482,7 +482,7 @@ pa_dbusobj_server_lookup *pa_dbusobj_server_lookup_new(pa_core *c) { sl = pa_xnew(pa_dbusobj_server_lookup, 1); sl->core = c; - sl->path_registered = FALSE; + sl->path_registered = false; if (!(sl->conn = pa_dbus_bus_get(c, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) { pa_log_warn("Unable to contact D-Bus: %s: %s", error.name, error.message); @@ -494,7 +494,7 @@ pa_dbusobj_server_lookup *pa_dbusobj_server_lookup_new(pa_core *c) { goto fail; } - sl->path_registered = TRUE; + sl->path_registered = true; return sl; diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index f4410d74c..545ae9f9d 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -83,7 +83,7 @@ struct pa_alsa_fdlist { pa_defer_event *defer; pa_io_event **ios; - pa_bool_t polled; + bool polled; void (*cb)(void *userdata); void *userdata; @@ -105,7 +105,7 @@ static void io_cb(pa_mainloop_api *a, pa_io_event *e, int fd, pa_io_event_flags_ if (fdl->polled) return; - fdl->polled = TRUE; + fdl->polled = true; memcpy(fdl->work_fds, fdl->fds, sizeof(struct pollfd) * fdl->num_fds); @@ -189,7 +189,7 @@ static void defer_cb(pa_mainloop_api *a, pa_defer_event *e, void *userdata) { return; } - fdl->polled = FALSE; + fdl->polled = false; if (memcmp(fdl->fds, fdl->work_fds, sizeof(struct pollfd) * num_fds) == 0) return; @@ -559,7 +559,7 @@ static pa_volume_t from_alsa_volume(long v, long min, long max) { snd_mixer_selem_id_alloca(&(sid)); \ snd_mixer_selem_id_set_name((sid), (name)); \ snd_mixer_selem_id_set_index((sid), 0); \ - } while(FALSE) + } while(false) static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v) { snd_mixer_selem_id_t *sid; @@ -729,7 +729,7 @@ int pa_alsa_path_get_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_ma return 0; } -static int element_get_switch(pa_alsa_element *e, snd_mixer_t *m, pa_bool_t *b) { +static int element_get_switch(pa_alsa_element *e, snd_mixer_t *m, bool *b) { snd_mixer_selem_id_t *sid; snd_mixer_elem_t *me; snd_mixer_selem_channel_id_t c; @@ -766,16 +766,16 @@ static int element_get_switch(pa_alsa_element *e, snd_mixer_t *m, pa_bool_t *b) continue; if (!value) { - *b = FALSE; + *b = false; return 0; } } - *b = TRUE; + *b = true; return 0; } -int pa_alsa_path_get_mute(pa_alsa_path *p, snd_mixer_t *m, pa_bool_t *muted) { +int pa_alsa_path_get_mute(pa_alsa_path *p, snd_mixer_t *m, bool *muted) { pa_alsa_element *e; pa_assert(m); @@ -786,7 +786,7 @@ int pa_alsa_path_get_mute(pa_alsa_path *p, snd_mixer_t *m, pa_bool_t *muted) { return -1; PA_LLIST_FOREACH(e, p->elements) { - pa_bool_t b; + bool b; if (e->switch_use != PA_ALSA_SWITCH_MUTE) continue; @@ -795,12 +795,12 @@ int pa_alsa_path_get_mute(pa_alsa_path *p, snd_mixer_t *m, pa_bool_t *muted) { return -1; if (!b) { - *muted = TRUE; + *muted = true; return 0; } } - *muted = FALSE; + *muted = false; return 0; } @@ -887,7 +887,7 @@ static int element_get_nearest_alsa_dB(snd_mixer_elem_t *me, snd_mixer_selem_cha return r; } -static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw) { +static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, bool deferred_volume, bool write_to_hw) { snd_mixer_selem_id_t *sid; pa_cvolume rv; @@ -913,11 +913,11 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann for (c = 0; c <= SND_MIXER_SCHN_LAST; c++) { int r; pa_volume_t f = PA_VOLUME_MUTED; - pa_bool_t found = FALSE; + bool found = false; for (k = 0; k < cm->channels; k++) if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k])) { - found = TRUE; + found = true; if (v->values[k] > f) f = v->values[k]; } @@ -1047,7 +1047,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann return 0; } -int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw) { +int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, bool deferred_volume, bool write_to_hw) { pa_alsa_element *e; pa_cvolume rv; @@ -1088,7 +1088,7 @@ int pa_alsa_path_set_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_ma return 0; } -static int element_set_switch(pa_alsa_element *e, snd_mixer_t *m, pa_bool_t b) { +static int element_set_switch(pa_alsa_element *e, snd_mixer_t *m, bool b) { snd_mixer_elem_t *me; snd_mixer_selem_id_t *sid; int r; @@ -1113,7 +1113,7 @@ static int element_set_switch(pa_alsa_element *e, snd_mixer_t *m, pa_bool_t b) { return r; } -int pa_alsa_path_set_mute(pa_alsa_path *p, snd_mixer_t *m, pa_bool_t muted) { +int pa_alsa_path_set_mute(pa_alsa_path *p, snd_mixer_t *m, bool muted) { pa_alsa_element *e; pa_assert(m); @@ -1142,7 +1142,7 @@ static int element_set_constant_volume(pa_alsa_element *e, snd_mixer_t *m) { snd_mixer_selem_id_t *sid = NULL; int r = 0; long volume = -1; - pa_bool_t volume_set = FALSE; + bool volume_set = false; pa_assert(m); pa_assert(e); @@ -1156,7 +1156,7 @@ static int element_set_constant_volume(pa_alsa_element *e, snd_mixer_t *m) { switch (e->volume_use) { case PA_ALSA_VOLUME_OFF: volume = e->min_volume; - volume_set = TRUE; + volume_set = true; break; case PA_ALSA_VOLUME_ZERO: @@ -1164,13 +1164,13 @@ static int element_set_constant_volume(pa_alsa_element *e, snd_mixer_t *m) { long dB = 0; volume = decibel_fix_get_step(e->db_fix, &dB, (e->direction == PA_ALSA_DIRECTION_OUTPUT ? +1 : -1)); - volume_set = TRUE; + volume_set = true; } break; case PA_ALSA_VOLUME_CONSTANT: volume = e->constant_volume; - volume_set = TRUE; + volume_set = true; break; default: @@ -1217,7 +1217,7 @@ int pa_alsa_path_select(pa_alsa_path *p, pa_alsa_setting *s, snd_mixer_t *m, boo * selecting a path, so we ignore the return value. * element_set_switch() will print a warning anyway, so this * won't be a silent failure either. */ - (void) element_set_switch(e, m, FALSE); + (void) element_set_switch(e, m, false); } } @@ -1225,11 +1225,11 @@ int pa_alsa_path_select(pa_alsa_path *p, pa_alsa_setting *s, snd_mixer_t *m, boo switch (e->switch_use) { case PA_ALSA_SWITCH_OFF: - r = element_set_switch(e, m, FALSE); + r = element_set_switch(e, m, false); break; case PA_ALSA_SWITCH_ON: - r = element_set_switch(e, m, TRUE); + r = element_set_switch(e, m, true); break; case PA_ALSA_SWITCH_MUTE: @@ -1276,9 +1276,9 @@ int pa_alsa_path_select(pa_alsa_path *p, pa_alsa_setting *s, snd_mixer_t *m, boo } static int check_required(pa_alsa_element *e, snd_mixer_elem_t *me) { - pa_bool_t has_switch; - pa_bool_t has_enumeration; - pa_bool_t has_volume; + bool has_switch; + bool has_enumeration; + bool has_volume; pa_assert(e); pa_assert(me); @@ -1401,7 +1401,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { } if (e->switch_use != PA_ALSA_SWITCH_IGNORE) - e->direction_try_other = FALSE; + e->direction_try_other = false; } if (e->volume_use != PA_ALSA_VOLUME_IGNORE) { @@ -1429,7 +1429,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { long min_dB = 0, max_dB = 0; int r; - e->direction_try_other = FALSE; + e->direction_try_other = false; if (e->direction == PA_ALSA_DIRECTION_OUTPUT) r = snd_mixer_selem_get_playback_volume_range(me, &e->min_volume, &e->max_volume); @@ -1452,7 +1452,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { e->volume_use = PA_ALSA_VOLUME_IGNORE; } else { - pa_bool_t is_mono; + bool is_mono; pa_channel_position_t p; if (e->db_fix && @@ -1468,7 +1468,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { } if (e->db_fix) { - e->has_dB = TRUE; + e->has_dB = true; e->min_volume = e->db_fix->min_step; e->max_volume = e->db_fix->max_step; min_dB = e->db_fix->db_values[0]; @@ -1527,7 +1527,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { if (min_dB >= max_dB) { pa_assert(!e->db_fix); pa_log_warn("Your kernel driver is broken: it reports a volume range from %0.2f dB to %0.2f dB which makes no sense.", e->min_dB, e->max_dB); - e->has_dB = FALSE; + e->has_dB = false; } } @@ -1553,7 +1553,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { if (r < 0) { pa_log_warn("Failed to get dB value of %s: %s", e->alsa_name, pa_alsa_strerror(r)); - e->has_dB = FALSE; + e->has_dB = false; } else e->max_dB = ((double) max_dB) / 100.0; } @@ -1617,7 +1617,7 @@ static int element_probe(pa_alsa_element *e, snd_mixer_t *m) { if (!e->override_map) { for (p = PA_CHANNEL_POSITION_FRONT_LEFT; p < PA_CHANNEL_POSITION_MAX; p++) { - pa_bool_t has_channel; + bool has_channel; if (alsa_channel_ids[p] == SND_MIXER_SCHN_UNKNOWN) continue; @@ -1692,7 +1692,7 @@ static int jack_probe(pa_alsa_jack *j, snd_hctl_t *h) { if (j->required_absent != PA_ALSA_REQUIRED_IGNORE) return -1; if (j->required_any != PA_ALSA_REQUIRED_IGNORE) - j->path->req_any_present = TRUE; + j->path->req_any_present = true; } else { if (j->required != PA_ALSA_REQUIRED_IGNORE) return -1; @@ -1701,7 +1701,7 @@ static int jack_probe(pa_alsa_jack *j, snd_hctl_t *h) { return 0; } -static pa_alsa_element* element_get(pa_alsa_path *p, const char *section, pa_bool_t prefixed) { +static pa_alsa_element* element_get(pa_alsa_path *p, const char *section, bool prefixed) { pa_alsa_element *e; pa_assert(p); @@ -1790,7 +1790,7 @@ static pa_alsa_option* option_get(pa_alsa_path *p, const char *section) { return p->last_option; } - pa_assert_se(e = element_get(p, en, FALSE)); + pa_assert_se(e = element_get(p, en, false)); pa_xfree(en); PA_LLIST_FOREACH(o, e->options) @@ -1820,7 +1820,7 @@ static int element_parse_switch(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Switch makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -1851,7 +1851,7 @@ static int element_parse_volume(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Volume makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -1887,7 +1887,7 @@ static int element_parse_enumeration(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Enumeration makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -1957,7 +1957,7 @@ static int element_parse_required(pa_config_parser_state *state) { p = state->userdata; - e = element_get(p, state->section, TRUE); + e = element_get(p, state->section, true); o = option_get(p, state->section); j = jack_get(p, state->section); if (!e && !o && !j) { @@ -2023,7 +2023,7 @@ static int element_parse_direction(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Direction makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -2049,7 +2049,7 @@ static int element_parse_direction_try_other(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Direction makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -2072,7 +2072,7 @@ static int element_parse_volume_limit(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] volume-limit makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -2130,7 +2130,7 @@ static int element_parse_override_map(pa_config_parser_state *state) { p = state->userdata; - if (!(e = element_get(p, state->section, TRUE))) { + if (!(e = element_get(p, state->section, true))) { pa_log("[%s:%u] Override map makes no sense in '%s'", state->filename, state->lineno, state->section); return -1; } @@ -2158,7 +2158,7 @@ static int element_parse_override_map(pa_config_parser_state *state) { pa_xfree(n); } - e->override_map = TRUE; + e->override_map = true; return 0; } @@ -2482,7 +2482,7 @@ pa_alsa_path *pa_alsa_path_synthesize(const char *element, pa_alsa_direction_t d return p; } -static pa_bool_t element_drop_unsupported(pa_alsa_element *e) { +static bool element_drop_unsupported(pa_alsa_element *e) { pa_alsa_option *o, *n; pa_assert(e); @@ -2558,7 +2558,7 @@ static void path_make_options_unique(pa_alsa_path *p) { } } -static pa_bool_t element_create_settings(pa_alsa_element *e, pa_alsa_setting *template) { +static bool element_create_settings(pa_alsa_element *e, pa_alsa_setting *template) { pa_alsa_option *o; for (; e; e = e->next) @@ -2567,7 +2567,7 @@ static pa_bool_t element_create_settings(pa_alsa_element *e, pa_alsa_setting *te break; if (!e) - return FALSE; + return false; for (o = e->options; o; o = o->next) { pa_alsa_setting *s; @@ -2605,7 +2605,7 @@ static pa_bool_t element_create_settings(pa_alsa_element *e, pa_alsa_setting *te } } - return TRUE; + return true; } static void path_create_settings(pa_alsa_path *p) { @@ -2614,7 +2614,7 @@ static void path_create_settings(pa_alsa_path *p) { element_create_settings(p->elements, NULL); } -int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_bool_t ignore_dB) { +int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, bool ignore_dB) { pa_alsa_element *e; pa_alsa_jack *j; double min_dB[PA_CHANNEL_POSITION_MAX], max_dB[PA_CHANNEL_POSITION_MAX]; @@ -2626,7 +2626,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo if (p->probed) return p->supported ? 0 : -1; - p->probed = TRUE; + p->probed = true; pa_zero(min_dB); pa_zero(max_dB); @@ -2635,7 +2635,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo PA_LLIST_FOREACH(j, p->jacks) { if (jack_probe(j, hctl) < 0) { - p->supported = FALSE; + p->supported = false; pa_log_debug("Probe of jack '%s' failed.", j->alsa_name); return -1; } @@ -2644,14 +2644,14 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo PA_LLIST_FOREACH(e, p->elements) { if (element_probe(e, m) < 0) { - p->supported = FALSE; + p->supported = false; pa_log_debug("Probe of element '%s' failed.", e->alsa_name); return -1; } pa_log_debug("Probe of element '%s' succeeded (volume=%d, switch=%d, enumeration=%d).", e->alsa_name, e->volume_use, e->switch_use, e->enumeration_use); if (ignore_dB) - e->has_dB = FALSE; + e->has_dB = false; if (e->volume_use == PA_ALSA_VOLUME_MERGE) { @@ -2669,7 +2669,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo path_volume_channels |= PA_CHANNEL_POSITION_MASK(t); } - p->has_dB = TRUE; + p->has_dB = true; } else { if (p->has_dB) { @@ -2692,15 +2692,15 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo e->volume_use = PA_ALSA_VOLUME_IGNORE; pa_log_info("Ignoring volume of '%s' on path '%s' (missing dB info)", e->alsa_name, p->name); } - p->has_volume = TRUE; + p->has_volume = true; } if (e->switch_use == PA_ALSA_SWITCH_MUTE) - p->has_mute = TRUE; + p->has_mute = true; } if (p->has_req_any && !p->req_any_present) { - p->supported = FALSE; + p->supported = false; pa_log_debug("Skipping path '%s', none of required-any elements preset.", p->name); return -1; } @@ -2709,7 +2709,7 @@ int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_boo path_make_options_unique(p); path_create_settings(p); - p->supported = TRUE; + p->supported = true; p->min_dB = INFINITY; p->max_dB = -INFINITY; @@ -2904,12 +2904,12 @@ pa_alsa_path_set *pa_alsa_path_set_new(pa_alsa_mapping *m, pa_alsa_direction_t d for (in = pn; *in; in++) { pa_alsa_path *p = NULL; - pa_bool_t duplicate = FALSE; + bool duplicate = false; char **kn; for (kn = pn; kn < in; kn++) if (pa_streq(*kn, *in)) { - duplicate = TRUE; + duplicate = true; break; } @@ -3018,7 +3018,7 @@ void pa_alsa_path_set_dump(pa_alsa_path_set *ps) { pa_alsa_path_dump(p); } -static pa_bool_t options_have_option(pa_alsa_option *options, const char *alsa_name) { +static bool options_have_option(pa_alsa_option *options, const char *alsa_name) { pa_alsa_option *o; pa_assert(options); @@ -3026,36 +3026,36 @@ static pa_bool_t options_have_option(pa_alsa_option *options, const char *alsa_n PA_LLIST_FOREACH(o, options) { if (pa_streq(o->alsa_name, alsa_name)) - return TRUE; + return true; } - return FALSE; + return false; } -static pa_bool_t enumeration_is_subset(pa_alsa_option *a_options, pa_alsa_option *b_options) { +static bool enumeration_is_subset(pa_alsa_option *a_options, pa_alsa_option *b_options) { pa_alsa_option *oa, *ob; - if (!a_options) return TRUE; - if (!b_options) return FALSE; + if (!a_options) return true; + if (!b_options) return false; /* If there is an option A offers that B does not, then A is not a subset of B. */ PA_LLIST_FOREACH(oa, a_options) { - pa_bool_t found = FALSE; + bool found = false; PA_LLIST_FOREACH(ob, b_options) { if (pa_streq(oa->alsa_name, ob->alsa_name)) { - found = TRUE; + found = true; break; } } if (!found) - return FALSE; + return false; } - return TRUE; + return true; } /** * Compares two elements to see if a is a subset of b */ -static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_mixer_t *m) { +static bool element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_mixer_t *m) { pa_assert(a); pa_assert(b); pa_assert(m); @@ -3069,11 +3069,11 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m /* "Constant" is subset of "Constant" only when their constant values are equal */ if (a->volume_use == PA_ALSA_VOLUME_CONSTANT && b->volume_use == PA_ALSA_VOLUME_CONSTANT && a->constant_volume != b->constant_volume) - return FALSE; + return false; /* Different volume uses when b is not "Merge" means we are definitely not a subset */ if (a->volume_use != b->volume_use && b->volume_use != PA_ALSA_VOLUME_MERGE) - return FALSE; + return false; /* "Constant" is a subset of "Merge", if there is not a "volume-limit" in "Merge" below the actual constant. * "Zero" and "Off" are just special cases of "Constant" when comparing to "Merge" @@ -3096,15 +3096,15 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m SELEM_INIT(sid, a->alsa_name); if (!(me = snd_mixer_find_selem(m, sid))) { pa_log_warn("Element %s seems to have disappeared.", a->alsa_name); - return FALSE; + return false; } if (a->direction == PA_ALSA_DIRECTION_OUTPUT) { if (snd_mixer_selem_ask_playback_dB_vol(me, dB, +1, &a_limit) < 0) - return FALSE; + return false; } else { if (snd_mixer_selem_ask_capture_dB_vol(me, dB, -1, &a_limit) < 0) - return FALSE; + return false; } } } else if (a->volume_use == PA_ALSA_VOLUME_OFF) @@ -3113,22 +3113,22 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m a_limit = a->volume_limit; else /* This should never be reached */ - pa_assert(FALSE); + pa_assert(false); if (a_limit > b->volume_limit) - return FALSE; + return false; } if (a->volume_use == PA_ALSA_VOLUME_MERGE) { int s; /* If override-maps are different, they're not subsets */ if (a->n_channels != b->n_channels) - return FALSE; + return false; for (s = 0; s <= SND_MIXER_SCHN_LAST; s++) if (a->masks[s][a->n_channels-1] != b->masks[s][b->n_channels-1]) { pa_log_debug("Element %s is not a subset - mask a: 0x%" PRIx64 ", mask b: 0x%" PRIx64 ", at channel %d", a->alsa_name, a->masks[s][a->n_channels-1], b->masks[s][b->n_channels-1], s); - return FALSE; + return false; } } } @@ -3144,31 +3144,31 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m if (a->switch_use == PA_ALSA_SWITCH_SELECT || a->switch_use == PA_ALSA_SWITCH_MUTE || b->switch_use == PA_ALSA_SWITCH_OFF || b->switch_use == PA_ALSA_SWITCH_ON) - return FALSE; + return false; if (b->switch_use == PA_ALSA_SWITCH_SELECT) { if (a->switch_use == PA_ALSA_SWITCH_ON) { if (!options_have_option(b->options, "on")) - return FALSE; + return false; } else if (a->switch_use == PA_ALSA_SWITCH_OFF) { if (!options_have_option(b->options, "off")) - return FALSE; + return false; } } } else if (a->switch_use == PA_ALSA_SWITCH_SELECT) { if (!enumeration_is_subset(a->options, b->options)) - return FALSE; + return false; } } if (a->enumeration_use != PA_ALSA_ENUMERATION_IGNORE) { if (b->enumeration_use == PA_ALSA_ENUMERATION_IGNORE) - return FALSE; + return false; if (!enumeration_is_subset(a->options, b->options)) - return FALSE; + return false; } - return TRUE; + return true; } static void path_set_condense(pa_alsa_path_set *ps, snd_mixer_t *m) { @@ -3966,11 +3966,11 @@ static int profile_verify(pa_alsa_profile *p) { for (name = p->output_mapping_names; *name; name++) { pa_alsa_mapping *m; char **in; - pa_bool_t duplicate = FALSE; + bool duplicate = false; for (in = name + 1; *in; in++) if (pa_streq(*name, *in)) { - duplicate = TRUE; + duplicate = true; break; } @@ -4002,11 +4002,11 @@ static int profile_verify(pa_alsa_profile *p) { for (name = p->input_mapping_names; *name; name++) { pa_alsa_mapping *m; char **in; - pa_bool_t duplicate = FALSE; + bool duplicate = false; for (in = name + 1; *in; in++) if (pa_streq(*name, *in)) { - duplicate = TRUE; + duplicate = true; break; } @@ -4277,7 +4277,7 @@ static snd_pcm_t* mapping_open_pcm(pa_alsa_mapping *m, return pa_alsa_open_by_template( m->device_strings, dev_id, NULL, &try_ss, &try_map, mode, &try_period_size, - &try_buffer_size, 0, NULL, NULL, TRUE); + &try_buffer_size, 0, NULL, NULL, true); } static void paths_drop_unsupported(pa_hashmap* h) { @@ -4326,13 +4326,13 @@ void pa_alsa_profile_set_probe( if (!p->supported) { profile_finalize_probing(last, p); - p->supported = TRUE; + p->supported = true; if (p->output_mappings) { PA_IDXSET_FOREACH(m, p->output_mappings, idx) { if (pa_hashmap_get(broken_outputs, m) == m) { pa_log_debug("Skipping profile %s - will not be able to open output:%s", p->name, m->name); - p->supported = FALSE; + p->supported = false; break; } } @@ -4342,7 +4342,7 @@ void pa_alsa_profile_set_probe( PA_IDXSET_FOREACH(m, p->input_mappings, idx) { if (pa_hashmap_get(broken_inputs, m) == m) { pa_log_debug("Skipping profile %s - will not be able to open input:%s", p->name, m->name); - p->supported = FALSE; + p->supported = false; break; } } @@ -4363,7 +4363,7 @@ void pa_alsa_profile_set_probe( SND_PCM_STREAM_PLAYBACK, default_n_fragments, default_fragment_size_msec))) { - p->supported = FALSE; + p->supported = false; if (pa_idxset_size(p->output_mappings) == 1 && ((!p->input_mappings) || pa_idxset_size(p->input_mappings) == 0)) { pa_log_debug("Caching failure to open output:%s", m->name); @@ -4384,7 +4384,7 @@ void pa_alsa_profile_set_probe( SND_PCM_STREAM_CAPTURE, default_n_fragments, default_fragment_size_msec))) { - p->supported = FALSE; + p->supported = false; if (pa_idxset_size(p->input_mappings) == 1 && ((!p->output_mappings) || pa_idxset_size(p->output_mappings) == 0)) { pa_log_debug("Caching failure to open input:%s", m->name); @@ -4423,7 +4423,7 @@ void pa_alsa_profile_set_probe( pa_hashmap_free(broken_inputs, NULL); pa_hashmap_free(broken_outputs, NULL); - ps->probed = TRUE; + ps->probed = true; } void pa_alsa_profile_set_dump(pa_alsa_profile_set *ps) { diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h index 3d50ebb61..432e4de78 100644 --- a/src/modules/alsa/alsa-mixer.h +++ b/src/modules/alsa/alsa-mixer.h @@ -138,10 +138,10 @@ struct pa_alsa_element { long constant_volume; - pa_bool_t override_map:1; - pa_bool_t direction_try_other:1; + bool override_map:1; + bool direction_try_other:1; - pa_bool_t has_dB:1; + bool has_dB:1; long min_volume, max_volume; long volume_limit; /* -1 for no configured limit */ double min_dB, max_dB; @@ -162,8 +162,8 @@ struct pa_alsa_jack { char *name; /* E g "Headphone" */ char *alsa_name; /* E g "Headphone Jack" */ - pa_bool_t has_control; /* is the jack itself present? */ - pa_bool_t plugged_in; /* is this jack currently plugged in? */ + bool has_control; /* is the jack itself present? */ + bool plugged_in; /* is this jack currently plugged in? */ snd_hctl_elem_t *hctl_elem; /* Jack detection handle */ pa_available_t state_unplugged, state_plugged; @@ -186,15 +186,15 @@ struct pa_alsa_path { int eld_device; pa_proplist *proplist; - pa_bool_t probed:1; - pa_bool_t supported:1; - pa_bool_t has_mute:1; - pa_bool_t has_volume:1; - pa_bool_t has_dB:1; + bool probed:1; + bool supported:1; + bool has_mute:1; + bool has_volume:1; + bool has_dB:1; bool mute_during_activation:1; /* These two are used during probing only */ - pa_bool_t has_req_any:1; - pa_bool_t req_any_present:1; + bool has_req_any:1; + bool req_any_present:1; long min_volume, max_volume; double min_dB, max_dB; @@ -226,12 +226,12 @@ void pa_alsa_element_dump(pa_alsa_element *e); pa_alsa_path *pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa_direction_t direction); pa_alsa_path *pa_alsa_path_synthesize(const char *element, pa_alsa_direction_t direction); -int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, pa_bool_t ignore_dB); +int pa_alsa_path_probe(pa_alsa_path *p, snd_mixer_t *m, snd_hctl_t *hctl, bool ignore_dB); void pa_alsa_path_dump(pa_alsa_path *p); int pa_alsa_path_get_volume(pa_alsa_path *p, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v); -int pa_alsa_path_get_mute(pa_alsa_path *path, snd_mixer_t *m, pa_bool_t *muted); -int pa_alsa_path_set_volume(pa_alsa_path *path, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, pa_bool_t deferred_volume, pa_bool_t write_to_hw); -int pa_alsa_path_set_mute(pa_alsa_path *path, snd_mixer_t *m, pa_bool_t muted); +int pa_alsa_path_get_mute(pa_alsa_path *path, snd_mixer_t *m, bool *muted); +int pa_alsa_path_set_volume(pa_alsa_path *path, snd_mixer_t *m, const pa_channel_map *cm, pa_cvolume *v, bool deferred_volume, bool write_to_hw); +int pa_alsa_path_set_mute(pa_alsa_path *path, snd_mixer_t *m, bool muted); int pa_alsa_path_select(pa_alsa_path *p, pa_alsa_setting *s, snd_mixer_t *m, bool device_is_muted); void pa_alsa_path_set_callback(pa_alsa_path *p, snd_mixer_t *m, snd_mixer_elem_callback_t cb, void *userdata); void pa_alsa_path_free(pa_alsa_path *p); @@ -282,7 +282,7 @@ struct pa_alsa_profile { char *description; unsigned priority; - pa_bool_t supported:1; + bool supported:1; char **input_mapping_names; char **output_mapping_names; @@ -314,9 +314,9 @@ struct pa_alsa_profile_set { pa_hashmap *input_paths; pa_hashmap *output_paths; - pa_bool_t auto_profiles; - pa_bool_t ignore_dB:1; - pa_bool_t probed:1; + bool auto_profiles; + bool ignore_dB:1; + bool probed:1; }; void pa_alsa_mapping_dump(pa_alsa_mapping *m); diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index aa6cf74d4..535f7ec59 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -136,9 +136,9 @@ struct userdata { char *device_name; /* name of the PCM device */ char *control_device; /* name of the control device */ - pa_bool_t use_mmap:1, use_tsched:1, deferred_volume:1, fixed_latency_range:1; + bool use_mmap:1, use_tsched:1, deferred_volume:1, fixed_latency_range:1; - pa_bool_t first, after_rewind; + bool first, after_rewind; pa_rtpoll_item *alsa_rtpoll_item; @@ -162,11 +162,11 @@ struct userdata { static void userdata_free(struct userdata *u); /* FIXME: Is there a better way to do this than device names? */ -static pa_bool_t is_iec958(struct userdata *u) { +static bool is_iec958(struct userdata *u) { return (strncmp("iec958", u->device_name, 6) == 0); } -static pa_bool_t is_hdmi(struct userdata *u) { +static bool is_hdmi(struct userdata *u) { return (strncmp("hdmi", u->device_name, 4) == 0); } @@ -176,7 +176,7 @@ static pa_hook_result_t reserve_cb(pa_reserve_wrapper *r, void *forced, struct u pa_log_debug("Suspending sink %s, because another application requested us to release the device.", u->sink->name); - if (pa_sink_suspend(u->sink, TRUE, PA_SUSPEND_APPLICATION) < 0) + if (pa_sink_suspend(u->sink, true, PA_SUSPEND_APPLICATION) < 0) return PA_HOOK_CANCEL; return PA_HOOK_OK; @@ -445,14 +445,14 @@ static int try_recover(struct userdata *u, const char *call, int err) { return -1; } - u->first = TRUE; + u->first = true; u->since_start = 0; return 0; } -static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t on_timeout) { +static size_t check_left_to_play(struct userdata *u, size_t n_bytes, bool on_timeout) { size_t left_to_play; - pa_bool_t underrun = FALSE; + bool underrun = false; /* We use <= instead of < for this check here because an underrun * only happens after the last sample was processed, not already when @@ -465,7 +465,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o /* We got a dropout. What a mess! */ left_to_play = 0; - underrun = TRUE; + underrun = true; #if 0 PA_DEBUG_TRAP; @@ -484,13 +484,13 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o #endif if (u->use_tsched) { - pa_bool_t reset_not_before = TRUE; + bool reset_not_before = true; if (!u->first && !u->after_rewind) { if (underrun || left_to_play < u->watermark_inc_threshold) increase_watermark(u); else if (left_to_play > u->watermark_dec_threshold) { - reset_not_before = FALSE; + reset_not_before = false; /* We decrease the watermark only if have actually * been woken up by a timeout. If something else woke @@ -508,8 +508,8 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o return left_to_play; } -static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled, pa_bool_t on_timeout) { - pa_bool_t work_done = FALSE; +static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, bool polled, bool on_timeout) { + bool work_done = false; pa_usec_t max_sleep_usec = 0, process_usec = 0; size_t left_to_play, input_underrun; unsigned j = 0; @@ -524,7 +524,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle snd_pcm_sframes_t n; size_t n_bytes; int r; - pa_bool_t after_avail = TRUE; + bool after_avail = true; /* First we determine how many samples are missing to fill the * buffer up to 100% */ @@ -544,7 +544,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle #endif left_to_play = check_left_to_play(u, n_bytes, on_timeout); - on_timeout = FALSE; + on_timeout = false; if (u->use_tsched) @@ -589,7 +589,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle } n_bytes -= u->hwbuf_unused; - polled = FALSE; + polled = false; #ifdef DEBUG_TIMING pa_log_debug("Filling up"); @@ -626,7 +626,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle break; pa_assert(frames > 0); - after_avail = FALSE; + after_avail = false; /* Check these are multiples of 8 bit */ pa_assert((areas[0].first & 7) == 0); @@ -639,7 +639,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle p = (uint8_t*) areas[0].addr + (offset * u->frame_size); written = frames * u->frame_size; - chunk.memblock = pa_memblock_new_fixed(u->core->mempool, p, written, TRUE); + chunk.memblock = pa_memblock_new_fixed(u->core->mempool, p, written, true); chunk.length = pa_memblock_get_length(chunk.memblock); chunk.index = 0; @@ -657,7 +657,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle return r; } - work_done = TRUE; + work_done = true; u->write_count += written; u->since_start += written; @@ -693,8 +693,8 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle return work_done ? 1 : 0; } -static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled, pa_bool_t on_timeout) { - pa_bool_t work_done = FALSE; +static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, bool polled, bool on_timeout) { + bool work_done = false; pa_usec_t max_sleep_usec = 0, process_usec = 0; size_t left_to_play, input_underrun; unsigned j = 0; @@ -709,7 +709,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle snd_pcm_sframes_t n; size_t n_bytes; int r; - pa_bool_t after_avail = TRUE; + bool after_avail = true; if (PA_UNLIKELY((n = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) { @@ -726,7 +726,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle #endif left_to_play = check_left_to_play(u, n_bytes, on_timeout); - on_timeout = FALSE; + on_timeout = false; if (u->use_tsched) @@ -764,7 +764,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle } n_bytes -= u->hwbuf_unused; - polled = FALSE; + polled = false; for (;;) { snd_pcm_sframes_t frames; @@ -802,7 +802,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle break; pa_assert(frames > 0); - after_avail = FALSE; + after_avail = false; written = frames * u->frame_size; u->memchunk.index += written; @@ -813,7 +813,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polle pa_memchunk_reset(&u->memchunk); } - work_done = TRUE; + work_done = true; u->write_count += written; u->since_start += written; @@ -862,7 +862,7 @@ static void update_smoother(struct userdata *u) { /* Let's update the time smoother */ - if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->sink->sample_spec, FALSE)) < 0)) { + if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->sink->sample_spec, false)) < 0)) { pa_log_warn("Failed to query DSP status data: %s", pa_alsa_strerror(err)); return; } @@ -1020,7 +1020,7 @@ static int update_sw_params(struct userdata *u) { /* Called from IO Context on unsuspend or from main thread when creating sink */ static void reset_watermark(struct userdata *u, size_t tsched_watermark, pa_sample_spec *ss, - pa_bool_t in_thread) { + bool in_thread) { u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, ss), &u->sink->sample_spec); @@ -1056,7 +1056,7 @@ static void reset_watermark(struct userdata *u, size_t tsched_watermark, pa_samp static int unsuspend(struct userdata *u) { pa_sample_spec ss; int err; - pa_bool_t b, d; + bool b, d; snd_pcm_uframes_t period_size, buffer_size; char *device_name = NULL; @@ -1088,7 +1088,7 @@ static int unsuspend(struct userdata *u) { b = u->use_mmap; d = u->use_tsched; - if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &period_size, &buffer_size, 0, &b, &d, TRUE)) < 0) { + if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &period_size, &buffer_size, 0, &b, &d, true)) < 0) { pa_log("Failed to set hardware parameters: %s", pa_alsa_strerror(err)); goto fail; } @@ -1118,16 +1118,16 @@ static int unsuspend(struct userdata *u) { goto fail; u->write_count = 0; - pa_smoother_reset(u->smoother, pa_rtclock_now(), TRUE); + pa_smoother_reset(u->smoother, pa_rtclock_now(), true); u->smoother_interval = SMOOTHER_MIN_INTERVAL; u->last_smoother_update = 0; - u->first = TRUE; + u->first = true; u->since_start = 0; /* reset the watermark to the value defined when sink was created */ if (u->use_tsched) - reset_watermark(u, u->tsched_watermark_ref, &u->sink->sample_spec, TRUE); + reset_watermark(u, u->tsched_watermark_ref, &u->sink->sample_spec, true); pa_log_info("Resumed successfully..."); @@ -1238,13 +1238,13 @@ static int ctl_mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { return 0; if (u->sink->suspend_cause & PA_SUSPEND_SESSION) { - pa_sink_set_mixer_dirty(u->sink, TRUE); + pa_sink_set_mixer_dirty(u->sink, true); return 0; } if (mask & SND_CTL_EVENT_MASK_VALUE) { - pa_sink_get_volume(u->sink, TRUE); - pa_sink_get_mute(u->sink, TRUE); + pa_sink_get_volume(u->sink, true); + pa_sink_get_mute(u->sink, true); } return 0; @@ -1260,7 +1260,7 @@ static int io_mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { return 0; if (u->sink->suspend_cause & PA_SUSPEND_SESSION) { - pa_sink_set_mixer_dirty(u->sink, TRUE); + pa_sink_set_mixer_dirty(u->sink, true); return 0; } @@ -1307,7 +1307,7 @@ static void sink_set_volume_cb(pa_sink *s) { struct userdata *u = s->userdata; pa_cvolume r; char vol_str_pcnt[PA_CVOLUME_SNPRINT_MAX]; - pa_bool_t deferred_volume = !!(s->flags & PA_SINK_DEFERRED_VOLUME); + bool deferred_volume = !!(s->flags & PA_SINK_DEFERRED_VOLUME); pa_assert(u); pa_assert(u->mixer_path); @@ -1326,7 +1326,7 @@ static void sink_set_volume_cb(pa_sink *s) { if (u->mixer_path->has_dB) { pa_cvolume new_soft_volume; - pa_bool_t accurate_enough; + bool accurate_enough; char vol_str_db[PA_SW_CVOLUME_SNPRINT_DB_MAX]; /* Match exactly what the user requested by software */ @@ -1373,11 +1373,11 @@ static void sink_write_volume_cb(pa_sink *s) { /* Shift up by the base volume */ pa_sw_cvolume_divide_scalar(&hw_vol, &hw_vol, s->base_volume); - if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &hw_vol, TRUE, TRUE) < 0) + if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &hw_vol, true, true) < 0) pa_log_error("Writing HW volume failed"); else { pa_cvolume tmp_vol; - pa_bool_t accurate_enough; + bool accurate_enough; /* Shift down by the base volume, so that 0dB becomes maximum volume */ pa_sw_cvolume_multiply_scalar(&hw_vol, &hw_vol, s->base_volume); @@ -1405,7 +1405,7 @@ static void sink_write_volume_cb(pa_sink *s) { static void sink_get_mute_cb(pa_sink *s) { struct userdata *u = s->userdata; - pa_bool_t b; + bool b; pa_assert(u); pa_assert(u->mixer_path); @@ -1447,7 +1447,7 @@ static void mixer_volume_init(struct userdata *u) { pa_sink_set_write_volume_callback(u->sink, NULL); if (u->mixer_path->has_dB) { - pa_sink_enable_decibel_volume(u->sink, TRUE); + pa_sink_enable_decibel_volume(u->sink, true); pa_log_info("Hardware volume ranges from %0.2f dB to %0.2f dB.", u->mixer_path->min_dB, u->mixer_path->max_dB); u->sink->base_volume = pa_sw_volume_from_dB(-u->mixer_path->max_dB); @@ -1455,7 +1455,7 @@ static void mixer_volume_init(struct userdata *u) { pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(u->sink->base_volume)); } else { - pa_sink_enable_decibel_volume(u->sink, FALSE); + pa_sink_enable_decibel_volume(u->sink, false); pa_log_info("Hardware volume ranges from %li to %li.", u->mixer_path->min_volume, u->mixer_path->max_volume); u->sink->base_volume = PA_VOLUME_NORM; @@ -1483,7 +1483,7 @@ static int sink_set_port_ucm_cb(pa_sink *s, pa_device_port *p) { pa_assert(p); pa_assert(u->ucm_context); - return pa_alsa_ucm_set_port(u->ucm_context, p, TRUE); + return pa_alsa_ucm_set_port(u->ucm_context, p, true); } static int sink_set_port_cb(pa_sink *s, pa_device_port *p) { @@ -1555,7 +1555,7 @@ static pa_idxset* sink_get_formats(pa_sink *s) { return ret; } -static pa_bool_t sink_set_formats(pa_sink *s, pa_idxset *formats) { +static bool sink_set_formats(pa_sink *s, pa_idxset *formats) { struct userdata *u = s->userdata; pa_format_info *f, *g; uint32_t idx, n; @@ -1566,7 +1566,7 @@ static pa_bool_t sink_set_formats(pa_sink *s, pa_idxset *formats) { PA_IDXSET_FOREACH(f, formats, idx) { if (is_iec958(u) && f->encoding == PA_ENCODING_EAC3_IEC61937) /* EAC3 cannot be sent over over S/PDIF */ - return FALSE; + return false; } pa_idxset_free(u->formats, (pa_free_cb_t) pa_format_info_free); @@ -1598,35 +1598,35 @@ static pa_bool_t sink_set_formats(pa_sink *s, pa_idxset *formats) { } } - return TRUE; + return true; } -static pa_bool_t sink_update_rate_cb(pa_sink *s, uint32_t rate) { +static bool sink_update_rate_cb(pa_sink *s, uint32_t rate) { struct userdata *u = s->userdata; int i; - pa_bool_t supported = FALSE; + bool supported = false; pa_assert(u); for (i = 0; u->rates[i]; i++) { if (u->rates[i] == rate) { - supported = TRUE; + supported = true; break; } } if (!supported) { pa_log_info("Sink does not support sample rate of %d Hz", rate); - return FALSE; + return false; } if (!PA_SINK_IS_OPENED(s->state)) { pa_log_info("Updating rate for device %s, new rate is %d",u->device_name, rate); u->sink->sample_spec.rate = rate; - return TRUE; + return true; } - return FALSE; + return false; } static int process_rewind(struct userdata *u) { @@ -1687,7 +1687,7 @@ static int process_rewind(struct userdata *u) { pa_log_debug("Rewound %lu bytes.", (unsigned long) rewind_nbytes); pa_sink_process_rewind(u->sink, rewind_nbytes); - u->after_rewind = TRUE; + u->after_rewind = true; return 0; } } else @@ -1727,7 +1727,7 @@ static void thread_func(void *userdata) { if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) { int work_done; pa_usec_t sleep_usec = 0; - pa_bool_t on_timeout = pa_rtpoll_timer_elapsed(u->rtpoll); + bool on_timeout = pa_rtpoll_timer_elapsed(u->rtpoll); if (u->use_mmap) work_done = mmap_write(u, &sleep_usec, revents & POLLOUT, on_timeout); @@ -1745,9 +1745,9 @@ static void thread_func(void *userdata) { pa_log_info("Starting playback."); snd_pcm_start(u->pcm_handle); - pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE); + pa_smoother_resume(u->smoother, pa_rtclock_now(), true); - u->first = FALSE; + u->first = false; } update_smoother(u); @@ -1789,7 +1789,7 @@ static void thread_func(void *userdata) { rtpoll_sleep = PA_MIN(sleep_usec, cusec); } - u->after_rewind = FALSE; + u->after_rewind = false; } @@ -1812,7 +1812,7 @@ static void thread_func(void *userdata) { pa_rtpoll_set_timer_disabled(u->rtpoll); /* Hmm, nothing to do. Let's sleep */ - if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) + if ((ret = pa_rtpoll_run(u->rtpoll, true)) < 0) goto fail; if (rtpoll_sleep > 0) { @@ -1851,7 +1851,7 @@ static void thread_func(void *userdata) { if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0) goto fail; - u->first = TRUE; + u->first = true; u->since_start = 0; revents = 0; } else if (revents && u->use_tsched && pa_log_ratelimit(PA_LOG_DEBUG)) @@ -1881,15 +1881,15 @@ static void set_sink_name(pa_sink_new_data *data, pa_modargs *ma, const char *de if ((n = pa_modargs_get_value(ma, "sink_name", NULL))) { pa_sink_new_data_set_name(data, n); - data->namereg_fail = TRUE; + data->namereg_fail = true; return; } if ((n = pa_modargs_get_value(ma, "name", NULL))) - data->namereg_fail = TRUE; + data->namereg_fail = true; else { n = device_id ? device_id : device_name; - data->namereg_fail = FALSE; + data->namereg_fail = false; } if (mapping) @@ -1901,7 +1901,7 @@ static void set_sink_name(pa_sink_new_data *data, pa_modargs *ma, const char *de pa_xfree(t); } -static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char *element, pa_bool_t ignore_dB) { +static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char *element, bool ignore_dB) { snd_hctl_t *hctl; if (!mapping && !element) @@ -1940,8 +1940,8 @@ fail: } } -static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) { - pa_bool_t need_mixer_callback = FALSE; +static int setup_mixer(struct userdata *u, bool ignore_dB) { + bool need_mixer_callback = false; pa_assert(u); @@ -1982,7 +1982,7 @@ static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) { PA_HASHMAP_FOREACH(p, u->mixer_path_set->paths, state) { if (p->has_volume || p->has_mute) - need_mixer_callback = TRUE; + need_mixer_callback = true; } } else if (u->mixer_path) @@ -2028,7 +2028,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark, rewind_safeguard; snd_pcm_uframes_t period_frames, buffer_frames, tsched_frames; size_t frame_size; - pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, deferred_volume = FALSE, set_formats = FALSE, fixed_latency_range = FALSE; + bool use_mmap = true, b, use_tsched = true, d, ignore_dB = false, namereg_fail = false, deferred_volume = false, set_formats = false, fixed_latency_range = false; pa_sink_new_data data; pa_alsa_profile_set *profile_set = NULL; void *state = NULL; @@ -2113,7 +2113,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca u->use_tsched = use_tsched; u->deferred_volume = deferred_volume; u->fixed_latency_range = fixed_latency_range; - u->first = TRUE; + u->first = true; u->rewind_safeguard = rewind_safeguard; u->rtpoll = pa_rtpoll_new(); pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); @@ -2121,11 +2121,11 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca u->smoother = pa_smoother_new( SMOOTHER_ADJUST_USEC, SMOOTHER_WINDOW_USEC, - TRUE, - TRUE, + true, + true, 5, pa_rtclock_now(), - TRUE); + true); u->smoother_interval = SMOOTHER_MIN_INTERVAL; /* use ucm */ @@ -2192,7 +2192,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca &ss, &map, SND_PCM_STREAM_PLAYBACK, &period_frames, &buffer_frames, tsched_frames, - &b, &d, FALSE))) + &b, &d, false))) goto fail; } @@ -2209,12 +2209,12 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca if (use_mmap && !b) { pa_log_info("Device doesn't support mmap(), falling back to UNIX read/write mode."); - u->use_mmap = use_mmap = FALSE; + u->use_mmap = use_mmap = false; } if (use_tsched && (!b || !d)) { pa_log_info("Cannot enable timer-based scheduling, falling back to sound IRQ scheduling."); - u->use_tsched = use_tsched = FALSE; + u->use_tsched = use_tsched = false; } if (u->use_mmap) @@ -2228,7 +2228,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca } if (is_iec958(u) || is_hdmi(u)) - set_formats = TRUE; + set_formats = true; u->rates = pa_alsa_get_supported_rates(u->pcm_handle, ss.rate); if (!u->rates) { @@ -2290,7 +2290,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca } if (u->ucm_context) - pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, TRUE, card); + pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, true, card); else if (u->mixer_path_set) pa_alsa_add_ports(&data, u->mixer_path_set, card); @@ -2352,7 +2352,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca if (u->use_tsched) { u->tsched_watermark_ref = tsched_watermark; - reset_watermark(u, u->tsched_watermark_ref, &ss, FALSE); + reset_watermark(u, u->tsched_watermark_ref, &ss, false); } else pa_sink_set_fixed_latency(u->sink, pa_bytes_to_usec(u->hwbuf_size, &ss)); @@ -2362,7 +2362,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca goto fail; if (u->ucm_context) { - if (u->sink->active_port && pa_alsa_ucm_set_port(u->ucm_context, u->sink->active_port, TRUE) < 0) + if (u->sink->active_port && pa_alsa_ucm_set_port(u->ucm_context, u->sink->active_port, true) < 0) goto fail; } else if (setup_mixer(u, ignore_dB) < 0) goto fail; diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index 6a53c4b53..3d5601374 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -123,9 +123,9 @@ struct userdata { char *device_name; /* name of the PCM device */ char *control_device; /* name of the control device */ - pa_bool_t use_mmap:1, use_tsched:1, deferred_volume:1, fixed_latency_range:1; + bool use_mmap:1, use_tsched:1, deferred_volume:1, fixed_latency_range:1; - pa_bool_t first; + bool first; pa_rtpoll_item *alsa_rtpoll_item; @@ -151,7 +151,7 @@ static pa_hook_result_t reserve_cb(pa_reserve_wrapper *r, void *forced, struct u pa_log_debug("Suspending source %s, because another application requested us to release the device.", u->source->name); - if (pa_source_suspend(u->source, TRUE, PA_SUSPEND_APPLICATION) < 0) + if (pa_source_suspend(u->source, true, PA_SUSPEND_APPLICATION) < 0) return PA_HOOK_CANCEL; return PA_HOOK_OK; @@ -420,14 +420,14 @@ static int try_recover(struct userdata *u, const char *call, int err) { return -1; } - u->first = TRUE; + u->first = true; return 0; } -static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t on_timeout) { +static size_t check_left_to_record(struct userdata *u, size_t n_bytes, bool on_timeout) { size_t left_to_record; size_t rec_space = u->hwbuf_size - u->hwbuf_unused; - pa_bool_t overrun = FALSE; + bool overrun = false; /* We use <= instead of < for this check here because an overrun * only happens after the last sample was processed, not already when @@ -440,7 +440,7 @@ static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t /* We got a dropout. What a mess! */ left_to_record = 0; - overrun = TRUE; + overrun = true; #ifdef DEBUG_TIMING PA_DEBUG_TRAP; @@ -455,12 +455,12 @@ static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t #endif if (u->use_tsched) { - pa_bool_t reset_not_before = TRUE; + bool reset_not_before = true; if (overrun || left_to_record < u->watermark_inc_threshold) increase_watermark(u); else if (left_to_record > u->watermark_dec_threshold) { - reset_not_before = FALSE; + reset_not_before = false; /* We decrease the watermark only if have actually * been woken up by a timeout. If something else woke @@ -477,8 +477,8 @@ static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t return left_to_record; } -static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled, pa_bool_t on_timeout) { - pa_bool_t work_done = FALSE; +static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, bool polled, bool on_timeout) { + bool work_done = false; pa_usec_t max_sleep_usec = 0, process_usec = 0; size_t left_to_record; unsigned j = 0; @@ -493,7 +493,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled snd_pcm_sframes_t n; size_t n_bytes; int r; - pa_bool_t after_avail = TRUE; + bool after_avail = true; if (PA_UNLIKELY((n = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->source->sample_spec)) < 0)) { @@ -510,7 +510,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled #endif left_to_record = check_left_to_record(u, n_bytes, on_timeout); - on_timeout = FALSE; + on_timeout = false; if (u->use_tsched) if (!polled && @@ -547,7 +547,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled break; } - polled = FALSE; + polled = false; #ifdef DEBUG_TIMING pa_log_debug("Reading"); @@ -583,7 +583,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled break; pa_assert(frames > 0); - after_avail = FALSE; + after_avail = false; /* Check these are multiples of 8 bit */ pa_assert((areas[0].first & 7) == 0); @@ -595,7 +595,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled p = (uint8_t*) areas[0].addr + (offset * u->frame_size); - chunk.memblock = pa_memblock_new_fixed(u->core->mempool, p, frames * u->frame_size, TRUE); + chunk.memblock = pa_memblock_new_fixed(u->core->mempool, p, frames * u->frame_size, true); chunk.length = pa_memblock_get_length(chunk.memblock); chunk.index = 0; @@ -610,7 +610,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled return r; } - work_done = TRUE; + work_done = true; u->read_count += frames * u->frame_size; @@ -638,8 +638,8 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled return work_done ? 1 : 0; } -static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled, pa_bool_t on_timeout) { - int work_done = FALSE; +static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, bool polled, bool on_timeout) { + int work_done = false; pa_usec_t max_sleep_usec = 0, process_usec = 0; size_t left_to_record; unsigned j = 0; @@ -654,7 +654,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled snd_pcm_sframes_t n; size_t n_bytes; int r; - pa_bool_t after_avail = TRUE; + bool after_avail = true; if (PA_UNLIKELY((n = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->source->sample_spec)) < 0)) { @@ -666,7 +666,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled n_bytes = (size_t) n * u->frame_size; left_to_record = check_left_to_record(u, n_bytes, on_timeout); - on_timeout = FALSE; + on_timeout = false; if (u->use_tsched) if (!polled && @@ -696,7 +696,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled break; } - polled = FALSE; + polled = false; for (;;) { void *p; @@ -734,7 +734,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled } pa_assert(frames > 0); - after_avail = FALSE; + after_avail = false; chunk.index = 0; chunk.length = (size_t) frames * u->frame_size; @@ -742,7 +742,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled pa_source_post(u->source, &chunk); pa_memblock_unref(chunk.memblock); - work_done = TRUE; + work_done = true; u->read_count += frames * u->frame_size; @@ -783,7 +783,7 @@ static void update_smoother(struct userdata *u) { /* Let's update the time smoother */ - if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->source->sample_spec, TRUE)) < 0)) { + if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->source->sample_spec, true)) < 0)) { pa_log_warn("Failed to get delay: %s", pa_alsa_strerror(err)); return; } @@ -913,7 +913,7 @@ static int update_sw_params(struct userdata *u) { /* Called from IO Context on unsuspend or from main thread when creating source */ static void reset_watermark(struct userdata *u, size_t tsched_watermark, pa_sample_spec *ss, - pa_bool_t in_thread) { + bool in_thread) { u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, ss), &u->source->sample_spec); @@ -949,7 +949,7 @@ static void reset_watermark(struct userdata *u, size_t tsched_watermark, pa_samp static int unsuspend(struct userdata *u) { pa_sample_spec ss; int err; - pa_bool_t b, d; + bool b, d; snd_pcm_uframes_t period_size, buffer_size; pa_assert(u); @@ -972,7 +972,7 @@ static int unsuspend(struct userdata *u) { b = u->use_mmap; d = u->use_tsched; - if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &period_size, &buffer_size, 0, &b, &d, TRUE)) < 0) { + if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &period_size, &buffer_size, 0, &b, &d, true)) < 0) { pa_log("Failed to set hardware parameters: %s", pa_alsa_strerror(err)); goto fail; } @@ -1004,15 +1004,15 @@ static int unsuspend(struct userdata *u) { /* FIXME: We need to reload the volume somehow */ u->read_count = 0; - pa_smoother_reset(u->smoother, pa_rtclock_now(), TRUE); + pa_smoother_reset(u->smoother, pa_rtclock_now(), true); u->smoother_interval = SMOOTHER_MIN_INTERVAL; u->last_smoother_update = 0; - u->first = TRUE; + u->first = true; /* reset the watermark to the value defined when source was created */ if (u->use_tsched) - reset_watermark(u, u->tsched_watermark_ref, &u->source->sample_spec, TRUE); + reset_watermark(u, u->tsched_watermark_ref, &u->source->sample_spec, true); pa_log_info("Resumed successfully..."); @@ -1120,13 +1120,13 @@ static int ctl_mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { return 0; if (u->source->suspend_cause & PA_SUSPEND_SESSION) { - pa_source_set_mixer_dirty(u->source, TRUE); + pa_source_set_mixer_dirty(u->source, true); return 0; } if (mask & SND_CTL_EVENT_MASK_VALUE) { - pa_source_get_volume(u->source, TRUE); - pa_source_get_mute(u->source, TRUE); + pa_source_get_volume(u->source, true); + pa_source_get_mute(u->source, true); } return 0; @@ -1142,7 +1142,7 @@ static int io_mixer_callback(snd_mixer_elem_t *elem, unsigned int mask) { return 0; if (u->source->suspend_cause & PA_SUSPEND_SESSION) { - pa_source_set_mixer_dirty(u->source, TRUE); + pa_source_set_mixer_dirty(u->source, true); return 0; } @@ -1189,7 +1189,7 @@ static void source_set_volume_cb(pa_source *s) { struct userdata *u = s->userdata; pa_cvolume r; char vol_str_pcnt[PA_CVOLUME_SNPRINT_MAX]; - pa_bool_t deferred_volume = !!(s->flags & PA_SOURCE_DEFERRED_VOLUME); + bool deferred_volume = !!(s->flags & PA_SOURCE_DEFERRED_VOLUME); pa_assert(u); pa_assert(u->mixer_path); @@ -1208,7 +1208,7 @@ static void source_set_volume_cb(pa_source *s) { if (u->mixer_path->has_dB) { pa_cvolume new_soft_volume; - pa_bool_t accurate_enough; + bool accurate_enough; char vol_str_db[PA_SW_CVOLUME_SNPRINT_DB_MAX]; /* Match exactly what the user requested by software */ @@ -1255,11 +1255,11 @@ static void source_write_volume_cb(pa_source *s) { /* Shift up by the base volume */ pa_sw_cvolume_divide_scalar(&hw_vol, &hw_vol, s->base_volume); - if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &hw_vol, TRUE, TRUE) < 0) + if (pa_alsa_path_set_volume(u->mixer_path, u->mixer_handle, &s->channel_map, &hw_vol, true, true) < 0) pa_log_error("Writing HW volume failed"); else { pa_cvolume tmp_vol; - pa_bool_t accurate_enough; + bool accurate_enough; /* Shift down by the base volume, so that 0dB becomes maximum volume */ pa_sw_cvolume_multiply_scalar(&hw_vol, &hw_vol, s->base_volume); @@ -1287,7 +1287,7 @@ static void source_write_volume_cb(pa_source *s) { static void source_get_mute_cb(pa_source *s) { struct userdata *u = s->userdata; - pa_bool_t b; + bool b; pa_assert(u); pa_assert(u->mixer_path); @@ -1329,7 +1329,7 @@ static void mixer_volume_init(struct userdata *u) { pa_source_set_write_volume_callback(u->source, NULL); if (u->mixer_path->has_dB) { - pa_source_enable_decibel_volume(u->source, TRUE); + pa_source_enable_decibel_volume(u->source, true); pa_log_info("Hardware volume ranges from %0.2f dB to %0.2f dB.", u->mixer_path->min_dB, u->mixer_path->max_dB); u->source->base_volume = pa_sw_volume_from_dB(-u->mixer_path->max_dB); @@ -1337,7 +1337,7 @@ static void mixer_volume_init(struct userdata *u) { pa_log_info("Fixing base volume to %0.2f dB", pa_sw_volume_to_dB(u->source->base_volume)); } else { - pa_source_enable_decibel_volume(u->source, FALSE); + pa_source_enable_decibel_volume(u->source, false); pa_log_info("Hardware volume ranges from %li to %li.", u->mixer_path->min_volume, u->mixer_path->max_volume); u->source->base_volume = PA_VOLUME_NORM; @@ -1365,7 +1365,7 @@ static int source_set_port_ucm_cb(pa_source *s, pa_device_port *p) { pa_assert(p); pa_assert(u->ucm_context); - return pa_alsa_ucm_set_port(u->ucm_context, p, FALSE); + return pa_alsa_ucm_set_port(u->ucm_context, p, false); } static int source_set_port_cb(pa_source *s, pa_device_port *p) { @@ -1409,32 +1409,32 @@ static void source_update_requested_latency_cb(pa_source *s) { update_sw_params(u); } -static pa_bool_t source_update_rate_cb(pa_source *s, uint32_t rate) { +static bool source_update_rate_cb(pa_source *s, uint32_t rate) { struct userdata *u = s->userdata; int i; - pa_bool_t supported = FALSE; + bool supported = false; pa_assert(u); for (i = 0; u->rates[i]; i++) { if (u->rates[i] == rate) { - supported = TRUE; + supported = true; break; } } if (!supported) { pa_log_info("Source does not support sample rate of %d Hz", rate); - return FALSE; + return false; } if (!PA_SOURCE_IS_OPENED(s->state)) { pa_log_info("Updating rate for device %s, new rate is %d", u->device_name, rate); u->source->sample_spec.rate = rate; - return TRUE; + return true; } - return FALSE; + return false; } static void thread_func(void *userdata) { @@ -1462,15 +1462,15 @@ static void thread_func(void *userdata) { if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) { int work_done; pa_usec_t sleep_usec = 0; - pa_bool_t on_timeout = pa_rtpoll_timer_elapsed(u->rtpoll); + bool on_timeout = pa_rtpoll_timer_elapsed(u->rtpoll); if (u->first) { pa_log_info("Starting capture."); snd_pcm_start(u->pcm_handle); - pa_smoother_resume(u->smoother, pa_rtclock_now(), TRUE); + pa_smoother_resume(u->smoother, pa_rtclock_now(), true); - u->first = FALSE; + u->first = false; } if (u->use_mmap) @@ -1524,7 +1524,7 @@ static void thread_func(void *userdata) { pa_rtpoll_set_timer_disabled(u->rtpoll); /* Hmm, nothing to do. Let's sleep */ - if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) + if ((ret = pa_rtpoll_run(u->rtpoll, true)) < 0) goto fail; if (rtpoll_sleep > 0) { @@ -1563,7 +1563,7 @@ static void thread_func(void *userdata) { if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0) goto fail; - u->first = TRUE; + u->first = true; revents = 0; } else if (revents && u->use_tsched && pa_log_ratelimit(PA_LOG_DEBUG)) pa_log_debug("Wakeup from ALSA!"); @@ -1592,15 +1592,15 @@ static void set_source_name(pa_source_new_data *data, pa_modargs *ma, const char if ((n = pa_modargs_get_value(ma, "source_name", NULL))) { pa_source_new_data_set_name(data, n); - data->namereg_fail = TRUE; + data->namereg_fail = true; return; } if ((n = pa_modargs_get_value(ma, "name", NULL))) - data->namereg_fail = TRUE; + data->namereg_fail = true; else { n = device_id ? device_id : device_name; - data->namereg_fail = FALSE; + data->namereg_fail = false; } if (mapping) @@ -1612,7 +1612,7 @@ static void set_source_name(pa_source_new_data *data, pa_modargs *ma, const char pa_xfree(t); } -static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char *element, pa_bool_t ignore_dB) { +static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char *element, bool ignore_dB) { snd_hctl_t *hctl; if (!mapping && !element) @@ -1651,8 +1651,8 @@ fail: } } -static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) { - pa_bool_t need_mixer_callback = FALSE; +static int setup_mixer(struct userdata *u, bool ignore_dB) { + bool need_mixer_callback = false; pa_assert(u); @@ -1692,7 +1692,7 @@ static int setup_mixer(struct userdata *u, pa_bool_t ignore_dB) { PA_HASHMAP_FOREACH(p, u->mixer_path_set->paths, state) { if (p->has_volume || p->has_mute) - need_mixer_callback = TRUE; + need_mixer_callback = true; } } else if (u->mixer_path) @@ -1738,7 +1738,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p uint32_t nfrags, frag_size, buffer_size, tsched_size, tsched_watermark; snd_pcm_uframes_t period_frames, buffer_frames, tsched_frames; size_t frame_size; - pa_bool_t use_mmap = TRUE, b, use_tsched = TRUE, d, ignore_dB = FALSE, namereg_fail = FALSE, deferred_volume = FALSE, fixed_latency_range = FALSE; + bool use_mmap = true, b, use_tsched = true, d, ignore_dB = false, namereg_fail = false, deferred_volume = false, fixed_latency_range = false; pa_source_new_data data; pa_alsa_profile_set *profile_set = NULL; void *state = NULL; @@ -1817,18 +1817,18 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p u->use_tsched = use_tsched; u->deferred_volume = deferred_volume; u->fixed_latency_range = fixed_latency_range; - u->first = TRUE; + u->first = true; u->rtpoll = pa_rtpoll_new(); pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); u->smoother = pa_smoother_new( SMOOTHER_ADJUST_USEC, SMOOTHER_WINDOW_USEC, - TRUE, - TRUE, + true, + true, 5, pa_rtclock_now(), - TRUE); + true); u->smoother_interval = SMOOTHER_MIN_INTERVAL; /* use ucm */ @@ -1895,7 +1895,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p &ss, &map, SND_PCM_STREAM_CAPTURE, &period_frames, &buffer_frames, tsched_frames, - &b, &d, FALSE))) + &b, &d, false))) goto fail; } @@ -1912,12 +1912,12 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p if (use_mmap && !b) { pa_log_info("Device doesn't support mmap(), falling back to UNIX read/write mode."); - u->use_mmap = use_mmap = FALSE; + u->use_mmap = use_mmap = false; } if (use_tsched && (!b || !d)) { pa_log_info("Cannot enable timer-based scheduling, falling back to sound IRQ scheduling."); - u->use_tsched = use_tsched = FALSE; + u->use_tsched = use_tsched = false; } if (u->use_mmap) @@ -1989,7 +1989,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p } if (u->ucm_context) - pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, FALSE, card); + pa_alsa_ucm_add_ports(&data.ports, data.proplist, u->ucm_context, false, card); else if (u->mixer_path_set) pa_alsa_add_ports(&data, u->mixer_path_set, card); @@ -2042,7 +2042,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p if (u->use_tsched) { u->tsched_watermark_ref = tsched_watermark; - reset_watermark(u, u->tsched_watermark_ref, &ss, FALSE); + reset_watermark(u, u->tsched_watermark_ref, &ss, false); } else pa_source_set_fixed_latency(u->source, pa_bytes_to_usec(u->hwbuf_size, &ss)); @@ -2053,7 +2053,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p goto fail; if (u->ucm_context) { - if (u->source->active_port && pa_alsa_ucm_set_port(u->ucm_context, u->source->active_port, FALSE) < 0) + if (u->source->active_port && pa_alsa_ucm_set_port(u->ucm_context, u->source->active_port, false) < 0) goto fail; } else if (setup_mixer(u, ignore_dB) < 0) goto fail; diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c index bc2ea9b77..677db9947 100644 --- a/src/modules/alsa/alsa-ucm.c +++ b/src/modules/alsa/alsa-ucm.c @@ -451,10 +451,10 @@ static void add_media_role(const char *name, pa_alsa_ucm_device *list, const cha static char *modifier_name_to_role(const char *mod_name, bool *is_sink) { char *sub = NULL, *tmp; - *is_sink = FALSE; + *is_sink = false; if (pa_startswith(mod_name, "Play")) { - *is_sink = TRUE; + *is_sink = true; sub = pa_xstrdup(mod_name + 4); } else if (pa_startswith(mod_name, "Capture")) sub = pa_xstrdup(mod_name + 7); @@ -476,7 +476,7 @@ static char *modifier_name_to_role(const char *mod_name, bool *is_sink) { static void ucm_set_media_roles(pa_alsa_ucm_modifier *modifier, pa_alsa_ucm_device *list, const char *mod_name) { int i; - bool is_sink = FALSE; + bool is_sink = false; char *sub = NULL; const char *role_name; @@ -729,7 +729,7 @@ static int ucm_port_contains(const char *port_name, const char *dev_name, bool i int len; if (!port_name || !dev_name) - return FALSE; + return false; port_name += is_sink ? strlen(PA_UCM_PRE_TAG_OUTPUT) : strlen(PA_UCM_PRE_TAG_INPUT); @@ -1203,9 +1203,9 @@ static int ucm_create_mapping( } if (sink) - ret = ucm_create_mapping_direction(ucm, ps, p, device, verb_name, device_name, sink, TRUE); + ret = ucm_create_mapping_direction(ucm, ps, p, device, verb_name, device_name, sink, true); if (ret == 0 && source) - ret = ucm_create_mapping_direction(ucm, ps, p, device, verb_name, device_name, source, FALSE); + ret = ucm_create_mapping_direction(ucm, ps, p, device, verb_name, device_name, source, false); return ret; } @@ -1260,7 +1260,7 @@ static int ucm_create_profile( p->output_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func); p->input_mappings = pa_idxset_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func); - p->supported = TRUE; + p->supported = true; pa_hashmap_put(ps->profiles, p->name, p); /* TODO: get profile priority from ucm info or policy management */ @@ -1305,9 +1305,9 @@ static int ucm_create_profile( source = pa_proplist_gets(mod->proplist, PA_ALSA_PROP_UCM_SOURCE); if (sink) - ucm_create_mapping_for_modifier(ucm, ps, p, mod, verb_name, name, sink, TRUE); + ucm_create_mapping_for_modifier(ucm, ps, p, mod, verb_name, name, sink, true); else if (source) - ucm_create_mapping_for_modifier(ucm, ps, p, mod, verb_name, name, source, FALSE); + ucm_create_mapping_for_modifier(ucm, ps, p, mod, verb_name, name, source, false); } pa_alsa_profile_dump(p); @@ -1405,7 +1405,7 @@ static void ucm_probe_profile_set(pa_alsa_ucm_config *ucm, pa_alsa_profile_set * if ((snd_use_case_set(ucm->ucm_mgr, "_verb", p->name)) < 0) { pa_log("Failed to set verb %s", p->name); - p->supported = FALSE; + p->supported = false; continue; } @@ -1418,7 +1418,7 @@ static void ucm_probe_profile_set(pa_alsa_ucm_config *ucm, pa_alsa_profile_set * m->output_pcm = mapping_open_pcm(ucm, m, SND_PCM_STREAM_PLAYBACK); if (!m->output_pcm) { - p->supported = FALSE; + p->supported = false; break; } } @@ -1433,7 +1433,7 @@ static void ucm_probe_profile_set(pa_alsa_ucm_config *ucm, pa_alsa_profile_set * m->input_pcm = mapping_open_pcm(ucm, m, SND_PCM_STREAM_CAPTURE); if (!m->input_pcm) { - p->supported = FALSE; + p->supported = false; break; } } @@ -1488,7 +1488,7 @@ pa_alsa_profile_set* pa_alsa_ucm_add_profile_set(pa_alsa_ucm_config *ucm, pa_cha } ucm_probe_profile_set(ucm, ps); - ps->probed = TRUE; + ps->probed = true; return ps; } diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 168a67884..75f58580a 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -191,17 +191,17 @@ int pa_alsa_set_hw_params( snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, - pa_bool_t *use_tsched, - pa_bool_t require_exact_channel_number) { + bool *use_mmap, + bool *use_tsched, + bool require_exact_channel_number) { int ret = -1; snd_pcm_hw_params_t *hwparams, *hwparams_copy; int dir; snd_pcm_uframes_t _period_size = period_size ? *period_size : 0; snd_pcm_uframes_t _buffer_size = buffer_size ? *buffer_size : 0; - pa_bool_t _use_mmap = use_mmap && *use_mmap; - pa_bool_t _use_tsched = use_tsched && *use_tsched; + bool _use_mmap = use_mmap && *use_mmap; + bool _use_tsched = use_tsched && *use_tsched; pa_sample_spec _ss = *ss; pa_assert(pcm_handle); @@ -231,7 +231,7 @@ int pa_alsa_set_hw_params( goto finish; } - _use_mmap = FALSE; + _use_mmap = false; } } else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) { @@ -240,10 +240,10 @@ int pa_alsa_set_hw_params( } if (!_use_mmap) - _use_tsched = FALSE; + _use_tsched = false; if (!pa_alsa_pcm_is_hw(pcm_handle)) - _use_tsched = FALSE; + _use_tsched = false; #if (SND_LIB_VERSION >= ((1<<16)|(0<<8)|24)) /* API additions in 1.0.24 */ if (_use_tsched) { @@ -251,7 +251,7 @@ int pa_alsa_set_hw_params( /* try to disable period wakeups if hardware can do so */ if (snd_pcm_hw_params_can_disable_period_wakeup(hwparams)) { - if ((ret = snd_pcm_hw_params_set_period_wakeup(pcm_handle, hwparams, FALSE)) < 0) + if ((ret = snd_pcm_hw_params_set_period_wakeup(pcm_handle, hwparams, false)) < 0) /* don't bail, keep going with default mode with period wakeups */ pa_log_debug("snd_pcm_hw_params_set_period_wakeup() failed: %s", pa_alsa_strerror(ret)); else @@ -426,7 +426,7 @@ finish: return ret; } -int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, pa_bool_t period_event) { +int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool period_event) { snd_pcm_sw_params_t *swparams; snd_pcm_uframes_t boundary; int err; @@ -487,8 +487,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto( snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, - pa_bool_t *use_tsched, + bool *use_mmap, + bool *use_tsched, pa_alsa_profile_set *ps, pa_alsa_mapping **mapping) { @@ -578,7 +578,7 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto( tsched_size, use_mmap, use_tsched, - FALSE); + false); pa_xfree(d); if (pcm_handle && mapping) @@ -596,8 +596,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping( snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, - pa_bool_t *use_tsched, + bool *use_mmap, + bool *use_tsched, pa_alsa_mapping *m) { snd_pcm_t *pcm_handle; @@ -648,14 +648,14 @@ snd_pcm_t *pa_alsa_open_by_device_string( snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, - pa_bool_t *use_tsched, - pa_bool_t require_exact_channel_number) { + bool *use_mmap, + bool *use_tsched, + bool require_exact_channel_number) { int err; char *d; snd_pcm_t *pcm_handle; - pa_bool_t reformat = FALSE; + bool reformat = false; pa_assert(device); pa_assert(ss); @@ -688,7 +688,7 @@ snd_pcm_t *pa_alsa_open_by_device_string( require_exact_channel_number)) < 0) { if (!reformat) { - reformat = TRUE; + reformat = true; snd_pcm_close(pcm_handle); continue; @@ -702,7 +702,7 @@ snd_pcm_t *pa_alsa_open_by_device_string( pa_xfree(d); d = t; - reformat = FALSE; + reformat = false; snd_pcm_close(pcm_handle); continue; @@ -741,9 +741,9 @@ snd_pcm_t *pa_alsa_open_by_template( snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size, snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, - pa_bool_t *use_tsched, - pa_bool_t require_exact_channel_number) { + bool *use_mmap, + bool *use_tsched, + bool require_exact_channel_number) { snd_pcm_t *pcm_handle; char **i; @@ -862,18 +862,18 @@ void pa_alsa_refcnt_dec(void) { } } -pa_bool_t pa_alsa_init_description(pa_proplist *p) { +bool pa_alsa_init_description(pa_proplist *p) { const char *d, *k; pa_assert(p); if (pa_device_init_description(p)) - return TRUE; + return true; if (!(d = pa_proplist_gets(p, "alsa.card_name"))) d = pa_proplist_gets(p, "alsa.name"); if (!d) - return FALSE; + return false; k = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_DESCRIPTION); @@ -882,7 +882,7 @@ pa_bool_t pa_alsa_init_description(pa_proplist *p) { else if (d) pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, d); - return FALSE; + return false; } void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) { @@ -1142,7 +1142,7 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa } int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, - pa_bool_t capture) { + bool capture) { ssize_t k; size_t abs_k; int err; @@ -1333,7 +1333,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_ 64000, 88200, 96000, 128000, 176400, 192000, 384000 }; - pa_bool_t supported[PA_ELEMENTSOF(all_rates)] = { FALSE, }; + bool supported[PA_ELEMENTSOF(all_rates)] = { false, }; snd_pcm_hw_params_t *hwparams; unsigned int i, j, n, *rates = NULL; int ret; @@ -1347,7 +1347,7 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_ for (i = 0, n = 0; i < PA_ELEMENTSOF(all_rates); i++) { if (snd_pcm_hw_params_test_rate(pcm, hwparams, all_rates[i], 0) == 0) { - supported[i] = TRUE; + supported[i] = true; n++; } } @@ -1377,26 +1377,26 @@ unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_ return rates; } -pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm) { +bool pa_alsa_pcm_is_hw(snd_pcm_t *pcm) { snd_pcm_info_t* info; snd_pcm_info_alloca(&info); pa_assert(pcm); if (snd_pcm_info(pcm, info) < 0) - return FALSE; + return false; return snd_pcm_info_get_card(info) >= 0; } -pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm) { +bool pa_alsa_pcm_is_modem(snd_pcm_t *pcm) { snd_pcm_info_t* info; snd_pcm_info_alloca(&info); pa_assert(pcm); if (snd_pcm_info(pcm, info) < 0) - return FALSE; + return false; return snd_pcm_info_get_class(info) == SND_PCM_CLASS_MODEM; } @@ -1428,26 +1428,26 @@ const char* pa_alsa_strerror(int errnum) { return translated; } -pa_bool_t pa_alsa_may_tsched(pa_bool_t want) { +bool pa_alsa_may_tsched(bool want) { if (!want) - return FALSE; + return false; if (!pa_rtclock_hrtimer()) { /* We cannot depend on being woken up in time when the timers are inaccurate, so let's fallback to classic IO based playback then. */ pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel."); - return FALSE; } + return false; } if (pa_running_in_vm()) { /* We cannot depend on being woken up when we ask for in a VM, * so let's fallback to classic IO based playback then. */ pa_log_notice("Disabling timer-based scheduling because running inside a VM."); - return FALSE; + return false; } - return TRUE; + return true; } snd_hctl_elem_t* pa_alsa_find_jack(snd_hctl_t *hctl, const char* jack_name) { diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index 5b0a0bdc3..0520b6b79 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -41,14 +41,14 @@ int pa_alsa_set_hw_params( snd_pcm_uframes_t *period_size, /* modified at return */ snd_pcm_uframes_t *buffer_size, /* modified at return */ snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, /* modified at return */ - pa_bool_t *use_tsched, /* modified at return */ - pa_bool_t require_exact_channel_number); + bool *use_mmap, /* modified at return */ + bool *use_tsched, /* modified at return */ + bool require_exact_channel_number); int pa_alsa_set_sw_params( snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, - pa_bool_t period_event); + bool period_event); /* Picks a working mapping from the profile set based on the specified ss/map */ snd_pcm_t *pa_alsa_open_by_device_id_auto( @@ -60,8 +60,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_auto( snd_pcm_uframes_t *period_size, /* modified at return */ snd_pcm_uframes_t *buffer_size, /* modified at return */ snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, /* modified at return */ - pa_bool_t *use_tsched, /* modified at return */ + bool *use_mmap, /* modified at return */ + bool *use_tsched, /* modified at return */ pa_alsa_profile_set *ps, pa_alsa_mapping **mapping); /* modified at return */ @@ -75,8 +75,8 @@ snd_pcm_t *pa_alsa_open_by_device_id_mapping( snd_pcm_uframes_t *period_size, /* modified at return */ snd_pcm_uframes_t *buffer_size, /* modified at return */ snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, /* modified at return */ - pa_bool_t *use_tsched, /* modified at return */ + bool *use_mmap, /* modified at return */ + bool *use_tsched, /* modified at return */ pa_alsa_mapping *mapping); /* Opens the explicit ALSA device */ @@ -89,9 +89,9 @@ snd_pcm_t *pa_alsa_open_by_device_string( snd_pcm_uframes_t *period_size, /* modified at return */ snd_pcm_uframes_t *buffer_size, /* modified at return */ snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, /* modified at return */ - pa_bool_t *use_tsched, /* modified at return */ - pa_bool_t require_exact_channel_number); + bool *use_mmap, /* modified at return */ + bool *use_tsched, /* modified at return */ + bool require_exact_channel_number); /* Opens the explicit ALSA device with a fallback list */ snd_pcm_t *pa_alsa_open_by_template( @@ -104,9 +104,9 @@ snd_pcm_t *pa_alsa_open_by_template( snd_pcm_uframes_t *period_size, /* modified at return */ snd_pcm_uframes_t *buffer_size, /* modified at return */ snd_pcm_uframes_t tsched_size, - pa_bool_t *use_mmap, /* modified at return */ - pa_bool_t *use_tsched, /* modified at return */ - pa_bool_t require_exact_channel_number); + bool *use_mmap, /* modified at return */ + bool *use_tsched, /* modified at return */ + bool require_exact_channel_number); void pa_alsa_dump(pa_log_level_t level, snd_pcm_t *pcm); void pa_alsa_dump_status(snd_pcm_t *pcm); @@ -118,14 +118,14 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t * void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card); void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm); void pa_alsa_init_proplist_ctl(pa_proplist *p, const char *name); -pa_bool_t pa_alsa_init_description(pa_proplist *p); +bool pa_alsa_init_description(pa_proplist *p); int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents); pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll); snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa_sample_spec *ss); -int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, pa_bool_t capture); +int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, bool capture); int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas, snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames, size_t hwbuf_size, const pa_sample_spec *ss); char *pa_alsa_get_driver_name(int card); @@ -135,12 +135,12 @@ char *pa_alsa_get_reserve_name(const char *device); unsigned int *pa_alsa_get_supported_rates(snd_pcm_t *pcm, unsigned int fallback_rate); -pa_bool_t pa_alsa_pcm_is_hw(snd_pcm_t *pcm); -pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm); +bool pa_alsa_pcm_is_hw(snd_pcm_t *pcm); +bool pa_alsa_pcm_is_modem(snd_pcm_t *pcm); const char* pa_alsa_strerror(int errnum); -pa_bool_t pa_alsa_may_tsched(pa_bool_t want); +bool pa_alsa_may_tsched(bool want); snd_hctl_elem_t* pa_alsa_find_jack(snd_hctl_t *hctl, const char* jack_name); snd_hctl_elem_t* pa_alsa_find_eld_ctl(snd_hctl_t *hctl, int device); diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c index e5da45491..f4fb77f8d 100644 --- a/src/modules/alsa/module-alsa-card.c +++ b/src/modules/alsa/module-alsa-card.c @@ -45,7 +45,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("ALSA Card"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(FALSE); +PA_MODULE_LOAD_ONCE(false); PA_MODULE_USAGE( "name= " "card_name= " @@ -122,7 +122,7 @@ struct userdata { pa_alsa_profile_set *profile_set; /* ucm stuffs */ - pa_bool_t use_ucm; + bool use_ucm; pa_alsa_ucm_config ucm; /* hooks for modifier action */ @@ -158,7 +158,7 @@ static void add_profiles(struct userdata *u, pa_hashmap *h, pa_hashmap *ports) { PA_IDXSET_FOREACH(m, ap->output_mappings, idx) { if (u->use_ucm) - pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context, TRUE, ports, cp, u->core); + pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context, true, ports, cp, u->core); else pa_alsa_path_set_add_ports(m->output_path_set, cp, ports, NULL, u->core); if (m->channel_map.channels > cp->max_sink_channels) @@ -171,7 +171,7 @@ static void add_profiles(struct userdata *u, pa_hashmap *h, pa_hashmap *ports) { PA_IDXSET_FOREACH(m, ap->input_mappings, idx) { if (u->use_ucm) - pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context, FALSE, ports, cp, u->core); + pa_alsa_ucm_add_ports_combination(NULL, &m->ucm_context, false, ports, cp, u->core); else pa_alsa_path_set_add_ports(m->input_path_set, cp, ports, NULL, u->core); if (m->channel_map.channels > cp->max_source_channels) @@ -256,7 +256,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) { am->sink = pa_alsa_sink_new(c->module, u->modargs, __FILE__, c, am); if (sink_inputs && am->sink) { - pa_sink_move_all_finish(am->sink, sink_inputs, FALSE); + pa_sink_move_all_finish(am->sink, sink_inputs, false); sink_inputs = NULL; } } @@ -268,7 +268,7 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) { am->source = pa_alsa_source_new(c->module, u->modargs, __FILE__, c, am); if (source_outputs && am->source) { - pa_source_move_all_finish(am->source, source_outputs, FALSE); + pa_source_move_all_finish(am->source, source_outputs, false); source_outputs = NULL; } } @@ -349,7 +349,7 @@ static void report_port_state(pa_device_port *p, struct userdata *u) { static int report_jack_state(snd_hctl_elem_t *elem, unsigned int mask) { struct userdata *u = snd_hctl_elem_get_callback_private(elem); snd_ctl_elem_value_t *elem_value; - pa_bool_t plugged_in; + bool plugged_in; void *state; pa_alsa_jack *jack; pa_device_port *port; @@ -502,7 +502,7 @@ static void init_jacks(struct userdata *u) { jack->hctl_elem = pa_alsa_find_jack(u->hctl_handle, jack->alsa_name); if (!jack->hctl_elem) { pa_log_warn("Jack '%s' seems to have disappeared.", jack->alsa_name); - jack->has_control = FALSE; + jack->has_control = false; continue; } snd_hctl_elem_set_callback_private(jack->hctl_elem, u); @@ -525,15 +525,15 @@ static void set_card_name(pa_card_new_data *data, pa_modargs *ma, const char *de if ((n = pa_modargs_get_value(ma, "card_name", NULL))) { pa_card_new_data_set_name(data, n); - data->namereg_fail = TRUE; + data->namereg_fail = true; return; } if ((n = pa_modargs_get_value(ma, "name", NULL))) - data->namereg_fail = TRUE; + data->namereg_fail = true; else { n = device_id; - data->namereg_fail = FALSE; + data->namereg_fail = false; } t = pa_sprintf_malloc("alsa_card.%s", n); @@ -604,13 +604,13 @@ static pa_hook_result_t source_output_unlink_hook_callback(pa_core *c, pa_source int pa__init(pa_module *m) { pa_card_new_data data; pa_modargs *ma; - pa_bool_t ignore_dB = FALSE; + bool ignore_dB = false; struct userdata *u; pa_reserve_wrapper *reserve = NULL; const char *description; const char *profile = NULL; char *fn = NULL; - pa_bool_t namereg_fail = FALSE; + bool namereg_fail = false; pa_alsa_refcnt_inc(); @@ -632,7 +632,7 @@ int pa__init(pa_module *m) { u->device_id = pa_xstrdup(pa_modargs_get_value(ma, "device_id", DEFAULT_DEVICE_ID)); u->modargs = ma; - u->use_ucm = TRUE; + u->use_ucm = true; u->ucm.core = m->core; if ((u->alsa_card_index = snd_card_get_index(u->device_id)) < 0) { @@ -673,7 +673,7 @@ int pa__init(pa_module *m) { (pa_hook_cb_t) source_output_unlink_hook_callback, u); } else { - u->use_ucm = FALSE; + u->use_ucm = false; #ifdef HAVE_UDEV fn = pa_udev_get_property(u->alsa_card_index, "PULSE_PROFILE_SET"); #endif diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c index 927f075ac..fdcb5cfd6 100644 --- a/src/modules/alsa/module-alsa-sink.c +++ b/src/modules/alsa/module-alsa-sink.c @@ -35,7 +35,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("ALSA Sink"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(FALSE); +PA_MODULE_LOAD_ONCE(false); PA_MODULE_USAGE( "name= " "sink_name= " diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c index efb2d0c53..7c8ace4e8 100644 --- a/src/modules/alsa/module-alsa-source.c +++ b/src/modules/alsa/module-alsa-source.c @@ -44,7 +44,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("ALSA Source"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(FALSE); +PA_MODULE_LOAD_ONCE(false); PA_MODULE_USAGE( "name= " "source_name= " diff --git a/src/modules/dbus/iface-card.c b/src/modules/dbus/iface-card.c index 6b5366ac0..19dd4ed5c 100644 --- a/src/modules/dbus/iface-card.c +++ b/src/modules/dbus/iface-card.c @@ -336,7 +336,7 @@ static void handle_set_active_profile(DBusConnection *conn, DBusMessage *msg, DB return; } - if ((r = pa_card_set_profile(c->card, pa_dbusiface_card_profile_get_name(new_active), TRUE)) < 0) { + if ((r = pa_card_set_profile(c->card, pa_dbusiface_card_profile_get_name(new_active), true)) < 0) { pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Internal error in PulseAudio: pa_card_set_profile() failed with error code %i.", r); return; diff --git a/src/modules/dbus/iface-client.c b/src/modules/dbus/iface-client.c index a7d2cb4ce..1264acdf4 100644 --- a/src/modules/dbus/iface-client.c +++ b/src/modules/dbus/iface-client.c @@ -364,7 +364,7 @@ static void handle_remove_properties(DBusConnection *conn, DBusMessage *msg, voi pa_dbusiface_client *c = userdata; char **keys = NULL; int n_keys = 0; - pa_bool_t changed = FALSE; + bool changed = false; int i = 0; pa_assert(conn); diff --git a/src/modules/dbus/iface-core.c b/src/modules/dbus/iface-core.c index 0a38272a2..be7881724 100644 --- a/src/modules/dbus/iface-core.c +++ b/src/modules/dbus/iface-core.c @@ -365,7 +365,7 @@ static dbus_bool_t get_is_local(DBusConnection *conn) { pa_assert(conn); if (!dbus_connection_get_socket(conn, &conn_fd)) - return FALSE; + return false; return pa_socket_is_local(conn_fd); } @@ -1407,9 +1407,9 @@ static void handle_upload_sample(DBusConnection *conn, DBusMessage *msg, void *u sample->volume.channels = n_channels; for (i = 0; i < n_volume_entries; ++i) sample->volume.values[i] = default_volume[i]; - sample->volume_is_set = TRUE; + sample->volume_is_set = true; } else { - sample->volume_is_set = FALSE; + sample->volume_is_set = false; } dbus_sample = pa_dbusiface_sample_new(c, sample); @@ -1427,17 +1427,17 @@ finish: pa_memblock_unref(chunk.memblock); } -static pa_bool_t contains_space(const char *string) { +static bool contains_space(const char *string) { const char *p; pa_assert(string); for (p = string; *p; ++p) { if (isspace(*p)) - return TRUE; + return true; } - return FALSE; + return false; } static void handle_load_module(DBusConnection *conn, DBusMessage *msg, void *userdata) { @@ -1530,7 +1530,7 @@ static void handle_exit(DBusConnection *conn, DBusMessage *msg, void *userdata) pa_dbus_send_empty_reply(conn, msg); - pa_core_exit(c->core, FALSE, 0); + pa_core_exit(c->core, false, 0); } static void handle_listen_for_signal(DBusConnection *conn, DBusMessage *msg, void *userdata) { diff --git a/src/modules/dbus/iface-device.c b/src/modules/dbus/iface-device.c index bedd6b832..f152ffe9c 100644 --- a/src/modules/dbus/iface-device.c +++ b/src/modules/dbus/iface-device.c @@ -440,29 +440,29 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag } if (d->type == PA_DEVICE_TYPE_SINK) - pa_sink_set_volume(d->sink, &new_vol, TRUE, TRUE); + pa_sink_set_volume(d->sink, &new_vol, true, true); else - pa_source_set_volume(d->source, &new_vol, TRUE, TRUE); + pa_source_set_volume(d->source, &new_vol, true, true); pa_dbus_send_empty_reply(conn, msg); } static void handle_get_has_flat_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t has_flat_volume = FALSE; + dbus_bool_t has_flat_volume = false; pa_assert(conn); pa_assert(msg); pa_assert(d); - has_flat_volume = (d->type == PA_DEVICE_TYPE_SINK) ? (d->sink->flags & PA_SINK_FLAT_VOLUME) : FALSE; + has_flat_volume = (d->type == PA_DEVICE_TYPE_SINK) ? (d->sink->flags & PA_SINK_FLAT_VOLUME) : false; pa_dbus_send_basic_variant_reply(conn, msg, DBUS_TYPE_BOOLEAN, &has_flat_volume); } static void handle_get_has_convertible_to_decibel_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t has_convertible_to_decibel_volume = FALSE; + dbus_bool_t has_convertible_to_decibel_volume = false; pa_assert(conn); pa_assert(msg); @@ -513,7 +513,7 @@ static void handle_get_mute(DBusConnection *conn, DBusMessage *msg, void *userda static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t mute = FALSE; + dbus_bool_t mute = false; pa_assert(conn); pa_assert(msg); @@ -523,16 +523,16 @@ static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageI dbus_message_iter_get_basic(iter, &mute); if (d->type == PA_DEVICE_TYPE_SINK) - pa_sink_set_mute(d->sink, mute, TRUE); + pa_sink_set_mute(d->sink, mute, true); else - pa_source_set_mute(d->source, mute, TRUE); + pa_source_set_mute(d->source, mute, true); pa_dbus_send_empty_reply(conn, msg); } static void handle_get_has_hardware_volume(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t has_hardware_volume = FALSE; + dbus_bool_t has_hardware_volume = false; pa_assert(conn); pa_assert(msg); @@ -547,7 +547,7 @@ static void handle_get_has_hardware_volume(DBusConnection *conn, DBusMessage *ms static void handle_get_has_hardware_mute(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t has_hardware_mute = FALSE; + dbus_bool_t has_hardware_mute = false; pa_assert(conn); pa_assert(msg); @@ -577,7 +577,7 @@ static void handle_get_configured_latency(DBusConnection *conn, DBusMessage *msg static void handle_get_has_dynamic_latency(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t has_dynamic_latency = FALSE; + dbus_bool_t has_dynamic_latency = false; pa_assert(conn); pa_assert(msg); @@ -617,7 +617,7 @@ static void handle_get_latency(DBusConnection *conn, DBusMessage *msg, void *use static void handle_get_is_hardware_device(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t is_hardware_device = FALSE; + dbus_bool_t is_hardware_device = false; pa_assert(conn); pa_assert(msg); @@ -632,7 +632,7 @@ static void handle_get_is_hardware_device(DBusConnection *conn, DBusMessage *msg static void handle_get_is_network_device(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t is_network_device = FALSE; + dbus_bool_t is_network_device = false; pa_assert(conn); pa_assert(msg); @@ -753,13 +753,13 @@ static void handle_set_active_port(DBusConnection *conn, DBusMessage *msg, DBusM } if (d->type == PA_DEVICE_TYPE_SINK) { - if ((r = pa_sink_set_port(d->sink, pa_dbusiface_device_port_get_name(new_active), TRUE)) < 0) { + if ((r = pa_sink_set_port(d->sink, pa_dbusiface_device_port_get_name(new_active), true)) < 0) { pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Internal error in PulseAudio: pa_sink_set_port() failed with error code %i.", r); return; } } else { - if ((r = pa_source_set_port(d->source, pa_dbusiface_device_port_get_name(new_active), TRUE)) < 0) { + if ((r = pa_source_set_port(d->source, pa_dbusiface_device_port_get_name(new_active), true)) < 0) { pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Internal error in PulseAudio: pa_source_set_port() failed with error code %i.", r); return; @@ -796,17 +796,17 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat pa_channel_map *channel_map = NULL; dbus_uint32_t channels[PA_CHANNELS_MAX]; dbus_uint32_t volume[PA_CHANNELS_MAX]; - dbus_bool_t has_flat_volume = FALSE; - dbus_bool_t has_convertible_to_decibel_volume = FALSE; + dbus_bool_t has_flat_volume = false; + dbus_bool_t has_convertible_to_decibel_volume = false; dbus_uint32_t base_volume = 0; dbus_uint32_t volume_steps = 0; - dbus_bool_t has_hardware_volume = FALSE; - dbus_bool_t has_hardware_mute = FALSE; + dbus_bool_t has_hardware_volume = false; + dbus_bool_t has_hardware_mute = false; dbus_uint64_t configured_latency = 0; - dbus_bool_t has_dynamic_latency = FALSE; + dbus_bool_t has_dynamic_latency = false; dbus_uint64_t latency = 0; - dbus_bool_t is_hardware_device = FALSE; - dbus_bool_t is_network_device = FALSE; + dbus_bool_t is_hardware_device = false; + dbus_bool_t is_network_device = false; dbus_uint32_t state = 0; const char **ports = NULL; unsigned n_ports = 0; @@ -847,7 +847,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat sample_format = d->source->sample_spec.format; sample_rate = d->source->sample_spec.rate; channel_map = &d->source->channel_map; - has_flat_volume = FALSE; + has_flat_volume = false; has_convertible_to_decibel_volume = d->source->flags & PA_SOURCE_DECIBEL_VOLUME; base_volume = d->source->base_volume; volume_steps = d->source->n_volume_steps; @@ -922,7 +922,7 @@ static void handle_get_all(DBusConnection *conn, DBusMessage *msg, void *userdat static void handle_suspend(DBusConnection *conn, DBusMessage *msg, void *userdata) { pa_dbusiface_device *d = userdata; - dbus_bool_t suspend = FALSE; + dbus_bool_t suspend = false; pa_client *client; pa_assert(conn); @@ -1074,7 +1074,7 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t pa_dbusiface_device *d = userdata; DBusMessage *signal_msg = NULL; const pa_cvolume *new_volume = NULL; - pa_bool_t new_mute = FALSE; + bool new_mute = false; pa_sink_state_t new_sink_state = 0; pa_source_state_t new_source_state = 0; pa_device_port *new_active_port = NULL; @@ -1096,8 +1096,8 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t && ((t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE))); new_volume = (d->type == PA_DEVICE_TYPE_SINK) - ? pa_sink_get_volume(d->sink, FALSE) - : pa_source_get_volume(d->source, FALSE); + ? pa_sink_get_volume(d->sink, false) + : pa_source_get_volume(d->source, false); if (!pa_cvolume_equal(&d->volume, new_volume)) { dbus_uint32_t volume[PA_CHANNELS_MAX]; @@ -1120,7 +1120,7 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t signal_msg = NULL; } - new_mute = (d->type == PA_DEVICE_TYPE_SINK) ? pa_sink_get_mute(d->sink, FALSE) : pa_source_get_mute(d->source, FALSE); + new_mute = (d->type == PA_DEVICE_TYPE_SINK) ? pa_sink_get_mute(d->sink, false) : pa_source_get_mute(d->source, false); if (d->mute != new_mute) { d->mute = new_mute; @@ -1211,8 +1211,8 @@ pa_dbusiface_device *pa_dbusiface_device_new_sink(pa_dbusiface_core *core, pa_si d->sink = pa_sink_ref(sink); d->type = PA_DEVICE_TYPE_SINK; d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SINK_OBJECT_NAME, sink->index); - d->volume = *pa_sink_get_volume(sink, FALSE); - d->mute = pa_sink_get_mute(sink, FALSE); + d->volume = *pa_sink_get_volume(sink, false); + d->mute = pa_sink_get_mute(sink, false); d->sink_state = pa_sink_get_state(sink); d->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); d->next_port_index = 0; @@ -1245,8 +1245,8 @@ pa_dbusiface_device *pa_dbusiface_device_new_source(pa_dbusiface_core *core, pa_ d->source = pa_source_ref(source); d->type = PA_DEVICE_TYPE_SOURCE; d->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, SOURCE_OBJECT_NAME, source->index); - d->volume = *pa_source_get_volume(source, FALSE); - d->mute = pa_source_get_mute(source, FALSE); + d->volume = *pa_source_get_volume(source, false); + d->mute = pa_source_get_mute(source, false); d->source_state = pa_source_get_state(source); d->ports = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func); d->next_port_index = 0; diff --git a/src/modules/dbus/iface-module.c b/src/modules/dbus/iface-module.c index ab92a7343..fb1d5880d 100644 --- a/src/modules/dbus/iface-module.c +++ b/src/modules/dbus/iface-module.c @@ -261,7 +261,7 @@ static void handle_unload(DBusConnection *conn, DBusMessage *msg, void *userdata return; } - pa_module_unload_request(m->module, FALSE); + pa_module_unload_request(m->module, false); pa_dbus_send_empty_reply(conn, msg); } diff --git a/src/modules/dbus/iface-stream.c b/src/modules/dbus/iface-stream.c index 851d51f85..43bc7026b 100644 --- a/src/modules/dbus/iface-stream.c +++ b/src/modules/dbus/iface-stream.c @@ -56,7 +56,7 @@ struct pa_dbusiface_stream { dbus_bool_t mute; pa_proplist *proplist; - pa_bool_t has_volume; + bool has_volume; pa_dbus_protocol *dbus_protocol; pa_subscription *subscription; @@ -356,7 +356,7 @@ static void handle_get_volume(DBusConnection *conn, DBusMessage *msg, void *user static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) { pa_dbusiface_stream *s = userdata; - pa_bool_t volume_writable = TRUE; + bool volume_writable = true; DBusMessageIter array_iter; int stream_channels = 0; dbus_uint32_t *volume = NULL; @@ -369,7 +369,7 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag pa_assert(iter); pa_assert(s); - volume_writable = (s->type == STREAM_TYPE_PLAYBACK) ? s->sink_input->volume_writable : FALSE; + volume_writable = (s->type == STREAM_TYPE_PLAYBACK) ? s->sink_input->volume_writable : false; if (!s->has_volume || !volume_writable) { char *str = stream_to_string(s); @@ -405,7 +405,7 @@ static void handle_set_volume(DBusConnection *conn, DBusMessage *msg, DBusMessag new_vol.values[i] = volume[i]; } - pa_sink_input_set_volume(s->sink_input, &new_vol, TRUE, TRUE); + pa_sink_input_set_volume(s->sink_input, &new_vol, true, true); pa_dbus_send_empty_reply(conn, msg); } @@ -427,7 +427,7 @@ static void handle_get_mute(DBusConnection *conn, DBusMessage *msg, void *userda static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageIter *iter, void *userdata) { pa_dbusiface_stream *s = userdata; - dbus_bool_t mute = FALSE; + dbus_bool_t mute = false; pa_assert(conn); pa_assert(msg); @@ -441,7 +441,7 @@ static void handle_set_mute(DBusConnection *conn, DBusMessage *msg, DBusMessageI return; } - pa_sink_input_set_mute(s->sink_input, mute, TRUE); + pa_sink_input_set_mute(s->sink_input, mute, true); pa_dbus_send_empty_reply(conn, msg); } @@ -621,7 +621,7 @@ static void handle_move(DBusConnection *conn, DBusMessage *msg, void *userdata) return; } - if (pa_sink_input_move_to(s->sink_input, sink, TRUE) < 0) { + if (pa_sink_input_move_to(s->sink_input, sink, true) < 0) { pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Moving playback stream %u to sink %s failed.", s->sink_input->index, sink->name); return; @@ -634,7 +634,7 @@ static void handle_move(DBusConnection *conn, DBusMessage *msg, void *userdata) return; } - if (pa_source_output_move_to(s->source_output, source, TRUE) < 0) { + if (pa_source_output_move_to(s->source_output, source, true) < 0) { pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Moving record stream %u to source %s failed.", s->source_output->index, source->name); return; @@ -736,12 +736,12 @@ static void subscription_cb(pa_core *c, pa_subscription_event_type_t t, uint32_t } if (s->type == STREAM_TYPE_PLAYBACK) { - pa_bool_t new_mute = FALSE; + bool new_mute = false; if (s->has_volume) { pa_cvolume new_volume; - pa_sink_input_get_volume(s->sink_input, &new_volume, TRUE); + pa_sink_input_get_volume(s->sink_input, &new_volume, true); if (!pa_cvolume_equal(&s->volume, &new_volume)) { dbus_uint32_t volume[PA_CHANNELS_MAX]; @@ -857,7 +857,7 @@ pa_dbusiface_stream *pa_dbusiface_stream_new_playback(pa_dbusiface_core *core, p s->has_volume = pa_sink_input_is_volume_readable(sink_input); if (s->has_volume) - pa_sink_input_get_volume(sink_input, &s->volume, TRUE); + pa_sink_input_get_volume(sink_input, &s->volume, true); else pa_cvolume_init(&s->volume); @@ -889,9 +889,9 @@ pa_dbusiface_stream *pa_dbusiface_stream_new_record(pa_dbusiface_core *core, pa_ s->source = pa_source_ref(source_output->source); s->sample_rate = source_output->sample_spec.rate; pa_cvolume_init(&s->volume); - s->mute = FALSE; + s->mute = false; s->proplist = pa_proplist_copy(source_output->proplist); - s->has_volume = FALSE; + s->has_volume = false; s->dbus_protocol = pa_dbus_protocol_get(source_output->core); s->subscription = pa_subscription_new(source_output->core, PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT, subscription_cb, s); s->send_event_slot = pa_hook_connect(&source_output->core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_SEND_EVENT], diff --git a/src/modules/dbus/module-dbus-protocol.c b/src/modules/dbus/module-dbus-protocol.c index 7bd86cfff..a061ad37a 100644 --- a/src/modules/dbus/module-dbus-protocol.c +++ b/src/modules/dbus/module-dbus-protocol.c @@ -50,7 +50,7 @@ PA_MODULE_USAGE( "access=local|remote|local,remote " "tcp_port= " "tcp_listen="); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); PA_MODULE_AUTHOR("Tanu Kaskinen"); PA_MODULE_VERSION(PACKAGE_VERSION); @@ -64,8 +64,8 @@ struct connection; struct userdata { pa_module *module; - pa_bool_t local_access; - pa_bool_t remote_access; + bool local_access; + bool remote_access; uint32_t tcp_port; char *tcp_listen; @@ -152,7 +152,7 @@ static void client_send_event_cb(pa_client *c, const char *name, pa_proplist *da static dbus_bool_t user_check_cb(DBusConnection *connection, unsigned long uid, void *data) { pa_log_debug("Allowing connection by user %lu.", uid); - return TRUE; + return true; } static DBusHandlerResult disconnection_filter_cb(DBusConnection *connection, DBusMessage *message, void *user_data) { @@ -198,12 +198,12 @@ static void connection_new_cb(DBusServer *dbus_server, DBusConnection *new_conne /* FIXME: Here we allow anyone from anywhere to access the server, * anonymously. Access control should be configurable. */ dbus_connection_set_unix_user_function(new_connection, user_check_cb, NULL, NULL); - dbus_connection_set_allow_anonymous(new_connection, TRUE); + dbus_connection_set_allow_anonymous(new_connection, true); } c = pa_xnew(struct connection, 1); c->server = s; - c->wrap_conn = pa_dbus_wrap_connection_new_from_existing(s->userdata->module->core->mainloop, TRUE, new_connection); + c->wrap_conn = pa_dbus_wrap_connection_new_from_existing(s->userdata->module->core->mainloop, true, new_connection); c->client = client; c->client->kill = client_kill_cb; @@ -302,7 +302,7 @@ static dbus_bool_t watch_add_cb(DBusWatch *watch, void *data) { dbus_watch_set_data(watch, ev, NULL); - return TRUE; + return true; } /* Called by D-Bus when a D-Bus fd watch event is removed. */ @@ -342,7 +342,7 @@ static dbus_bool_t timeout_add_cb(DBusTimeout *timeout, void *data) { pa_assert(s); if (!dbus_timeout_get_enabled(timeout)) - return FALSE; + return false; mainloop = s->userdata->module->core->mainloop; @@ -353,7 +353,7 @@ static dbus_bool_t timeout_add_cb(DBusTimeout *timeout, void *data) { dbus_timeout_set_data(timeout, ev, NULL); - return TRUE; + return true; } /* Called by D-Bus when a D-Bus timer event is removed. */ @@ -482,7 +482,7 @@ static struct server *start_tcp_server(struct userdata *u) { return s; } -static int get_access_arg(pa_modargs *ma, pa_bool_t *local_access, pa_bool_t *remote_access) { +static int get_access_arg(pa_modargs *ma, bool *local_access, bool *remote_access) { const char *value = NULL; pa_assert(ma); @@ -493,14 +493,14 @@ static int get_access_arg(pa_modargs *ma, pa_bool_t *local_access, pa_bool_t *re return 0; if (pa_streq(value, "local")) { - *local_access = TRUE; - *remote_access = FALSE; + *local_access = true; + *remote_access = false; } else if (pa_streq(value, "remote")) { - *local_access = FALSE; - *remote_access = TRUE; + *local_access = false; + *remote_access = true; } else if (pa_streq(value, "local,remote")) { - *local_access = TRUE; - *remote_access = TRUE; + *local_access = true; + *remote_access = true; } else return -1; @@ -536,8 +536,8 @@ int pa__init(pa_module *m) { m->userdata = u = pa_xnew0(struct userdata, 1); u->module = m; - u->local_access = TRUE; - u->remote_access = FALSE; + u->local_access = true; + u->remote_access = false; u->tcp_port = PA_DBUS_DEFAULT_PORT; if (get_access_arg(ma, &u->local_access, &u->remote_access) < 0) { diff --git a/src/modules/echo-cancel/adrian.c b/src/modules/echo-cancel/adrian.c index 2a795f1c5..c7f911f69 100644 --- a/src/modules/echo-cancel/adrian.c +++ b/src/modules/echo-cancel/adrian.c @@ -56,7 +56,7 @@ static void pa_adrian_ec_fixate_spec(pa_sample_spec *rec_ss, pa_channel_map *rec *rec_map = *out_map; } -pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -93,12 +93,12 @@ pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec, goto fail; pa_modargs_free(ma); - return TRUE; + return true; fail: if (ma) pa_modargs_free(ma); - return FALSE; + return false; } void pa_adrian_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) { diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h index cdc509d06..ffa5840fa 100644 --- a/src/modules/echo-cancel/echo-cancel.h +++ b/src/modules/echo-cancel/echo-cancel.h @@ -68,7 +68,7 @@ struct pa_echo_canceller_params { void *apm; uint32_t blocksize; pa_sample_spec sample_spec; - pa_bool_t agc; + bool agc; } webrtc; #endif /* each canceller-specific structure goes here */ @@ -76,14 +76,14 @@ struct pa_echo_canceller_params { /* Set this if canceller can do drift compensation. Also see set_drift() * below */ - pa_bool_t drift_compensation; + bool drift_compensation; }; typedef struct pa_echo_canceller pa_echo_canceller; struct pa_echo_canceller { /* Initialise canceller engine. */ - pa_bool_t (*init) (pa_core *c, + bool (*init) (pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, @@ -138,7 +138,7 @@ void pa_echo_canceller_set_capture_volume(pa_echo_canceller *ec, pa_cvolume *v); uint32_t pa_echo_canceller_blocksize_power2(unsigned rate, unsigned ms); /* Null canceller functions */ -pa_bool_t pa_null_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_null_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -148,7 +148,7 @@ void pa_null_ec_done(pa_echo_canceller *ec); #ifdef HAVE_SPEEX /* Speex canceller functions */ -pa_bool_t pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -159,7 +159,7 @@ void pa_speex_ec_done(pa_echo_canceller *ec); #ifdef HAVE_ADRIAN_EC /* Adrian Andre's echo canceller */ -pa_bool_t pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_adrian_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -171,7 +171,7 @@ void pa_adrian_ec_done(pa_echo_canceller *ec); #ifdef HAVE_WEBRTC /* WebRTC canceller functions */ PA_C_DECL_BEGIN -pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c index 1477d4be6..fbdb3b3ad 100644 --- a/src/modules/echo-cancel/module-echo-cancel.c +++ b/src/modules/echo-cancel/module-echo-cancel.c @@ -58,7 +58,7 @@ PA_MODULE_AUTHOR("Wim Taymans"); PA_MODULE_DESCRIPTION("Echo Cancellation"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(FALSE); +PA_MODULE_LOAD_ONCE(false); PA_MODULE_USAGE( _("source_name= " "source_properties= " @@ -140,8 +140,8 @@ static const pa_echo_canceller ec_table[] = { #define DEFAULT_CHANNELS 1 #define DEFAULT_ADJUST_TIME_USEC (1*PA_USEC_PER_SEC) #define DEFAULT_ADJUST_TOLERANCE (5*PA_USEC_PER_MSEC) -#define DEFAULT_SAVE_AEC FALSE -#define DEFAULT_AUTOLOADED FALSE +#define DEFAULT_SAVE_AEC false +#define DEFAULT_AUTOLOADED false #define MEMBLOCKQ_MAXLENGTH (16*1024*1024) @@ -206,29 +206,29 @@ struct userdata { pa_core *core; pa_module *module; - pa_bool_t autoloaded; - pa_bool_t dead; - pa_bool_t save_aec; + bool autoloaded; + bool dead; + bool save_aec; pa_echo_canceller *ec; uint32_t source_output_blocksize; uint32_t source_blocksize; uint32_t sink_blocksize; - pa_bool_t need_realign; + bool need_realign; /* to wakeup the source I/O thread */ pa_asyncmsgq *asyncmsgq; pa_rtpoll_item *rtpoll_item_read, *rtpoll_item_write; pa_source *source; - pa_bool_t source_auto_desc; + bool source_auto_desc; pa_source_output *source_output; pa_memblockq *source_memblockq; /* echo canceler needs fixed sized chunks */ size_t source_skip; pa_sink *sink; - pa_bool_t sink_auto_desc; + bool sink_auto_desc; pa_sink_input *sink_input; pa_memblockq *sink_memblockq; int64_t send_counter; /* updated in sink IO thread */ @@ -250,7 +250,7 @@ struct userdata { FILE *canceled_file; FILE *drift_file; - pa_bool_t use_volume_sharing; + bool use_volume_sharing; struct { pa_cvolume current_volume; @@ -479,9 +479,9 @@ static int source_set_state_cb(pa_source *s, pa_source_state_t state) { pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time); pa_atomic_store(&u->request_resync, 1); - pa_source_output_cork(u->source_output, FALSE); + pa_source_output_cork(u->source_output, false); } else if (state == PA_SOURCE_SUSPENDED) { - pa_source_output_cork(u->source_output, TRUE); + pa_source_output_cork(u->source_output, true); } return 0; @@ -504,9 +504,9 @@ static int sink_set_state_cb(pa_sink *s, pa_sink_state_t state) { pa_core_rttime_restart(u->core, u->time_event, pa_rtclock_now() + u->adjust_time); pa_atomic_store(&u->request_resync, 1); - pa_sink_input_cork(u->sink_input, FALSE); + pa_sink_input_cork(u->sink_input, false); } else if (state == PA_SINK_SUSPENDED) { - pa_sink_input_cork(u->sink_input, TRUE); + pa_sink_input_cork(u->sink_input, true); } return 0; @@ -565,7 +565,7 @@ static void sink_request_rewind_cb(pa_sink *s) { /* Just hand this one over to the master sink */ pa_sink_input_request_rewind(u->sink_input, - s->thread_info.rewind_nbytes, TRUE, FALSE, FALSE); + s->thread_info.rewind_nbytes, true, false, false); } /* Called from main context */ @@ -579,7 +579,7 @@ static void source_set_volume_cb(pa_source *s) { !PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output))) return; - pa_source_output_set_volume(u->source_output, &s->real_volume, s->save_volume, TRUE); + pa_source_output_set_volume(u->source_output, &s->real_volume, s->save_volume, true); } /* Called from main context */ @@ -593,7 +593,7 @@ static void sink_set_volume_cb(pa_sink *s) { !PA_SINK_INPUT_IS_LINKED(pa_sink_input_get_state(u->sink_input))) return; - pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, TRUE); + pa_sink_input_set_volume(u->sink_input, &s->real_volume, s->save_volume, true); } /* Called from main context. */ @@ -608,7 +608,7 @@ static void source_get_volume_cb(pa_source *s) { !PA_SOURCE_OUTPUT_IS_LINKED(pa_source_output_get_state(u->source_output))) return; - pa_source_output_get_volume(u->source_output, &v, TRUE); + pa_source_output_get_volume(u->source_output, &v, true); if (pa_cvolume_equal(&s->real_volume, &v)) /* no change */ @@ -1003,7 +1003,7 @@ static void source_output_process_rewind_cb(pa_source_output *o, size_t nbytes) pa_memblockq_rewind(u->sink_memblockq, nbytes); /* manipulate write index */ - pa_memblockq_seek(u->source_memblockq, -nbytes, PA_SEEK_RELATIVE, TRUE); + pa_memblockq_seek(u->source_memblockq, -nbytes, PA_SEEK_RELATIVE, true); pa_log_debug("Source rewind (%lld) %lld", (long long) nbytes, (long long) pa_memblockq_get_length (u->source_memblockq)); @@ -1058,7 +1058,7 @@ static int source_output_process_msg_cb(pa_msgobject *obj, int code, void *data, if (u->source_output->source->thread_info.state == PA_SOURCE_RUNNING) pa_memblockq_push_align(u->sink_memblockq, chunk); else - pa_memblockq_flush_write(u->sink_memblockq, TRUE); + pa_memblockq_flush_write(u->sink_memblockq, true); u->recv_counter += (int64_t) chunk->length; @@ -1069,9 +1069,9 @@ static int source_output_process_msg_cb(pa_msgobject *obj, int code, void *data, /* manipulate write index, never go past what we have */ if (PA_SOURCE_IS_OPENED(u->source_output->source->thread_info.state)) - pa_memblockq_seek(u->sink_memblockq, -offset, PA_SEEK_RELATIVE, TRUE); + pa_memblockq_seek(u->sink_memblockq, -offset, PA_SEEK_RELATIVE, true); else - pa_memblockq_flush_write(u->sink_memblockq, TRUE); + pa_memblockq_flush_write(u->sink_memblockq, true); pa_log_debug("Sink rewind (%lld)", (long long) offset); @@ -1363,7 +1363,7 @@ static void sink_input_state_change_cb(pa_sink_input *i, pa_sink_input_state_t s if (PA_SINK_INPUT_IS_LINKED(state) && i->thread_info.state == PA_SINK_INPUT_INIT) { pa_log_debug("Requesting rewind due to state change."); - pa_sink_input_request_rewind(i, 0, FALSE, TRUE, TRUE); + pa_sink_input_request_rewind(i, 0, false, true, true); } } @@ -1375,7 +1375,7 @@ static void source_output_kill_cb(pa_source_output *o) { pa_assert_ctl_context(); pa_assert_se(u = o->userdata); - u->dead = TRUE; + u->dead = true; /* The order here matters! We first kill the source output, followed * by the source. That means the source callbacks must be protected @@ -1391,7 +1391,7 @@ static void source_output_kill_cb(pa_source_output *o) { pa_log_debug("Source output kill %d", o->index); - pa_module_unload_request(u->module, TRUE); + pa_module_unload_request(u->module, true); } /* Called from main context */ @@ -1401,7 +1401,7 @@ static void sink_input_kill_cb(pa_sink_input *i) { pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); - u->dead = TRUE; + u->dead = true; /* The order here matters! We first kill the sink input, followed * by the sink. That means the sink callbacks must be protected @@ -1417,11 +1417,11 @@ static void sink_input_kill_cb(pa_sink_input *i) { pa_log_debug("Sink input kill %d", i->index); - pa_module_unload_request(u->module, TRUE); + pa_module_unload_request(u->module, true); } /* Called from main context. */ -static pa_bool_t source_output_may_move_to_cb(pa_source_output *o, pa_source *dest) { +static bool source_output_may_move_to_cb(pa_source_output *o, pa_source *dest) { struct userdata *u; pa_source_output_assert_ref(o); @@ -1429,20 +1429,20 @@ static pa_bool_t source_output_may_move_to_cb(pa_source_output *o, pa_source *de pa_assert_se(u = o->userdata); if (u->dead || u->autoloaded) - return FALSE; + return false; return (u->source != dest) && (u->sink != dest->monitor_of); } /* Called from main context */ -static pa_bool_t sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) { +static bool sink_input_may_move_to_cb(pa_sink_input *i, pa_sink *dest) { struct userdata *u; pa_sink_input_assert_ref(i); pa_assert_se(u = i->userdata); if (u->dead || u->autoloaded) - return FALSE; + return false; return u->sink != dest; } @@ -1539,9 +1539,9 @@ static int canceller_process_msg_cb(pa_msgobject *o, int code, void *userdata, i pa_cvolume *v = (pa_cvolume *) userdata; if (u->use_volume_sharing) - pa_source_set_volume(u->source, v, TRUE, FALSE); + pa_source_set_volume(u->source, v, true, false); else - pa_source_output_set_volume(u->source_output, v, FALSE, TRUE); + pa_source_output_set_volume(u->source_output, v, false, true); break; } @@ -1698,9 +1698,9 @@ int pa__init(pa_module*m) { u->core = m->core; u->module = m; m->userdata = u; - u->dead = FALSE; + u->dead = false; - u->use_volume_sharing = TRUE; + u->use_volume_sharing = true; if (pa_modargs_get_value_boolean(ma, "use_volume_sharing", &u->use_volume_sharing) < 0) { pa_log("use_volume_sharing= expects a boolean argument"); goto fail; @@ -1744,7 +1744,7 @@ int pa__init(pa_module*m) { goto fail; u->asyncmsgq = pa_asyncmsgq_new(0); - u->need_realign = TRUE; + u->need_realign = true; source_output_ss = source_ss; source_output_map = source_map; @@ -1815,7 +1815,7 @@ int pa__init(pa_module*m) { if (!u->use_volume_sharing) { pa_source_set_get_volume_callback(u->source, source_get_volume_cb); pa_source_set_set_volume_callback(u->source, source_set_volume_cb); - pa_source_enable_decibel_volume(u->source, TRUE); + pa_source_enable_decibel_volume(u->source, true); } u->source->userdata = u; @@ -1865,7 +1865,7 @@ int pa__init(pa_module*m) { pa_sink_set_set_mute_callback(u->sink, sink_set_mute_cb); if (!u->use_volume_sharing) { pa_sink_set_set_volume_callback(u->sink, sink_set_volume_cb); - pa_sink_enable_decibel_volume(u->sink, TRUE); + pa_sink_enable_decibel_volume(u->sink, true); } u->sink->userdata = u; @@ -1875,7 +1875,7 @@ int pa__init(pa_module*m) { pa_source_output_new_data_init(&source_output_data); source_output_data.driver = __FILE__; source_output_data.module = m; - pa_source_output_new_data_set_source(&source_output_data, source_master, FALSE); + pa_source_output_new_data_set_source(&source_output_data, source_master, false); source_output_data.destination_source = u->source; pa_proplist_sets(source_output_data.proplist, PA_PROP_MEDIA_NAME, "Echo-Cancel Source Stream"); @@ -1910,7 +1910,7 @@ int pa__init(pa_module*m) { pa_sink_input_new_data_init(&sink_input_data); sink_input_data.driver = __FILE__; sink_input_data.module = m; - pa_sink_input_new_data_set_sink(&sink_input_data, sink_master, FALSE); + pa_sink_input_new_data_set_sink(&sink_input_data, sink_master, false); sink_input_data.origin_sink = u->sink; pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_NAME, "Echo-Cancel Sink Stream"); pa_proplist_sets(sink_input_data.proplist, PA_PROP_MEDIA_ROLE, "filter"); @@ -2029,7 +2029,7 @@ void pa__done(pa_module*m) { if (!(u = m->userdata)) return; - u->dead = TRUE; + u->dead = true; /* See comments in source_output_kill_cb() above regarding * destruction order! */ diff --git a/src/modules/echo-cancel/null.c b/src/modules/echo-cancel/null.c index e89a4f4e4..642d5e86b 100644 --- a/src/modules/echo-cancel/null.c +++ b/src/modules/echo-cancel/null.c @@ -25,7 +25,7 @@ PA_C_DECL_BEGIN #include "echo-cancel.h" PA_C_DECL_END -pa_bool_t pa_null_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_null_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -43,7 +43,7 @@ pa_bool_t pa_null_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec_snprint(strss_source, sizeof(strss_source), out_ss), pa_sample_spec_snprint(strss_sink, sizeof(strss_sink), play_ss)); - return TRUE; + return true; } void pa_null_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) { diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c index 37ce122a0..41875e150 100644 --- a/src/modules/echo-cancel/speex.c +++ b/src/modules/echo-cancel/speex.c @@ -33,9 +33,9 @@ #define DEFAULT_FRAME_SIZE_MS 20 /* should be between 100-500 ms */ #define DEFAULT_FILTER_SIZE_MS 200 -#define DEFAULT_AGC_ENABLED TRUE -#define DEFAULT_DENOISE_ENABLED TRUE -#define DEFAULT_ECHO_SUPPRESS_ENABLED TRUE +#define DEFAULT_AGC_ENABLED true +#define DEFAULT_DENOISE_ENABLED true +#define DEFAULT_ECHO_SUPPRESS_ENABLED true #define DEFAULT_ECHO_SUPPRESS_ATTENUATION 0 static const char* const valid_modargs[] = { @@ -60,10 +60,10 @@ static void pa_speex_ec_fixate_spec(pa_sample_spec *rec_ss, pa_channel_map *rec_ *rec_map = *out_map; } -static pa_bool_t pa_speex_ec_preprocessor_init(pa_echo_canceller *ec, pa_sample_spec *out_ss, uint32_t nframes, pa_modargs *ma) { - pa_bool_t agc; - pa_bool_t denoise; - pa_bool_t echo_suppress; +static bool pa_speex_ec_preprocessor_init(pa_echo_canceller *ec, pa_sample_spec *out_ss, uint32_t nframes, pa_modargs *ma) { + bool agc; + bool denoise; + bool echo_suppress; int32_t echo_suppress_attenuation; int32_t echo_suppress_attenuation_active; @@ -140,13 +140,13 @@ static pa_bool_t pa_speex_ec_preprocessor_init(pa_echo_canceller *ec, pa_sample_ } else pa_log_info("All preprocessing options are disabled"); - return TRUE; + return true; fail: - return FALSE; + return false; } -pa_bool_t pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, @@ -189,7 +189,7 @@ pa_bool_t pa_speex_ec_init(pa_core *c, pa_echo_canceller *ec, goto fail; pa_modargs_free(ma); - return TRUE; + return true; fail: if (ma) @@ -202,7 +202,7 @@ fail: speex_echo_state_destroy(ec->params.priv.speex.state); ec->params.priv.speex.state = NULL; } - return FALSE; + return false; } void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) { diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc index 697e0baef..9de9fd2ea 100644 --- a/src/modules/echo-cancel/webrtc.cc +++ b/src/modules/echo-cancel/webrtc.cc @@ -40,14 +40,14 @@ PA_C_DECL_END #define BLOCK_SIZE_US 10000 -#define DEFAULT_HIGH_PASS_FILTER TRUE -#define DEFAULT_NOISE_SUPPRESSION TRUE -#define DEFAULT_ANALOG_GAIN_CONTROL TRUE -#define DEFAULT_DIGITAL_GAIN_CONTROL FALSE -#define DEFAULT_MOBILE FALSE +#define DEFAULT_HIGH_PASS_FILTER true +#define DEFAULT_NOISE_SUPPRESSION true +#define DEFAULT_ANALOG_GAIN_CONTROL true +#define DEFAULT_DIGITAL_GAIN_CONTROL false +#define DEFAULT_MOBILE false #define DEFAULT_ROUTING_MODE "speakerphone" -#define DEFAULT_COMFORT_NOISE TRUE -#define DEFAULT_DRIFT_COMPENSATION FALSE +#define DEFAULT_COMFORT_NOISE true +#define DEFAULT_DRIFT_COMPENSATION false static const char* const valid_modargs[] = { "high_pass_filter", @@ -76,13 +76,13 @@ static int routing_mode_from_string(const char *rmode) { return -1; } -pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, +bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, pa_sample_spec *rec_ss, pa_channel_map *rec_map, pa_sample_spec *play_ss, pa_channel_map *play_map, pa_sample_spec *out_ss, pa_channel_map *out_map, uint32_t *nframes, const char *args) { webrtc::AudioProcessing *apm = NULL; - pa_bool_t hpf, ns, agc, dgc, mobile, cn; + bool hpf, ns, agc, dgc, mobile, cn; int rm = -1; pa_modargs *ma; @@ -109,7 +109,7 @@ pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, goto fail; } - dgc = agc ? FALSE : DEFAULT_DIGITAL_GAIN_CONTROL; + dgc = agc ? false : DEFAULT_DIGITAL_GAIN_CONTROL; if (pa_modargs_get_value_boolean(ma, "digital_gain_control", &dgc) < 0) { pa_log("Failed to parse digital_gain_control value"); goto fail; @@ -197,17 +197,17 @@ pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, if (mobile && rm <= webrtc::EchoControlMobile::kEarpiece) { /* Maybe this should be a knob, but we've got a lot of knobs already */ apm->gain_control()->set_mode(webrtc::GainControl::kFixedDigital); - ec->params.priv.webrtc.agc = FALSE; + ec->params.priv.webrtc.agc = false; } else if (dgc) { apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveDigital); - ec->params.priv.webrtc.agc = FALSE; + ec->params.priv.webrtc.agc = false; } else { apm->gain_control()->set_mode(webrtc::GainControl::kAdaptiveAnalog); if (apm->gain_control()->set_analog_level_limits(0, PA_VOLUME_NORM-1) != apm->kNoError) { pa_log("Failed to initialise AGC"); goto fail; } - ec->params.priv.webrtc.agc = TRUE; + ec->params.priv.webrtc.agc = true; } apm->gain_control()->Enable(true); @@ -221,7 +221,7 @@ pa_bool_t pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, *nframes = ec->params.priv.webrtc.blocksize / pa_frame_size(out_ss); pa_modargs_free(ma); - return TRUE; + return true; fail: if (ma) @@ -229,7 +229,7 @@ fail: if (apm) webrtc::AudioProcessing::Destroy(apm); - return FALSE; + return false; } void pa_webrtc_ec_play(pa_echo_canceller *ec, const uint8_t *play) { diff --git a/src/modules/gconf/module-gconf.c b/src/modules/gconf/module-gconf.c index d5d336824..448fde514 100644 --- a/src/modules/gconf/module-gconf.c +++ b/src/modules/gconf/module-gconf.c @@ -45,7 +45,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("GConf Adapter"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); #define MAX_MODULES 10 #define BUF_MAX 2048 @@ -143,7 +143,7 @@ static void unload_one_module(struct module_info *m, unsigned i) { return; pa_log_debug("Unloading module #%i", m->items[i].index); - pa_module_unload_by_index(u->core, m->items[i].index, TRUE); + pa_module_unload_by_index(u->core, m->items[i].index, true); m->items[i].index = PA_INVALID_INDEX; pa_xfree(m->items[i].name); pa_xfree(m->items[i].args); @@ -166,7 +166,7 @@ static void load_module( unsigned i, const char *name, const char *args, - pa_bool_t is_new) { + bool is_new) { struct userdata *u; pa_module *mod; @@ -324,7 +324,7 @@ static void io_event_cb( u->io_event = NULL; } - pa_module_unload_request(u->module, TRUE); + pa_module_unload_request(u->module, true); } } diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c index 1e34abd46..dccf03273 100644 --- a/src/modules/jack/module-jack-sink.c +++ b/src/modules/jack/module-jack-sink.c @@ -60,7 +60,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("JACK Sink"); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_USAGE( "sink_name= " @@ -94,7 +94,7 @@ struct userdata { jack_nframes_t frames_in_buffer; jack_nframes_t saved_frame_time; - pa_bool_t saved_frame_time_valid; + bool saved_frame_time_valid; }; static const char* const valid_modargs[] = { @@ -154,7 +154,7 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse u->frames_in_buffer = (jack_nframes_t) offset; u->saved_frame_time = * (jack_nframes_t*) data; - u->saved_frame_time_valid = TRUE; + u->saved_frame_time_valid = true; return 0; @@ -232,7 +232,7 @@ static void thread_func(void *userdata) { if (PA_UNLIKELY(u->sink->thread_info.rewind_requested)) pa_sink_process_rewind(u->sink, 0); - if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) + if ((ret = pa_rtpoll_run(u->rtpoll, true)) < 0) goto fail; if (ret == 0) @@ -293,7 +293,7 @@ int pa__init(pa_module*m) { jack_status_t status; const char *server_name, *client_name; uint32_t channels = 0; - pa_bool_t do_connect = TRUE; + bool do_connect = true; unsigned i; const char **ports = NULL, **p; pa_sink_new_data data; @@ -320,7 +320,7 @@ int pa__init(pa_module*m) { m->userdata = u = pa_xnew0(struct userdata, 1); u->core = m->core; u->module = m; - u->saved_frame_time_valid = FALSE; + u->saved_frame_time_valid = false; u->rtpoll = pa_rtpoll_new(); pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c index cf62882e5..8f550e1fc 100644 --- a/src/modules/jack/module-jack-source.c +++ b/src/modules/jack/module-jack-source.c @@ -51,7 +51,7 @@ PA_MODULE_AUTHOR("Lennart Poettering"); PA_MODULE_DESCRIPTION("JACK Source"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); PA_MODULE_USAGE( "source_name= " "source_properties= " @@ -81,7 +81,7 @@ struct userdata { pa_thread *thread; jack_nframes_t saved_frame_time; - pa_bool_t saved_frame_time_valid; + bool saved_frame_time_valid; }; static const char* const valid_modargs[] = { @@ -115,7 +115,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off pa_source_post(u->source, chunk); u->saved_frame_time = (jack_nframes_t) offset; - u->saved_frame_time_valid = TRUE; + u->saved_frame_time_valid = true; return 0; @@ -198,7 +198,7 @@ static void thread_func(void *userdata) { for (;;) { int ret; - if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) + if ((ret = pa_rtpoll_run(u->rtpoll, true)) < 0) goto fail; if (ret == 0) @@ -247,7 +247,7 @@ int pa__init(pa_module*m) { jack_status_t status; const char *server_name, *client_name; uint32_t channels = 0; - pa_bool_t do_connect = TRUE; + bool do_connect = true; unsigned i; const char **ports = NULL, **p; pa_source_new_data data; @@ -274,7 +274,7 @@ int pa__init(pa_module*m) { m->userdata = u = pa_xnew0(struct userdata, 1); u->core = m->core; u->module = m; - u->saved_frame_time_valid = FALSE; + u->saved_frame_time_valid = false; u->rtpoll = pa_rtpoll_new(); pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll); diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c index cadf4c29a..5c2977257 100644 --- a/src/modules/jack/module-jackdbus-detect.c +++ b/src/modules/jack/module-jackdbus-detect.c @@ -38,7 +38,7 @@ PA_MODULE_AUTHOR("David Henningsson"); PA_MODULE_DESCRIPTION("Adds JACK sink/source ports when JACK is started"); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_USAGE( "channels= " @@ -80,9 +80,9 @@ struct userdata { pa_module *module; pa_core *core; pa_dbus_connection *connection; - pa_bool_t filter_added, match_added; - pa_bool_t is_service_started; - pa_bool_t autoconnect_ports; + bool filter_added, match_added; + bool is_service_started; + bool autoconnect_ports; uint32_t channels; /* Using index here protects us from module unloading without us knowing */ int jack_module_index[JACK_SS_COUNT]; @@ -94,7 +94,7 @@ static void ensure_ports_stopped(struct userdata* u) { for (i = 0; i < JACK_SS_COUNT; i++) if (u->jack_module_index[i]) { - pa_module_unload_request_by_index(u->core, u->jack_module_index[i], TRUE); + pa_module_unload_request_by_index(u->core, u->jack_module_index[i], true); u->jack_module_index[i] = 0; pa_log_info("Stopped %s.", modnames[i]); } @@ -125,10 +125,10 @@ static void ensure_ports_started(struct userdata* u) { } } -static pa_bool_t check_service_started(struct userdata* u) { +static bool check_service_started(struct userdata* u) { DBusError error; DBusMessage *m = NULL, *reply = NULL; - pa_bool_t new_status = FALSE; + bool new_status = false; dbus_bool_t call_result; pa_assert(u); @@ -230,7 +230,7 @@ int pa__init(pa_module *m) { m->userdata = u = pa_xnew0(struct userdata, 1); u->core = m->core; u->module = m; - u->autoconnect_ports = TRUE; + u->autoconnect_ports = true; u->channels = 0; if (pa_modargs_get_value_boolean(ma, "connect", &u->autoconnect_ports) < 0) { diff --git a/src/modules/macosx/module-bonjour-publish.c b/src/modules/macosx/module-bonjour-publish.c index d29d5185c..26081ec35 100644 --- a/src/modules/macosx/module-bonjour-publish.c +++ b/src/modules/macosx/module-bonjour-publish.c @@ -50,7 +50,7 @@ PA_MODULE_AUTHOR("Daniel Mack"); PA_MODULE_DESCRIPTION("Mac OS X Bonjour Service Publisher"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); #define SERVICE_TYPE_SINK "_pulse-sink._tcp" #define SERVICE_TYPE_SOURCE "_pulse-source._tcp" @@ -330,7 +330,7 @@ static void service_free(struct service *s) { pa_xfree(s); } -static pa_bool_t shall_ignore(pa_object *o) { +static bool shall_ignore(pa_object *o) { pa_object_assert_ref(o); if (pa_sink_isinstance(o)) diff --git a/src/modules/macosx/module-coreaudio-detect.c b/src/modules/macosx/module-coreaudio-detect.c index 849bc876f..81cd94c39 100644 --- a/src/modules/macosx/module-coreaudio-detect.c +++ b/src/modules/macosx/module-coreaudio-detect.c @@ -40,7 +40,7 @@ PA_MODULE_AUTHOR("Daniel Mack"); PA_MODULE_DESCRIPTION("CoreAudio device detection"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(TRUE); +PA_MODULE_LOAD_ONCE(true); PA_MODULE_USAGE("ioproc_frames= "); static const char* const valid_modargs[] = { @@ -146,11 +146,11 @@ static int ca_update_device_list(struct pa_module *m) { /* scan for devices which are reported but not in our cached list */ for (i = 0; i < num_devices; i++) { - bool found = FALSE; + bool found = false; PA_LLIST_FOREACH(dev, u->devices) if (dev->id == device_id[i]) { - found = TRUE; + found = true; break; } @@ -162,17 +162,17 @@ static int ca_update_device_list(struct pa_module *m) { scan_removed: PA_LLIST_FOREACH(dev, u->devices) { - bool found = FALSE; + bool found = false; for (i = 0; i < num_devices; i++) if (dev->id == device_id[i]) { - found = TRUE; + found = true; break; } if (!found) { pa_log_debug("object id %d has been removed (module index %d) %p", (unsigned int) dev->id, dev->module_index, dev); - pa_module_unload_request_by_index(m->core, dev->module_index, TRUE); + pa_module_unload_request_by_index(m->core, dev->module_index, true); PA_LLIST_REMOVE(ca_device, u->devices, dev); pa_xfree(dev); /* the current list item pointer is not valid anymore, so start over. */ @@ -265,7 +265,7 @@ void pa__done(pa_module *m) { while (dev) { struct ca_device *next = dev->next; - pa_module_unload_request_by_index(m->core, dev->module_index, TRUE); + pa_module_unload_request_by_index(m->core, dev->module_index, true); pa_xfree(dev); dev = next; diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c index be5664b31..7b3a00275 100644 --- a/src/modules/macosx/module-coreaudio-device.c +++ b/src/modules/macosx/module-coreaudio-device.c @@ -57,7 +57,7 @@ PA_MODULE_AUTHOR("Daniel Mack"); PA_MODULE_DESCRIPTION("CoreAudio device"); PA_MODULE_VERSION(PACKAGE_VERSION); -PA_MODULE_LOAD_ONCE(FALSE); +PA_MODULE_LOAD_ONCE(false); PA_MODULE_USAGE("object_id= " "ioproc_frames=