strbuf: drop nm_str_buf_append_c[24]() for nm_str_buf_append_c()

This commit is contained in:
Thomas Haller 2021-05-06 13:06:27 +02:00
parent 94ce36f816
commit a6cf94cfc4
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 7 additions and 10 deletions

View file

@ -989,7 +989,7 @@ lease_option_print_label(NMStrBuf *sbuf, size_t n_label, const uint8_t **datap,
break;
case '.':
case '\\':
nm_str_buf_append_c2(sbuf, '\\', c);
nm_str_buf_append_c(sbuf, '\\', c);
break;
default:
nm_str_buf_append_printf(sbuf, "\\%3d", c);

View file

@ -2708,11 +2708,11 @@ nm_g_type_find_implementing_class_for_property(GType gtype, const char *pname)
static void
_str_buf_append_c_escape_octal(NMStrBuf *strbuf, char ch)
{
nm_str_buf_append_c4(strbuf,
'\\',
'0' + ((char) ((((guchar) ch) >> 6) & 07)),
'0' + ((char) ((((guchar) ch) >> 3) & 07)),
'0' + ((char) ((((guchar) ch)) & 07)));
nm_str_buf_append_c(strbuf,
'\\',
'0' + ((char) ((((guchar) ch) >> 6) & 07)),
'0' + ((char) ((((guchar) ch) >> 3) & 07)),
'0' + ((char) ((((guchar) ch)) & 07)));
}
/**
@ -2962,7 +2962,7 @@ nm_utils_buf_utf8safe_escape(gconstpointer buf,
nm_assert(ch);
if (ch == '\\')
nm_str_buf_append_c2(&strbuf, '\\', '\\');
nm_str_buf_append_c(&strbuf, '\\', '\\');
else if ((NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL) && ch < ' ')
|| (NM_FLAGS_HAS(flags, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII)
&& ((guchar) ch) >= 127))

View file

@ -199,9 +199,6 @@ _nm_str_buf_append_c_1(NMStrBuf *strbuf, char ch)
#define nm_str_buf_append_c(strbuf, ...) \
_nm_str_buf_append_c_n1((strbuf), NM_NARG(__VA_ARGS__), __VA_ARGS__)
#define nm_str_buf_append_c2(strbuf, ...) nm_str_buf_append_c(strbuf, __VA_ARGS__)
#define nm_str_buf_append_c4(strbuf, ...) nm_str_buf_append_c(strbuf, __VA_ARGS__)
static inline void
nm_str_buf_append_c_hex(NMStrBuf *strbuf, char ch, gboolean upper_case)
{