Skip to content

Commit

Permalink
obexd: const annotate misc immutable data
Browse files Browse the repository at this point in the history
  • Loading branch information
evelikov-work authored and Vudentz committed Jan 19, 2024
1 parent c968fe6 commit ac1d236
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions obexd/client/manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions obexd/client/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions obexd/client/mns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion obexd/plugins/phonebook-ebook.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct query_context {
gboolean canceled;
};

static char *attribute_mask[] = {
static const char *attribute_mask[] = {
/* 0 */ "VERSION",
"FN",
"N",
Expand Down
2 changes: 1 addition & 1 deletion obexd/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion obexd/src/obex.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct auth_header {
} __attribute__ ((packed));

/* Possible commands */
static struct {
static const struct {
int cmd;
const char *name;
} obex_command[] = {
Expand Down

0 comments on commit ac1d236

Please sign in to comment.