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.
This commit is contained in:
Thomas Haller 2020-04-06 13:17:34 +02:00
parent 43ba2cb933
commit 7ff170a28f

View file

@ -13,7 +13,7 @@
typedef struct _NMStrBuf {
char *_str;
union {
const gsize len;
/*const*/ gsize len;
gsize _len;
};
gsize _allocated;