[pulseaudio-commits] src/pulse
Tanu Kaskinen
tanuk at kemper.freedesktop.org
Tue Jun 26 08:35:28 UTC 2018
src/pulse/context.c | 2 +-
src/pulse/internal.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit e7c88ee169e07d23d6a70214dc4ef5e65db46ea3
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Mon Jun 18 11:13:40 2018 +0300
context: constify pa_context_set_error()
This allows constifying public API functions that report their errors
via the context error but don't modify the context in any other way.
Philosophical arguments could be made why this is wrong, but I believe
in practice this is a net positive change.
diff --git a/src/pulse/context.c b/src/pulse/context.c
index dc59ed2d..37f81e9a 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.c
@@ -313,7 +313,7 @@ void pa_context_set_state(pa_context *c, pa_context_state_t st) {
pa_context_unref(c);
}
-int pa_context_set_error(pa_context *c, int error) {
+int pa_context_set_error(const pa_context *c, int error) {
pa_assert(error >= 0);
pa_assert(error < PA_ERR_MAX);
diff --git a/src/pulse/internal.h b/src/pulse/internal.h
index 04f35e9a..ec74f41b 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.h
@@ -274,7 +274,7 @@ void pa_context_simple_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_t
void pa_stream_simple_ack_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata);
void pa_context_fail(pa_context *c, int error);
-int pa_context_set_error(pa_context *c, int error);
+int pa_context_set_error(const pa_context *c, int error);
void pa_context_set_state(pa_context *c, pa_context_state_t st);
int pa_context_handle_error(pa_context *c, uint32_t command, pa_tagstruct *t, bool fail);
pa_operation* pa_context_send_simple_command(pa_context *c, uint32_t command, void (*internal_callback)(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata), void (*cb)(void), void *userdata);
More information about the pulseaudio-commits
mailing list