diff options
author | João Valverde <j@v6e.pt> | 2021-07-10 16:12:03 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-07-26 14:56:11 +0000 |
commit | 925e01b23fd5aad2fa929fafd894128a88832e74 (patch) | |
tree | 031d2d068cc9af9a39d248b4a2e65d1968689596 /wsutil/str_util.h | |
parent | 133b0c583f0d365175284a94c9b5411d62e3e5b9 (diff) |
Remove duplicate format_size() function
We have two format_size()s, with and without wmem scoped memory.
Move the wmem version to wsutil and add a convenience macro to
use g_malloc()ed memory.
Diffstat (limited to 'wsutil/str_util.h')
-rw-r--r-- | wsutil/str_util.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wsutil/str_util.h b/wsutil/str_util.h index 9bdc82bdcd..46e75f6d74 100644 --- a/wsutil/str_util.h +++ b/wsutil/str_util.h @@ -14,6 +14,8 @@ #include <glib.h> #include "ws_symbol_export.h" +#include <wsutil/wmem/wmem.h> + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ @@ -105,7 +107,9 @@ typedef enum { * @return A newly-allocated string representing the value. */ WS_DLL_PUBLIC -gchar *format_size(gint64 size, format_size_flags_e flags); +gchar *format_size_wmem(wmem_allocator_t *allocator, gint64 size, format_size_flags_e flags); + +#define format_size(size, flags) format_size_wmem(NULL, size, flags) WS_DLL_PUBLIC gchar printable_char_or_period(gchar c); |