From 96ae9309e7204757987263a5ba49e5a7a1b7c031 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 12 Dec 2017 15:49:39 +0100 Subject: [PATCH] core: don't use const integers where const expression is needed --- src/main.c | 6 ++++-- src/nm-core-utils.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index d59da0522a..6984d52dda 100644 --- a/src/main.c +++ b/src/main.c @@ -93,8 +93,10 @@ static void _init_nm_debug (NMConfig *config) { gs_free char *debug = NULL; - const guint D_RLIMIT_CORE = 1; - const guint D_FATAL_WARNINGS = 2; + enum { + D_RLIMIT_CORE = (1 << 0), + D_FATAL_WARNINGS = (1 << 1), + }; GDebugKey keys[] = { { "RLIMIT_CORE", D_RLIMIT_CORE }, { "fatal-warnings", D_FATAL_WARNINGS }, diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index f6b33a1490..197fa49ba9 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -1246,8 +1246,8 @@ typedef struct { static gboolean match_device_s390_subchannels_parse (const char *s390_subchannels, guint32 *out_a, guint32 *out_b, guint32 *out_c) { - const int BUFSIZE = 30; - char buf[BUFSIZE + 1]; + char buf[30 + 1]; + const int BUFSIZE = G_N_ELEMENTS (buf) - 1; guint i = 0; char *pa = NULL, *pb = NULL, *pc = NULL; gint64 a, b, c;