@@ -356,7 +356,7 @@ static struct obex_service_driver mns = {
.disconnect = mns_disconnect,
};
-static struct obex_mime_type_driver mime_event_report = {
+static const struct obex_mime_type_driver mime_event_report = {
.target = MNS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/MAP-event-report",
@@ -642,7 +642,7 @@ done:
return err;
}
-static struct obex_mime_type_driver file = {
+static const struct obex_mime_type_driver file = {
.open = filesystem_open,
.close = filesystem_close,
.read = filesystem_read,
@@ -652,7 +652,7 @@ static struct obex_mime_type_driver file = {
.copy = filesystem_copy,
};
-static struct obex_mime_type_driver capability = {
+static const struct obex_mime_type_driver capability = {
.target = FTP_TARGET,
.target_size = FTP_TARGET_SIZE,
.mimetype = "x-obex/capability",
@@ -661,7 +661,7 @@ static struct obex_mime_type_driver capability = {
.read = capability_read,
};
-static struct obex_mime_type_driver folder = {
+static const struct obex_mime_type_driver folder = {
.target = FTP_TARGET,
.target_size = FTP_TARGET_SIZE,
.mimetype = "x-obex/folder-listing",
@@ -670,7 +670,7 @@ static struct obex_mime_type_driver folder = {
.read = folder_read,
};
-static struct obex_mime_type_driver pcsuite = {
+static const struct obex_mime_type_driver pcsuite = {
.target = FTP_TARGET,
.target_size = FTP_TARGET_SIZE,
.who = PCSUITE_WHO,
@@ -419,7 +419,7 @@ static ssize_t irmc_read(void *object, void *buf, size_t count)
return len;
}
-static struct obex_mime_type_driver irmc_driver = {
+static const struct obex_mime_type_driver irmc_driver = {
.target = IRMC_TARGET,
.target_size = IRMC_TARGET_SIZE,
.open = irmc_open,
@@ -793,7 +793,7 @@ static struct obex_service_driver mas = {
.disconnect = mas_disconnect,
};
-static struct obex_mime_type_driver mime_map = {
+static const struct obex_mime_type_driver mime_map = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = NULL,
@@ -803,7 +803,7 @@ static struct obex_mime_type_driver mime_map = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_message = {
+static const struct obex_mime_type_driver mime_message = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/message",
@@ -813,7 +813,7 @@ static struct obex_mime_type_driver mime_message = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_folder_listing = {
+static const struct obex_mime_type_driver mime_folder_listing = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-obex/folder-listing",
@@ -824,7 +824,7 @@ static struct obex_mime_type_driver mime_folder_listing = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_msg_listing = {
+static const struct obex_mime_type_driver mime_msg_listing = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/MAP-msg-listing",
@@ -835,7 +835,7 @@ static struct obex_mime_type_driver mime_msg_listing = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_notification_registration = {
+static const struct obex_mime_type_driver mime_notification_registration = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/MAP-NotificationRegistration",
@@ -845,7 +845,7 @@ static struct obex_mime_type_driver mime_notification_registration = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_message_status = {
+static const struct obex_mime_type_driver mime_message_status = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/messageStatus",
@@ -855,7 +855,7 @@ static struct obex_mime_type_driver mime_message_status = {
.write = any_write,
};
-static struct obex_mime_type_driver mime_message_update = {
+static const struct obex_mime_type_driver mime_message_update = {
.target = MAS_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/MAP-messageUpdate",
@@ -865,7 +865,7 @@ static struct obex_mime_type_driver mime_message_update = {
.write = any_write,
};
-static struct obex_mime_type_driver *map_drivers[] = {
+static const struct obex_mime_type_driver *map_drivers[] = {
&mime_map,
&mime_message,
&mime_folder_listing,
@@ -929,7 +929,7 @@ static ssize_t vobject_vcard_read(void *object, void *buf, size_t count)
return string_read(obj->buffer, buf, count);
}
-static struct obex_mime_type_driver mime_pull = {
+static const struct obex_mime_type_driver mime_pull = {
.target = PBAP_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/phonebook",
@@ -939,7 +939,7 @@ static struct obex_mime_type_driver mime_pull = {
.get_next_header = vobject_pull_get_next_header,
};
-static struct obex_mime_type_driver mime_list = {
+static const struct obex_mime_type_driver mime_list = {
.target = PBAP_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/vcard-listing",
@@ -949,7 +949,7 @@ static struct obex_mime_type_driver mime_list = {
.get_next_header = vobject_list_get_next_header,
};
-static struct obex_mime_type_driver mime_vcard = {
+static const struct obex_mime_type_driver mime_vcard = {
.target = PBAP_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "x-bt/vcard",
@@ -467,7 +467,7 @@ static int backup_flush(void *object)
return 0;
}
-static struct obex_mime_type_driver backup = {
+static const struct obex_mime_type_driver backup = {
.target = FTP_TARGET,
.target_size = TARGET_SIZE,
.mimetype = "application/vnd.nokia-backup",
@@ -427,7 +427,7 @@ static ssize_t synce_write(void *object, const void *buf, size_t count)
return -EAGAIN;
}
-static struct obex_mime_type_driver synce_driver = {
+static const struct obex_mime_type_driver synce_driver = {
.target = SYNCML_TARGET,
.target_size = SYNCML_TARGET_SIZE,
.open = synce_open,
@@ -104,7 +104,7 @@ int obex_object_set_io_watch(void *object, obex_object_io_func func,
return 0;
}
-static struct obex_mime_type_driver *find_driver(const uint8_t *target,
+static const struct obex_mime_type_driver *find_driver(const uint8_t *target,
unsigned int target_size,
const char *mimetype, const uint8_t *who,
unsigned int who_size)
@@ -112,7 +112,7 @@ static struct obex_mime_type_driver *find_driver(const uint8_t *target,
GSList *l;
for (l = drivers; l; l = l->next) {
- struct obex_mime_type_driver *driver = l->data;
+ const struct obex_mime_type_driver *driver = l->data;
if (memncmp0(target, target_size, driver->target, driver->target_size))
continue;
@@ -134,12 +134,12 @@ static struct obex_mime_type_driver *find_driver(const uint8_t *target,
return NULL;
}
-struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
+const struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
unsigned int target_size,
const char *mimetype, const uint8_t *who,
unsigned int who_size)
{
- struct obex_mime_type_driver *driver;
+ const struct obex_mime_type_driver *driver;
driver = find_driver(target, target_size, mimetype, who, who_size);
if (driver == NULL) {
@@ -162,7 +162,7 @@ struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
return driver;
}
-int obex_mime_type_driver_register(struct obex_mime_type_driver *driver)
+int obex_mime_type_driver_register(const struct obex_mime_type_driver *driver)
{
if (!driver) {
error("Invalid driver");
@@ -178,12 +178,12 @@ int obex_mime_type_driver_register(struct obex_mime_type_driver *driver)
DBG("driver %p mimetype %s registered", driver, driver->mimetype);
- drivers = g_slist_append(drivers, driver);
+ drivers = g_slist_append(drivers, (gpointer)driver);
return 0;
}
-void obex_mime_type_driver_unregister(struct obex_mime_type_driver *driver)
+void obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver)
{
if (!g_slist_find(drivers, driver)) {
error("Unable to unregister: No such driver %p", driver);
@@ -30,9 +30,9 @@ struct obex_mime_type_driver {
int (*remove) (const char *name);
};
-int obex_mime_type_driver_register(struct obex_mime_type_driver *driver);
-void obex_mime_type_driver_unregister(struct obex_mime_type_driver *driver);
-struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
+int obex_mime_type_driver_register(const struct obex_mime_type_driver *driver);
+void obex_mime_type_driver_unregister(const struct obex_mime_type_driver *driver);
+const struct obex_mime_type_driver *obex_mime_type_driver_find(const uint8_t *target,
unsigned int target_size,
const char *mimetype, const uint8_t *who,
unsigned int who_size);
@@ -38,7 +38,7 @@ struct obex_session {
struct obex_server *server;
gboolean checked;
GObex *obex;
- struct obex_mime_type_driver *driver;
+ const struct obex_mime_type_driver *driver;
gboolean headers_sent;
};
From: Emil Velikov <emil.velikov@collabora.com> --- obexd/client/mns.c | 2 +- obexd/plugins/filesystem.c | 8 ++++---- obexd/plugins/irmc.c | 2 +- obexd/plugins/mas.c | 16 ++++++++-------- obexd/plugins/pbap.c | 6 +++--- obexd/plugins/pcsuite.c | 2 +- obexd/plugins/syncevolution.c | 2 +- obexd/src/mimetype.c | 14 +++++++------- obexd/src/mimetype.h | 6 +++--- obexd/src/obex-priv.h | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-)