[pulseaudio-discuss] [PATCH v2 4/9] bluetooth: Remove const qualifier for transports

Mikel Astiz mikel.astiz.oss at gmail.com
Fri Oct 19 01:11:24 PDT 2012


From: Mikel Astiz <mikel.astiz at bmw-carit.de>

The internal API in bluetooth-util should not use the const qualifier
for operations modifying the transport object. This is specially useful
in order to use the available hooks.
---
 src/modules/bluetooth/bluetooth-util.c          | 6 +++---
 src/modules/bluetooth/bluetooth-util.h          | 6 +++---
 src/modules/bluetooth/module-bluetooth-device.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index e14c8c8..0482c16 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -968,7 +968,7 @@ pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discov
     return NULL;
 }
 
-const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile) {
+pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile) {
     pa_bluetooth_transport *t;
     void *state = NULL;
 
@@ -981,7 +981,7 @@ const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetoo
     return NULL;
 }
 
-int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu) {
+int pa_bluetooth_transport_acquire(pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu) {
     DBusMessage *m, *r;
     DBusError err;
     int ret;
@@ -1019,7 +1019,7 @@ fail:
     return ret;
 }
 
-void pa_bluetooth_transport_release(const pa_bluetooth_transport *t, const char *accesstype) {
+void pa_bluetooth_transport_release(pa_bluetooth_transport *t, const char *accesstype) {
     DBusMessage *m;
     DBusError err;
 
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index a2ad9aa..879b3a3 100644
--- a/src/modules/bluetooth/bluetooth-util.h
+++ b/src/modules/bluetooth/bluetooth-util.h
@@ -133,10 +133,10 @@ const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_disco
 const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
 
 pa_bluetooth_transport* pa_bluetooth_discovery_get_transport(pa_bluetooth_discovery *y, const char *path);
-const pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile);
+pa_bluetooth_transport* pa_bluetooth_device_get_transport(const pa_bluetooth_device *d, enum profile profile);
 
-int pa_bluetooth_transport_acquire(const pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu);
-void pa_bluetooth_transport_release(const pa_bluetooth_transport *t, const char *accesstype);
+int pa_bluetooth_transport_acquire(pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu);
+void pa_bluetooth_transport_release(pa_bluetooth_transport *t, const char *accesstype);
 int pa_bluetooth_transport_parse_property(pa_bluetooth_transport *t, DBusMessageIter *i);
 
 pa_hook* pa_bluetooth_discovery_hook(pa_bluetooth_discovery *d);
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 4b98108..b56cb77 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -344,7 +344,7 @@ static void teardown_stream(struct userdata *u) {
 
 static void bt_transport_release(struct userdata *u) {
     const char *accesstype = "rw";
-    const pa_bluetooth_transport *t;
+    pa_bluetooth_transport *t;
 
     /* Ignore if already released */
     if (!bt_transport_is_acquired(u))
@@ -382,7 +382,7 @@ static pa_bt_audio_state_t get_profile_audio_state(const struct userdata *u, con
 static int bt_transport_acquire(struct userdata *u, pa_bool_t start) {
     const char *accesstype = "rw";
     const pa_bluetooth_device *d;
-    const pa_bluetooth_transport *t;
+    pa_bluetooth_transport *t;
 
     if (u->transport == NULL) {
         pa_log("Transport no longer available.");
@@ -1977,7 +1977,7 @@ static void bt_transport_config(struct userdata *u) {
 /* Run from main thread */
 static int setup_transport(struct userdata *u) {
     const pa_bluetooth_device *d;
-    const pa_bluetooth_transport *t;
+    pa_bluetooth_transport *t;
 
     pa_assert(u);
 
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list