All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 19/20] obexd: const annotate misc immutable data
Date: Tue, 16 Jan 2024 14:00:44 +0000	[thread overview]
Message-ID: <20240116-const-v1-19-17c87978f40b@gmail.com> (raw)
In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

---
 obexd/client/manager.c          | 6 +++---
 obexd/client/map.c              | 4 ++--
 obexd/client/mns.c              | 4 ++--
 obexd/plugins/phonebook-ebook.c | 2 +-
 obexd/src/main.c                | 2 +-
 obexd/src/obex.c                | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/obexd/client/manager.c b/obexd/client/manager.c
index 75f1bfb04..ad1fbb04a 100644
--- a/obexd/client/manager.c
+++ b/obexd/client/manager.c
@@ -241,7 +241,7 @@ static const GDBusMethodTable client_methods[] = {
 
 static DBusConnection *conn = NULL;
 
-static struct obc_module {
+static const struct obc_module {
 	const char *name;
 	int (*init) (void);
 	void (*exit) (void);
@@ -258,7 +258,7 @@ static struct obc_module {
 int client_manager_init(void)
 {
 	DBusError derr;
-	struct obc_module *module;
+	const struct obc_module *module;
 
 	dbus_error_init(&derr);
 
@@ -289,7 +289,7 @@ int client_manager_init(void)
 
 void client_manager_exit(void)
 {
-	struct obc_module *module;
+	const struct obc_module *module;
 
 	if (conn == NULL)
 		return;
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 74828cddb..513dcaf14 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1060,7 +1060,7 @@ static void parse_protected(struct map_msg *msg, const char *value)
 						MAP_MSG_INTERFACE, "Protected");
 }
 
-static struct map_msg_parser {
+static const struct map_msg_parser {
 	const char *name;
 	void (*func) (struct map_msg *msg, const char *value);
 } msg_parsers[] = {
@@ -1120,7 +1120,7 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element,
 								&msg->path);
 
 	for (i = 0, key = names[i]; key; key = names[++i]) {
-		struct map_msg_parser *parser;
+		const struct map_msg_parser *parser;
 
 		for (parser = msg_parsers; parser && parser->name; parser++) {
 			if (strcasecmp(key, parser->name) == 0) {
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 702cf0367..c7f86afdc 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -233,7 +233,7 @@ static void parse_event_report_priority(struct map_event *event,
 	event->priority = g_strdup(value);
 }
 
-static struct map_event_report_parser {
+static const struct map_event_report_parser {
 	const char *name;
 	void (*func) (struct map_event *event, const char *value);
 } event_report_parsers[] = {
@@ -262,7 +262,7 @@ static void event_report_element(GMarkupParseContext *ctxt,
 		return;
 
 	for (i = 0, key = names[i]; key; key = names[++i]) {
-		struct map_event_report_parser *parser;
+		const struct map_event_report_parser *parser;
 
 		for (parser = event_report_parsers; parser && parser->name;
 								parser++) {
diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c
index 29ec9d213..e509dd29a 100644
--- a/obexd/plugins/phonebook-ebook.c
+++ b/obexd/plugins/phonebook-ebook.c
@@ -55,7 +55,7 @@ struct query_context {
 	gboolean canceled;
 };
 
-static char *attribute_mask[] = {
+static const char *attribute_mask[] = {
 /* 0 */		"VERSION",
 		"FN",
 		"N",
diff --git a/obexd/src/main.c b/obexd/src/main.c
index d950883f0..151574afa 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -138,7 +138,7 @@ static gboolean parse_debug(const char *key, const char *value,
 	return TRUE;
 }
 
-static GOptionEntry options[] = {
+static const GOptionEntry options[] = {
 	{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
 				G_OPTION_ARG_CALLBACK, parse_debug,
 				"Enable debug information output", "DEBUG" },
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 526861f40..98d6245a4 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -55,7 +55,7 @@ struct auth_header {
 } __attribute__ ((packed));
 
 /* Possible commands */
-static struct {
+static const struct {
 	int cmd;
 	const char *name;
 } obex_command[] = {

-- 
2.43.0


WARNING: multiple messages have this Message-ID (diff)
From: Emil Velikov via B4 Relay <devnull+emil.l.velikov.gmail.com@kernel.org>
To: linux-bluetooth@vger.kernel.org
Cc: Emil Velikov <emil.velikov@collabora.com>
Subject: [PATCH BlueZ 19/20] obexd: const annotate misc immutable data
Date: Tue, 16 Jan 2024 14:00:44 +0000	[thread overview]
Message-ID: <20240116-const-v1-19-17c87978f40b@gmail.com> (raw)
In-Reply-To: <20240116-const-v1-0-17c87978f40b@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

---
 obexd/client/manager.c          | 6 +++---
 obexd/client/map.c              | 4 ++--
 obexd/client/mns.c              | 4 ++--
 obexd/plugins/phonebook-ebook.c | 2 +-
 obexd/src/main.c                | 2 +-
 obexd/src/obex.c                | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/obexd/client/manager.c b/obexd/client/manager.c
index 75f1bfb04..ad1fbb04a 100644
--- a/obexd/client/manager.c
+++ b/obexd/client/manager.c
@@ -241,7 +241,7 @@ static const GDBusMethodTable client_methods[] = {
 
 static DBusConnection *conn = NULL;
 
-static struct obc_module {
+static const struct obc_module {
 	const char *name;
 	int (*init) (void);
 	void (*exit) (void);
@@ -258,7 +258,7 @@ static struct obc_module {
 int client_manager_init(void)
 {
 	DBusError derr;
-	struct obc_module *module;
+	const struct obc_module *module;
 
 	dbus_error_init(&derr);
 
@@ -289,7 +289,7 @@ int client_manager_init(void)
 
 void client_manager_exit(void)
 {
-	struct obc_module *module;
+	const struct obc_module *module;
 
 	if (conn == NULL)
 		return;
diff --git a/obexd/client/map.c b/obexd/client/map.c
index 74828cddb..513dcaf14 100644
--- a/obexd/client/map.c
+++ b/obexd/client/map.c
@@ -1060,7 +1060,7 @@ static void parse_protected(struct map_msg *msg, const char *value)
 						MAP_MSG_INTERFACE, "Protected");
 }
 
-static struct map_msg_parser {
+static const struct map_msg_parser {
 	const char *name;
 	void (*func) (struct map_msg *msg, const char *value);
 } msg_parsers[] = {
@@ -1120,7 +1120,7 @@ static void msg_element(GMarkupParseContext *ctxt, const char *element,
 								&msg->path);
 
 	for (i = 0, key = names[i]; key; key = names[++i]) {
-		struct map_msg_parser *parser;
+		const struct map_msg_parser *parser;
 
 		for (parser = msg_parsers; parser && parser->name; parser++) {
 			if (strcasecmp(key, parser->name) == 0) {
diff --git a/obexd/client/mns.c b/obexd/client/mns.c
index 702cf0367..c7f86afdc 100644
--- a/obexd/client/mns.c
+++ b/obexd/client/mns.c
@@ -233,7 +233,7 @@ static void parse_event_report_priority(struct map_event *event,
 	event->priority = g_strdup(value);
 }
 
-static struct map_event_report_parser {
+static const struct map_event_report_parser {
 	const char *name;
 	void (*func) (struct map_event *event, const char *value);
 } event_report_parsers[] = {
@@ -262,7 +262,7 @@ static void event_report_element(GMarkupParseContext *ctxt,
 		return;
 
 	for (i = 0, key = names[i]; key; key = names[++i]) {
-		struct map_event_report_parser *parser;
+		const struct map_event_report_parser *parser;
 
 		for (parser = event_report_parsers; parser && parser->name;
 								parser++) {
diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c
index 29ec9d213..e509dd29a 100644
--- a/obexd/plugins/phonebook-ebook.c
+++ b/obexd/plugins/phonebook-ebook.c
@@ -55,7 +55,7 @@ struct query_context {
 	gboolean canceled;
 };
 
-static char *attribute_mask[] = {
+static const char *attribute_mask[] = {
 /* 0 */		"VERSION",
 		"FN",
 		"N",
diff --git a/obexd/src/main.c b/obexd/src/main.c
index d950883f0..151574afa 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -138,7 +138,7 @@ static gboolean parse_debug(const char *key, const char *value,
 	return TRUE;
 }
 
-static GOptionEntry options[] = {
+static const GOptionEntry options[] = {
 	{ "debug", 'd', G_OPTION_FLAG_OPTIONAL_ARG,
 				G_OPTION_ARG_CALLBACK, parse_debug,
 				"Enable debug information output", "DEBUG" },
diff --git a/obexd/src/obex.c b/obexd/src/obex.c
index 526861f40..98d6245a4 100644
--- a/obexd/src/obex.c
+++ b/obexd/src/obex.c
@@ -55,7 +55,7 @@ struct auth_header {
 } __attribute__ ((packed));
 
 /* Possible commands */
-static struct {
+static const struct {
 	int cmd;
 	const char *name;
 } obex_command[] = {

-- 
2.43.0


  parent reply	other threads:[~2024-01-16 14:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 14:00 [PATCH BlueZ 00/20] Constify all the things Emil Velikov
2024-01-16 14:00 ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 01/20] src: const annotate the bluetooth plugin API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 18:37   ` Constify all the things bluez.test.bot
2024-01-16 14:00 ` [PATCH BlueZ 02/20] monitor: const annotate util_ltv_debugger instances and API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 03/20] monitor: const annotate cmd/handler tables Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 04/20] monitor: const annotate misc arrays Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 05/20] monitor: const annotate intel_version_tlv_desc::type_str and API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 06/20] monitor: const annotate type_table and related API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 07/20] profiles: annotate immutable data as const Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 08/20] attrib: " Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 09/20] client: annotate struct option instances " Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 10/20] emulator: const annotate rfcomm_crc_table[] Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 11/20] gobex: const annotate RO arrays, use G_N_ELEMENTS Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 12/20] lib: const annotate hci_map instances and related API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 13/20] lib: const annotate tupla instances and API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 14/20] mesh: const annotate misc data Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 15/20] obexd: remove obex_mime_type_driver::set_io_watch Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 16/20] obexd: const obex_mime_type_driver instances and API Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 17/20] obexd: const obex_service_driver " Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 18/20] obexd: const obex_transport_driver " Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-16 14:00 ` Emil Velikov [this message]
2024-01-16 14:00   ` [PATCH BlueZ 19/20] obexd: const annotate misc immutable data Emil Velikov via B4 Relay
2024-01-16 14:00 ` [PATCH BlueZ 20/20] obexd: const annotate obex_plugin_desc entrypoint Emil Velikov
2024-01-16 14:00   ` Emil Velikov via B4 Relay
2024-01-22 23:53 ` [PATCH BlueZ 00/20] Constify all the things patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116-const-v1-19-17c87978f40b@gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=emil.velikov@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.