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
This commit is contained in:
poljar (Damir Jelić) 2013-06-27 19:28:09 +02:00 committed by Tanu Kaskinen
parent e9822bfcb0
commit d806b19714
288 changed files with 3360 additions and 3360 deletions

View file

@ -70,19 +70,19 @@ static char *device = NULL;
static SNDFILE* sndfile = NULL;
static pa_bool_t verbose = FALSE;
static bool verbose = false;
static pa_volume_t volume = PA_VOLUME_NORM;
static pa_bool_t volume_is_set = FALSE;
static bool volume_is_set = false;
static pa_sample_spec sample_spec = {
.format = PA_SAMPLE_S16LE,
.rate = 44100,
.channels = 2
};
static pa_bool_t sample_spec_set = FALSE;
static bool sample_spec_set = false;
static pa_channel_map channel_map;
static pa_bool_t channel_map_set = FALSE;
static bool channel_map_set = false;
static sf_count_t (*readf_function)(SNDFILE *_sndfile, void *ptr, sf_count_t frames) = NULL;
static sf_count_t (*writef_function)(SNDFILE *_sndfile, const void *ptr, sf_count_t frames) = NULL;
@ -92,7 +92,7 @@ static pa_stream_flags_t flags = 0;
static size_t latency = 0, process_time = 0;
static int32_t latency_msec = 0, process_time_msec = 0;
static pa_bool_t raw = TRUE;
static bool raw = true;
static int file_format = -1;
static uint32_t cork_requests = 0;
@ -776,16 +776,16 @@ int main(int argc, char *argv[]) {
if (strstr(bn, "play")) {
mode = PLAYBACK;
raw = FALSE;
raw = false;
} else if (strstr(bn, "record")) {
mode = RECORD;
raw = FALSE;
raw = false;
} else if (strstr(bn, "cat")) {
mode = PLAYBACK;
raw = TRUE;
raw = true;
} else if (strstr(bn, "rec") || strstr(bn, "mon")) {
mode = RECORD;
raw = TRUE;
raw = true;
}
proplist = pa_proplist_new();
@ -863,23 +863,23 @@ int main(int argc, char *argv[]) {
case ARG_VOLUME: {
int v = atoi(optarg);
volume = v < 0 ? 0U : (pa_volume_t) v;
volume_is_set = TRUE;
volume_is_set = true;
break;
}
case ARG_CHANNELS:
sample_spec.channels = (uint8_t) atoi(optarg);
sample_spec_set = TRUE;
sample_spec_set = true;
break;
case ARG_SAMPLEFORMAT:
sample_spec.format = pa_parse_sample_format(optarg);
sample_spec_set = TRUE;
sample_spec_set = true;
break;
case ARG_SAMPLERATE:
sample_spec.rate = (uint32_t) atoi(optarg);
sample_spec_set = TRUE;
sample_spec_set = true;
break;
case ARG_CHANNELMAP:
@ -888,7 +888,7 @@ int main(int argc, char *argv[]) {
goto quit;
}
channel_map_set = TRUE;
channel_map_set = true;
break;
case ARG_FIX_CHANNELS:
@ -955,7 +955,7 @@ int main(int argc, char *argv[]) {
}
case ARG_RAW:
raw = TRUE;
raw = true;
break;
case ARG_PASSTHROUGH:
@ -970,7 +970,7 @@ int main(int argc, char *argv[]) {
}
}
raw = FALSE;
raw = false;
break;
case ARG_LIST_FILE_FORMATS:
@ -1055,7 +1055,7 @@ int main(int argc, char *argv[]) {
pa_log(_("Failed to determine sample specification from file."));
goto quit;
}
sample_spec_set = TRUE;
sample_spec_set = true;
if (!channel_map_set) {
/* Allow the user to overwrite the channel map on the command line */
@ -1063,7 +1063,7 @@ int main(int argc, char *argv[]) {
if (sample_spec.channels > 2)
pa_log(_("Warning: Failed to determine channel map from file."));
} else
channel_map_set = TRUE;
channel_map_set = true;
}
}
}

View file

@ -99,7 +99,7 @@ int main(int argc, char*argv[]) {
char *obuf = NULL;
size_t buf_size, ibuf_size, ibuf_index, ibuf_length, obuf_size, obuf_index, obuf_length;
char *cli;
pa_bool_t ibuf_eof, obuf_eof, ibuf_closed, obuf_closed;
bool ibuf_eof, obuf_eof, ibuf_closed, obuf_closed;
struct pollfd pollfd[3];
struct pollfd *watch_socket, *watch_stdin, *watch_stdout;
@ -190,7 +190,7 @@ int main(int argc, char*argv[]) {
obuf_size = PA_MIN(buf_size, pa_pipe_buf(STDOUT_FILENO));
obuf = pa_xmalloc(obuf_size);
ibuf_index = ibuf_length = obuf_index = obuf_length = 0;
ibuf_eof = obuf_eof = ibuf_closed = obuf_closed = FALSE;
ibuf_eof = obuf_eof = ibuf_closed = obuf_closed = false;
if (argc > 1) {
for (i = 1; i < argc; i++) {
@ -206,7 +206,7 @@ int main(int argc, char*argv[]) {
}
}
ibuf_eof = TRUE;
ibuf_eof = true;
}
for (;;) {
@ -220,12 +220,12 @@ int main(int argc, char*argv[]) {
if (ibuf_length <= 0 && ibuf_eof && !ibuf_closed) {
shutdown(fd, SHUT_WR);
ibuf_closed = TRUE;
ibuf_closed = true;
}
if (obuf_length <= 0 && obuf_eof && !obuf_closed) {
shutdown(fd, SHUT_RD);
obuf_closed = TRUE;
obuf_closed = true;
}
pa_zero(pollfd);
@ -275,13 +275,13 @@ int main(int argc, char*argv[]) {
goto quit;
}
ibuf_eof = TRUE;
ibuf_eof = true;
} else {
ibuf_length = (size_t) r;
ibuf_index = 0;
}
} else if (watch_stdin->revents & POLLHUP)
ibuf_eof = TRUE;
ibuf_eof = true;
}
if (watch_socket) {
@ -295,18 +295,18 @@ int main(int argc, char*argv[]) {
goto quit;
}
obuf_eof = TRUE;
obuf_eof = true;
} else {
obuf_length = (size_t) r;
obuf_index = 0;
}
} else if (watch_socket->revents & POLLHUP)
obuf_eof = TRUE;
obuf_eof = true;
}
if (watch_stdout) {
if (watch_stdout->revents & POLLHUP) {
obuf_eof = TRUE;
obuf_eof = true;
obuf_length = 0;
} else if (watch_stdout->revents & POLLOUT) {
ssize_t r;
@ -324,7 +324,7 @@ int main(int argc, char*argv[]) {
if (watch_socket) {
if (watch_socket->revents & POLLHUP) {
ibuf_eof = TRUE;
ibuf_eof = true;
ibuf_length = 0;
} if (watch_socket->revents & POLLOUT) {
ssize_t r;

View file

@ -65,10 +65,10 @@ static uint32_t
source_output_idx = PA_INVALID_INDEX,
sink_idx = PA_INVALID_INDEX;
static pa_bool_t short_list_format = FALSE;
static bool short_list_format = false;
static uint32_t module_index;
static int32_t latency_offset;
static pa_bool_t suspend;
static bool suspend;
static pa_volume_t volume;
static enum volume_flags {
VOL_UINT = 0,
@ -95,7 +95,7 @@ static pa_channel_map channel_map;
static size_t sample_length = 0;
static int actions = 1;
static pa_bool_t nl = FALSE;
static bool nl = false;
static enum {
NONE,
@ -265,7 +265,7 @@ static void get_sink_info_callback(pa_context *c, const pa_sink_info *i, int is_
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
if (short_list_format) {
printf("%u\t%s\t%s\t%s\t%s\n",
@ -378,7 +378,7 @@ static void get_source_info_callback(pa_context *c, const pa_source_info *i, int
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
if (short_list_format) {
printf("%u\t%s\t%s\t%s\t%s\n",
@ -475,7 +475,7 @@ static void get_module_info_callback(pa_context *c, const pa_module_info *i, int
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_snprintf(t, sizeof(t), "%u", i->n_used);
@ -517,7 +517,7 @@ static void get_client_info_callback(pa_context *c, const pa_client_info *i, int
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_snprintf(t, sizeof(t), "%u", i->owner_module);
@ -560,7 +560,7 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_snprintf(t, sizeof(t), "%u", i->owner_module);
@ -641,7 +641,7 @@ static void get_sink_input_info_callback(pa_context *c, const pa_sink_input_info
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_snprintf(t, sizeof(t), "%u", i->owner_module);
pa_snprintf(k, sizeof(k), "%u", i->client);
@ -713,7 +713,7 @@ static void get_source_output_info_callback(pa_context *c, const pa_source_outpu
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_snprintf(t, sizeof(t), "%u", i->owner_module);
pa_snprintf(k, sizeof(k), "%u", i->client);
@ -785,7 +785,7 @@ static void get_sample_info_callback(pa_context *c, const pa_sample_info *i, int
if (nl && !short_list_format)
printf("\n");
nl = TRUE;
nl = true;
pa_bytes_snprint(t, sizeof(t), i->bytes);
@ -864,7 +864,7 @@ static void volume_relative_adjust(pa_cvolume *cv) {
}
static void unload_module_by_name_callback(pa_context *c, const pa_module_info *i, int is_last, void *userdata) {
static pa_bool_t unloaded = FALSE;
static bool unloaded = false;
if (is_last < 0) {
pa_log(_("Failed to get module information: %s"), pa_strerror(pa_context_errno(c)));
@ -873,7 +873,7 @@ static void unload_module_by_name_callback(pa_context *c, const pa_module_info *
}
if (is_last) {
if (unloaded == FALSE)
if (unloaded == false)
pa_log(_("Failed to unload module: Module %s not loaded"), module_name);
complete_action();
return;
@ -882,7 +882,7 @@ static void unload_module_by_name_callback(pa_context *c, const pa_module_info *
pa_assert(i);
if (pa_streq(module_name, i->name)) {
unloaded = TRUE;
unloaded = true;
actions++;
pa_operation_unref(pa_context_unload_module(c, i->index, simple_callback, NULL));
}
@ -1590,9 +1590,9 @@ int main(int argc, char *argv[]) {
if (optind < argc) {
if (pa_streq(argv[optind], "stat")) {
action = STAT;
short_list_format = FALSE;
short_list_format = false;
if (optind+1 < argc && pa_streq(argv[optind+1], "short"))
short_list_format = TRUE;
short_list_format = true;
} else if (pa_streq(argv[optind], "info"))
action = INFO;
@ -1610,7 +1610,7 @@ int main(int argc, char *argv[]) {
pa_streq(argv[i], "samples") || pa_streq(argv[i], "cards")) {
list_type = pa_xstrdup(argv[i]);
} else if (pa_streq(argv[i], "short")) {
short_list_format = TRUE;
short_list_format = true;
} else {
pa_log(_("Specify nothing, or one of: %s"), "modules, sinks, sources, sink-inputs, source-outputs, clients, samples, cards");
goto quit;

View file

@ -1526,7 +1526,7 @@ int open(const char *filename, int flags, ...) {
return real_open(filename, flags, mode);
}
static pa_bool_t is_audio_device_node(const char *path) {
static bool is_audio_device_node(const char *path) {
return
pa_streq(path, "/dev/dsp") ||
pa_streq(path, "/dev/adsp") ||

View file

@ -194,7 +194,7 @@ int main(int argc, char *argv[]) {
pa_client_conf_free(conf);
if (pa_authkey_load_auto(cookie_file, TRUE, cookie, sizeof(cookie)) < 0) {
if (pa_authkey_load_auto(cookie_file, true, cookie, sizeof(cookie)) < 0) {
fprintf(stderr, _("Failed to load cookie data\n"));
goto finish;
}