Skip to content

Commit

Permalink
gobex: const annotate RO arrays, use G_N_ELEMENTS
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 4d88fd2 commit 0e5a458
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gobex/gobex.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct setpath_data {
guint8 constants;
} __attribute__ ((packed));

static struct error_code {
static const struct error_code {
guint8 code;
const char *name;
} obex_errors[] = {
Expand Down Expand Up @@ -169,7 +169,7 @@ static struct error_code {

const char *g_obex_strerror(guint8 err_code)
{
struct error_code *error;
const struct error_code *error;

for (error = obex_errors; error->name != NULL; error++) {
if (error->code == err_code)
Expand Down Expand Up @@ -1423,7 +1423,7 @@ static gboolean incoming_data(GIOChannel *io, GIOCondition cond,
return FALSE;
}

static GDebugKey keys[] = {
static const GDebugKey keys[] = {
{ "error", G_OBEX_DEBUG_ERROR },
{ "command", G_OBEX_DEBUG_COMMAND },
{ "transfer", G_OBEX_DEBUG_TRANSFER },
Expand All @@ -1443,7 +1443,8 @@ GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type,
const char *env = g_getenv("GOBEX_DEBUG");

if (env) {
gobex_debug = g_parse_debug_string(env, keys, 7);
gobex_debug = g_parse_debug_string(env, keys,
G_N_ELEMENTS(keys));
g_setenv("G_MESSAGES_DEBUG", "gobex", FALSE);
} else
gobex_debug = G_OBEX_DEBUG_NONE;
Expand Down

0 comments on commit 0e5a458

Please sign in to comment.