From 36e709c021bfa459933ca65bf6c22a1ebff4d541 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 30 Mar 2022 09:22:55 +0200 Subject: [PATCH] all: add "NM_UTILS_TO_STRING_BUFFER_SIZE" macro I want to get rid of "_nm_utils_to_string_buffer" (or at least, limit and control its use). Currently it's used all over the place only to get the size of it. Add a define instead. --- src/libnm-glib-aux/nm-shared-utils.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index d0c7434b3c..b9b16950fa 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -1047,7 +1047,9 @@ int _nm_utils_ascii_str_to_bool(const char *str, int default_value); /*****************************************************************************/ -extern _nm_thread_local char _nm_utils_to_string_buffer[2096]; +#define NM_UTILS_TO_STRING_BUFFER_SIZE 2096 + +extern _nm_thread_local char _nm_utils_to_string_buffer[NM_UTILS_TO_STRING_BUFFER_SIZE]; void nm_utils_to_string_buffer_init(char **buf, gsize *len); gboolean nm_utils_to_string_buffer_init_null(gconstpointer obj, char **buf, gsize *len);