The macro 'va_copy' is C99, use that

This commit is contained in:
João Valverde 2021-12-12 11:34:48 +00:00 committed by Wireshark GitLab Utility
parent 7cffcfa835
commit cace66d45d
4 changed files with 6 additions and 6 deletions

View File

@ -498,7 +498,7 @@ col_do_append_fstr(column_info *cinfo, const int el, const char *separator, cons
if (len < max_len) {
va_list ap2;
G_VA_COPY(ap2, ap);
va_copy(ap2, ap);
vsnprintf(&col_item->col_buf[len], max_len - len, format, ap2);
va_end(ap2);
}

View File

@ -204,7 +204,7 @@ wmem_strbuf_append_vprintf(wmem_strbuf_t *strbuf, const gchar *fmt, va_list ap)
int want_len;
va_list ap2;
G_VA_COPY(ap2, ap);
va_copy(ap2, ap);
/* Try to write buffer, check if output fits. */
want_len = _strbuf_vsnprintf(strbuf, fmt, ap2, TRUE); /* Remove output if truncated. */
va_end(ap2);

View File

@ -88,7 +88,7 @@ wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap)
gchar *dst;
int needed_len;
G_VA_COPY(ap2, ap);
va_copy(ap2, ap);
/* needed_len = g_printf_string_upper_bound(fmt, ap2); */
@ -102,7 +102,7 @@ wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap)
if (needed_len > WMEM_STRDUP_VPRINTF_DEFAULT_BUFFER) {
wmem_free(allocator, dst);
dst = (gchar *)wmem_alloc(allocator, needed_len);
G_VA_COPY(ap2, ap);
va_copy(ap2, ap);
g_vsnprintf(dst, (gulong) needed_len, fmt, ap2);
va_end(ap2);
}
@ -123,7 +123,7 @@ wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap)
gchar *dst;
int needed_len;
G_VA_COPY(ap2, ap);
va_copy(ap2, ap);
needed_len = _vscprintf(fmt, ap2) + 1;

View File

@ -965,7 +965,7 @@ static void log_write_dispatch(const char *domain, enum ws_log_level level,
if (custom_log) {
va_list user_ap_copy;
G_VA_COPY(user_ap_copy, user_ap);
va_copy(user_ap_copy, user_ap);
log_write_do_work(custom_log, FALSE,
get_localtime(tstamp.tv_sec, &cookie),
tstamp.tv_nsec,