From 7ff170a28f174cbd29b9ce545dbf7b09c561a009 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 6 Apr 2020 13:17:34 +0200 Subject: [PATCH] shared/strbuf: don't have const values in NMStrBuf Before, if a struct had a field of type NMStrBuf (which is sensible to do), then you could not longer initialize the entire struct with *ptr = (Type) { }; because NMStrBuf contained const fields. The user should never set these fields directly and use nm_str_buf_*() to modify them them. But no longer mark them as const, because that breaks valid use cases. --- shared/nm-glib-aux/nm-str-buf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/nm-glib-aux/nm-str-buf.h b/shared/nm-glib-aux/nm-str-buf.h index afbb001ca1..4c015aa43c 100644 --- a/shared/nm-glib-aux/nm-str-buf.h +++ b/shared/nm-glib-aux/nm-str-buf.h @@ -13,7 +13,7 @@ typedef struct _NMStrBuf { char *_str; union { - const gsize len; + /*const*/ gsize len; gsize _len; }; gsize _allocated;