Rename functions with "tostring" in the name to one with "to_string" to conform with the convention.

component: core

<EP-E358F00C1D9A449EAE69225B9D2530F8>
BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=88833

Signed-off-by: Deepak Srivastava <srivastava.d@samsung.com>
This commit is contained in:
Deepak Srivastava 2015-06-12 18:17:07 +05:30 committed by Arun Raghavan
parent bb88d90950
commit 2d5eec2d2c
24 changed files with 46 additions and 46 deletions

View file

@ -395,7 +395,7 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d
} }
pa_xfree(conf->script_commands); pa_xfree(conf->script_commands);
conf->script_commands = pa_strbuf_tostring_free(buf); conf->script_commands = pa_strbuf_to_string_free(buf);
*d = optind; *d = optind;

View file

@ -804,5 +804,5 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) {
pa_xfree(log_target); pa_xfree(log_target);
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }

View file

@ -1082,7 +1082,7 @@ int main(int argc, char *argv[]) {
if (r >= 0) if (r >= 0)
r = pa_cli_command_execute(c, conf->script_commands, buf, &conf->fail); r = pa_cli_command_execute(c, conf->script_commands, buf, &conf->fail);
pa_log_error("%s", s = pa_strbuf_tostring_free(buf)); pa_log_error("%s", s = pa_strbuf_to_string_free(buf));
pa_xfree(s); pa_xfree(s);
if (r < 0 && conf->fail) { if (r < 0 && conf->fail) {

View file

@ -4273,7 +4273,7 @@ static int profile_verify(pa_alsa_profile *p) {
pa_strbuf_printf(sb, _("%s Input"), m->description); pa_strbuf_printf(sb, _("%s Input"), m->description);
} }
p->description = pa_strbuf_tostring_free(sb); p->description = pa_strbuf_to_string_free(sb);
} }
return 0; return 0;
@ -4333,7 +4333,7 @@ void pa_alsa_decibel_fix_dump(pa_alsa_decibel_fix *db_fix) {
for (i = 0; i < nsteps; ++i) for (i = 0; i < nsteps; ++i)
pa_strbuf_printf(buf, "[%li]:%0.2f ", i + db_fix->min_step, db_fix->db_values[i] / 100.0); pa_strbuf_printf(buf, "[%li]:%0.2f ", i + db_fix->min_step, db_fix->db_values[i] / 100.0);
db_values = pa_strbuf_tostring_free(buf); db_values = pa_strbuf_to_string_free(buf);
} }
pa_log_debug("Decibel fix %s, min_step=%li, max_step=%li, db_values=%s", pa_log_debug("Decibel fix %s, min_step=%li, max_step=%li, db_values=%s",

View file

@ -1504,7 +1504,7 @@ static void handle_load_module(DBusConnection *conn, DBusMessage *msg, void *use
dbus_message_iter_next(&dict_iter); dbus_message_iter_next(&dict_iter);
} }
arg_string = pa_strbuf_tostring(arg_buffer); arg_string = pa_strbuf_to_string(arg_buffer);
if (!(module = pa_module_load(c->core, name, arg_string))) { if (!(module = pa_module_load(c->core, name, arg_string))) {
pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Failed to load module."); pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Failed to load module.");

View file

@ -411,7 +411,7 @@ static int ca_device_create_sink(pa_module *m, AudioBuffer *buf, int channel_idx
pa_strbuf_puts(strbuf, tmp); pa_strbuf_puts(strbuf, tmp);
} }
ca_sink->name = pa_strbuf_tostring_free(strbuf); ca_sink->name = pa_strbuf_to_string_free(strbuf);
pa_log_debug("Stream name is >%s<", ca_sink->name); pa_log_debug("Stream name is >%s<", ca_sink->name);
@ -529,7 +529,7 @@ static int ca_device_create_source(pa_module *m, AudioBuffer *buf, int channel_i
pa_strbuf_puts(strbuf, tmp); pa_strbuf_puts(strbuf, tmp);
} }
ca_source->name = pa_strbuf_tostring_free(strbuf); ca_source->name = pa_strbuf_to_string_free(strbuf);
pa_log_debug("Stream name is >%s<", ca_source->name); pa_log_debug("Stream name is >%s<", ca_source->name);

View file

@ -937,7 +937,7 @@ static DBusHandlerResult sinks_and_sources_handler(DBusConnection *c, DBusMessag
} }
pa_strbuf_puts(sb, CONTAINER_INTROSPECT_XML_POSTFIX); pa_strbuf_puts(sb, CONTAINER_INTROSPECT_XML_POSTFIX);
xml = pa_strbuf_tostring_free(sb); xml = pa_strbuf_to_string_free(sb);
pa_assert_se(r = dbus_message_new_method_return(m)); pa_assert_se(r = dbus_message_new_method_return(m));
pa_assert_se(dbus_message_append_args(r, DBUS_TYPE_STRING, &xml, DBUS_TYPE_INVALID)); pa_assert_se(dbus_message_append_args(r, DBUS_TYPE_STRING, &xml, DBUS_TYPE_INVALID));

View file

@ -421,7 +421,7 @@ static void card_changed(struct userdata *u, struct udev_device *dev) {
if (u->tsched_buffer_size_valid) if (u->tsched_buffer_size_valid)
pa_strbuf_printf(args_buf, " tsched_buffer_size=%" PRIu32, u->tsched_buffer_size); pa_strbuf_printf(args_buf, " tsched_buffer_size=%" PRIu32, u->tsched_buffer_size);
d->args = pa_strbuf_tostring_free(args_buf); d->args = pa_strbuf_to_string_free(args_buf);
pa_hashmap_put(u->devices, d->path, d); pa_hashmap_put(u->devices, d->path, d);

View file

@ -159,7 +159,7 @@ char *pa_headerlist_to_string(pa_headerlist *p) {
pa_strbuf_printf(buf, "%s: %s\r\n", key, v); pa_strbuf_printf(buf, "%s: %s\r\n", key, v);
} }
return pa_strbuf_tostring_free(buf); return pa_strbuf_to_string_free(buf);
} }
int pa_headerlist_contains(pa_headerlist *p, const char *key) { int pa_headerlist_contains(pa_headerlist *p, const char *key) {

View file

@ -205,7 +205,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
/* End of headers */ /* End of headers */
/* We will have a header left from our looping iteration, so add it in :) */ /* We will have a header left from our looping iteration, so add it in :) */
if (c->last_header) { if (c->last_header) {
char *tmp = pa_strbuf_tostring_free(c->header_buffer); char *tmp = pa_strbuf_to_string_free(c->header_buffer);
/* This is not a continuation header so let's dump it into our proplist */ /* This is not a continuation header so let's dump it into our proplist */
pa_headerlist_puts(c->response_headers, c->last_header, tmp); pa_headerlist_puts(c->response_headers, c->last_header, tmp);
pa_xfree(tmp); pa_xfree(tmp);
@ -233,7 +233,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
} }
if (c->last_header) { if (c->last_header) {
char *tmp = pa_strbuf_tostring_free(c->header_buffer); char *tmp = pa_strbuf_to_string_free(c->header_buffer);
/* This is not a continuation header so let's dump the full /* This is not a continuation header so let's dump the full
header/value into our proplist */ header/value into our proplist */
pa_headerlist_puts(c->response_headers, c->last_header, tmp); pa_headerlist_puts(c->response_headers, c->last_header, tmp);
@ -432,7 +432,7 @@ static int rtsp_exec(pa_rtsp_client* c, const char* cmd,
} }
/* Our packet is created... now we can send it :) */ /* Our packet is created... now we can send it :) */
hdrs = pa_strbuf_tostring_free(buf); hdrs = pa_strbuf_to_string_free(buf);
/*pa_log_debug("Submitting request:"); /*pa_log_debug("Submitting request:");
pa_log_debug(hdrs);*/ pa_log_debug(hdrs);*/
pa_ioline_puts(c->ioline, hdrs); pa_ioline_puts(c->ioline, hdrs);

View file

@ -83,7 +83,7 @@ static void publish_servers(struct userdata *u, pa_strlist *l) {
char *s; char *s;
l = pa_strlist_reverse(l); l = pa_strlist_reverse(l);
s = pa_strlist_tostring(l); s = pa_strlist_to_string(l);
pa_strlist_reverse(l); pa_strlist_reverse(l);
pa_x11_set_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_SERVER", s); pa_x11_set_prop(pa_x11_wrapper_get_xcb_connection(u->x11_wrapper), screen, "PULSE_SERVER", s);

View file

@ -435,7 +435,7 @@ char *pa_proplist_to_string_sep(pa_proplist *p, const char *sep) {
} }
} }
return pa_strbuf_tostring_free(buf); return pa_strbuf_to_string_free(buf);
} }
char *pa_proplist_to_string(pa_proplist *p) { char *pa_proplist_to_string(pa_proplist *p) {

View file

@ -68,7 +68,7 @@ char *pa_module_list_to_string(pa_core *c) {
pa_xfree(t); pa_xfree(t);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_client_list_to_string(pa_core *c) { char *pa_client_list_to_string(pa_core *c) {
@ -98,7 +98,7 @@ char *pa_client_list_to_string(pa_core *c) {
pa_xfree(t); pa_xfree(t);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
static const char *available_to_string(pa_available_t a) { static const char *available_to_string(pa_available_t a) {
@ -193,7 +193,7 @@ char *pa_card_list_to_string(pa_core *c) {
append_port_list(s, card->ports); append_port_list(s, card->ports);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
static const char *sink_state_to_string(pa_sink_state_t state) { static const char *sink_state_to_string(pa_sink_state_t state) {
@ -345,7 +345,7 @@ char *pa_sink_list_to_string(pa_core *c) {
sink->active_port->name); sink->active_port->name);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_source_list_to_string(pa_core *c) { char *pa_source_list_to_string(pa_core *c) {
@ -460,7 +460,7 @@ char *pa_source_list_to_string(pa_core *c) {
source->active_port->name); source->active_port->name);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_source_output_list_to_string(pa_core *c) { char *pa_source_output_list_to_string(pa_core *c) {
@ -557,7 +557,7 @@ char *pa_source_output_list_to_string(pa_core *c) {
pa_xfree(t); pa_xfree(t);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_sink_input_list_to_string(pa_core *c) { char *pa_sink_input_list_to_string(pa_core *c) {
@ -653,7 +653,7 @@ char *pa_sink_input_list_to_string(pa_core *c) {
pa_xfree(t); pa_xfree(t);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_scache_list_to_string(pa_core *c) { char *pa_scache_list_to_string(pa_core *c) {
@ -712,7 +712,7 @@ char *pa_scache_list_to_string(pa_core *c) {
} }
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }
char *pa_full_status_string(pa_core *c) { char *pa_full_status_string(pa_core *c) {
@ -755,5 +755,5 @@ char *pa_full_status_string(pa_core *c) {
pa_xfree(t); pa_xfree(t);
} }
return pa_strbuf_tostring_free(s); return pa_strbuf_to_string_free(s);
} }

View file

@ -152,7 +152,7 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
else else
pa_cli_command_execute_line(c->core, s, buf, &c->fail); pa_cli_command_execute_line(c->core, s, buf, &c->fail);
c->defer_kill--; c->defer_kill--;
pa_ioline_puts(line, p = pa_strbuf_tostring_free(buf)); pa_ioline_puts(line, p = pa_strbuf_to_string_free(buf));
pa_xfree(p); pa_xfree(p);
if (c->kill_requested) { if (c->kill_requested) {

View file

@ -3202,7 +3202,7 @@ char *pa_replace(const char*s, const char*a, const char *b) {
pa_strbuf_puts(sb, s); pa_strbuf_puts(sb, s);
return pa_strbuf_tostring_free(sb); return pa_strbuf_to_string_free(sb);
} }
char *pa_escape(const char *p, const char *chars) { char *pa_escape(const char *p, const char *chars) {
@ -3224,7 +3224,7 @@ char *pa_escape(const char *p, const char *chars) {
pa_strbuf_putc(buf, *s); pa_strbuf_putc(buf, *s);
} }
return pa_strbuf_tostring_free(buf); return pa_strbuf_to_string_free(buf);
} }
char *pa_unescape(char *p) { char *pa_unescape(char *p) {

View file

@ -257,7 +257,7 @@ static void update_introspection(struct object_entry *oe) {
pa_strbuf_puts(buf, "</node>\n"); pa_strbuf_puts(buf, "</node>\n");
pa_xfree(oe->introspection); pa_xfree(oe->introspection);
oe->introspection = pa_strbuf_tostring_free(buf); oe->introspection = pa_strbuf_to_string_free(buf);
} }
/* Return value of find_handler() and its subfunctions. */ /* Return value of find_handler() and its subfunctions. */
@ -689,7 +689,7 @@ static pa_hashmap *extract_method_signatures(pa_hashmap *method_handlers) {
pa_strbuf_puts(sig_buf, handler->arguments[i].type); pa_strbuf_puts(sig_buf, handler->arguments[i].type);
} }
pa_hashmap_put(signatures, (char *) handler->method_name, pa_strbuf_tostring_free(sig_buf)); pa_hashmap_put(signatures, (char *) handler->method_name, pa_strbuf_to_string_free(sig_buf));
} }
return signatures; return signatures;

View file

@ -294,7 +294,7 @@ static char *escape_html(const char *t) {
if (p > e) if (p > e)
pa_strbuf_putsn(sb, e, p-e); pa_strbuf_putsn(sb, e, p-e);
return pa_strbuf_tostring_free(sb); return pa_strbuf_to_string_free(sb);
} }
static void http_response( static void http_response(

View file

@ -1149,7 +1149,7 @@ static void setup_remap(const pa_resampler *r, pa_remap_t *m, bool *lfe_remixed)
pa_strbuf_puts(s, "\n"); pa_strbuf_puts(s, "\n");
} }
pa_log_debug("Channel matrix:\n%s", t = pa_strbuf_tostring_free(s)); pa_log_debug("Channel matrix:\n%s", t = pa_strbuf_to_string_free(s));
pa_xfree(t); pa_xfree(t);
/* initialize the remapping function */ /* initialize the remapping function */

View file

@ -69,7 +69,7 @@ void pa_strbuf_free(pa_strbuf *sb) {
/* Make a C string from the string buffer. The caller has to free /* Make a C string from the string buffer. The caller has to free
* string with pa_xfree(). */ * string with pa_xfree(). */
char *pa_strbuf_tostring(pa_strbuf *sb) { char *pa_strbuf_to_string(pa_strbuf *sb) {
char *t, *e; char *t, *e;
struct chunk *c; struct chunk *c;
@ -91,12 +91,12 @@ char *pa_strbuf_tostring(pa_strbuf *sb) {
return t; return t;
} }
/* Combination of pa_strbuf_free() and pa_strbuf_tostring() */ /* Combination of pa_strbuf_free() and pa_strbuf_to_string() */
char *pa_strbuf_tostring_free(pa_strbuf *sb) { char *pa_strbuf_to_string_free(pa_strbuf *sb) {
char *t; char *t;
pa_assert(sb); pa_assert(sb);
t = pa_strbuf_tostring(sb); t = pa_strbuf_to_string(sb);
pa_strbuf_free(sb); pa_strbuf_free(sb);
return t; return t;

View file

@ -27,8 +27,8 @@ typedef struct pa_strbuf pa_strbuf;
pa_strbuf *pa_strbuf_new(void); pa_strbuf *pa_strbuf_new(void);
void pa_strbuf_free(pa_strbuf *sb); void pa_strbuf_free(pa_strbuf *sb);
char *pa_strbuf_tostring(pa_strbuf *sb); char *pa_strbuf_to_string(pa_strbuf *sb);
char *pa_strbuf_tostring_free(pa_strbuf *sb); char *pa_strbuf_to_string_free(pa_strbuf *sb);
size_t pa_strbuf_printf(pa_strbuf *sb, const char *format, ...) PA_GCC_PRINTF_ATTR(2,3); size_t pa_strbuf_printf(pa_strbuf *sb, const char *format, ...) PA_GCC_PRINTF_ATTR(2,3);
void pa_strbuf_puts(pa_strbuf *sb, const char *t); void pa_strbuf_puts(pa_strbuf *sb, const char *t);

View file

@ -50,7 +50,7 @@ pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s) {
return n; return n;
} }
char *pa_strlist_tostring(pa_strlist *l) { char *pa_strlist_to_string(pa_strlist *l) {
int first = 1; int first = 1;
pa_strbuf *b; pa_strbuf *b;
@ -62,7 +62,7 @@ char *pa_strlist_tostring(pa_strlist *l) {
pa_strbuf_puts(b, ITEM_TO_TEXT(l)); pa_strbuf_puts(b, ITEM_TO_TEXT(l));
} }
return pa_strbuf_tostring_free(b); return pa_strbuf_to_string_free(b);
} }
pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s) { pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s) {

View file

@ -29,7 +29,7 @@ pa_strlist* pa_strlist_prepend(pa_strlist *l, const char *s);
pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s); pa_strlist* pa_strlist_remove(pa_strlist *l, const char *s);
/* Make a whitespace separated string of all server strings. Returned memory has to be freed with pa_xfree() */ /* Make a whitespace separated string of all server strings. Returned memory has to be freed with pa_xfree() */
char *pa_strlist_tostring(pa_strlist *l); char *pa_strlist_to_string(pa_strlist *l);
/* Free the entire list */ /* Free the entire list */
void pa_strlist_free(pa_strlist *l); void pa_strlist_free(pa_strlist *l);

View file

@ -70,7 +70,7 @@ static void dump(pa_memblockq *bq, int n) {
buf = pa_strbuf_new(); buf = pa_strbuf_new();
dump_chunk(&out, buf); dump_chunk(&out, buf);
pa_memblock_unref(out.memblock); pa_memblock_unref(out.memblock);
str = pa_strbuf_tostring_free(buf); str = pa_strbuf_to_string_free(buf);
fail_unless(pa_streq(str, fixed[n])); fail_unless(pa_streq(str, fixed[n]));
pa_xfree(str); pa_xfree(str);
fprintf(stderr, "<\n"); fprintf(stderr, "<\n");
@ -87,7 +87,7 @@ static void dump(pa_memblockq *bq, int n) {
pa_memblock_unref(out.memblock); pa_memblock_unref(out.memblock);
pa_memblockq_drop(bq, out.length); pa_memblockq_drop(bq, out.length);
} }
str = pa_strbuf_tostring_free(buf); str = pa_strbuf_to_string_free(buf);
fail_unless(pa_streq(str, manual[n])); fail_unless(pa_streq(str, manual[n]));
pa_xfree(str); pa_xfree(str);
fprintf(stderr, "<\n"); fprintf(stderr, "<\n");

View file

@ -20,7 +20,7 @@ START_TEST (strlist_test) {
l = pa_strlist_prepend(l, "b"); l = pa_strlist_prepend(l, "b");
l = pa_strlist_prepend(l, "a"); l = pa_strlist_prepend(l, "a");
t = pa_strlist_tostring(l); t = pa_strlist_to_string(l);
pa_strlist_free(l); pa_strlist_free(l);
fprintf(stderr, "1: %s\n", t); fprintf(stderr, "1: %s\n", t);
@ -29,7 +29,7 @@ START_TEST (strlist_test) {
l = pa_strlist_parse(t); l = pa_strlist_parse(t);
pa_xfree(t); pa_xfree(t);
t = pa_strlist_tostring(l); t = pa_strlist_to_string(l);
fprintf(stderr, "2: %s\n", t); fprintf(stderr, "2: %s\n", t);
fail_unless(pa_streq(t, "a b c d e")); fail_unless(pa_streq(t, "a b c d e"));
pa_xfree(t); pa_xfree(t);
@ -41,7 +41,7 @@ START_TEST (strlist_test) {
l = pa_strlist_remove(l, "c"); l = pa_strlist_remove(l, "c");
t = pa_strlist_tostring(l); t = pa_strlist_to_string(l);
fprintf(stderr, "4: %s\n", t); fprintf(stderr, "4: %s\n", t);
fail_unless(pa_streq(t, "b d e")); fail_unless(pa_streq(t, "b d e"));
pa_xfree(t); pa_xfree(t);