@@ -416,7 +416,7 @@ static int bluetooth_getsockname(GIOChannel *io, char **name)
return 0;
}
-static struct obex_transport_driver driver = {
+static const struct obex_transport_driver driver = {
.name = "bluetooth",
.start = bluetooth_start,
.getpeername = bluetooth_getpeername,
@@ -1085,7 +1085,7 @@ ssize_t obex_get_non_header_data(struct obex_session *os,
int obex_getpeername(struct obex_session *os, char **name)
{
- struct obex_transport_driver *transport = os->server->transport;
+ const struct obex_transport_driver *transport = os->server->transport;
if (transport == NULL || transport->getpeername == NULL)
return -ENOTSUP;
@@ -1095,7 +1095,7 @@ int obex_getpeername(struct obex_session *os, char **name)
int obex_getsockname(struct obex_session *os, char **name)
{
- struct obex_transport_driver *transport = os->server->transport;
+ const struct obex_transport_driver *transport = os->server->transport;
if (transport == NULL || transport->getsockname == NULL)
return -ENOTSUP;
@@ -34,12 +34,12 @@
static GSList *servers = NULL;
-static void init_server(uint16_t service, GSList *transports)
+static void init_server(uint16_t service, const GSList *transports)
{
- GSList *l;
+ const GSList *l;
for (l = transports; l; l = l->next) {
- struct obex_transport_driver *transport = l->data;
+ const struct obex_transport_driver *transport = l->data;
struct obex_server *server;
int err;
@@ -66,7 +66,7 @@ static void init_server(uint16_t service, GSList *transports)
int obex_server_init(void)
{
GSList *drivers;
- GSList *transports;
+ const GSList *transports;
GSList *l;
drivers = obex_service_driver_list(0);
@@ -10,7 +10,7 @@
*/
struct obex_server {
- struct obex_transport_driver *transport;
+ const struct obex_transport_driver *transport;
void *transport_data;
GSList *drivers;
};
@@ -27,13 +27,13 @@
static GSList *drivers = NULL;
-static struct obex_transport_driver *obex_transport_driver_find(
+static const struct obex_transport_driver *obex_transport_driver_find(
const char *name)
{
- GSList *l;
+ const GSList *l;
for (l = drivers; l; l = l->next) {
- struct obex_transport_driver *driver = l->data;
+ const struct obex_transport_driver *driver = l->data;
if (g_strcmp0(name, driver->name) == 0)
return driver;
@@ -42,12 +42,12 @@ static struct obex_transport_driver *obex_transport_driver_find(
return NULL;
}
-GSList *obex_transport_driver_list(void)
+const GSList *obex_transport_driver_list(void)
{
return drivers;
}
-int obex_transport_driver_register(struct obex_transport_driver *driver)
+int obex_transport_driver_register(const struct obex_transport_driver *driver)
{
if (!driver) {
error("Invalid driver");
@@ -62,12 +62,12 @@ int obex_transport_driver_register(struct obex_transport_driver *driver)
DBG("driver %p transport %s registered", driver, driver->name);
- drivers = g_slist_prepend(drivers, driver);
+ drivers = g_slist_prepend(drivers, (gpointer)driver);
return 0;
}
-void obex_transport_driver_unregister(struct obex_transport_driver *driver)
+void obex_transport_driver_unregister(const struct obex_transport_driver *driver)
{
if (!g_slist_find(drivers, driver)) {
error("Unable to unregister: No such driver %p", driver);
@@ -17,6 +17,6 @@ struct obex_transport_driver {
void (*stop) (void *data);
};
-int obex_transport_driver_register(struct obex_transport_driver *driver);
-void obex_transport_driver_unregister(struct obex_transport_driver *driver);
-GSList *obex_transport_driver_list(void);
+int obex_transport_driver_register(const struct obex_transport_driver *driver);
+void obex_transport_driver_unregister(const struct obex_transport_driver *driver);
+const GSList *obex_transport_driver_list(void);
From: Emil Velikov <emil.velikov@collabora.com> --- obexd/plugins/bluetooth.c | 2 +- obexd/src/obex.c | 4 ++-- obexd/src/server.c | 8 ++++---- obexd/src/server.h | 2 +- obexd/src/transport.c | 14 +++++++------- obexd/src/transport.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-)