mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
refactor: avoid tr_new(), tr_free() in tr_variant (#3663)
* refactor: remove unused tr_renew() * refactor: remove unused tr_realloc() * refactor: avoid tr_strvDup() in tr-quark
This commit is contained in:
@@ -128,9 +128,6 @@ void* tr_malloc(size_t size);
|
||||
/** @brief Portability wrapper around calloc() in which `0' is a safe argument */
|
||||
void* tr_malloc0(size_t size);
|
||||
|
||||
/** @brief Portability wrapper around reallocf() in which `0' is a safe argument */
|
||||
void* tr_realloc(void* p, size_t size);
|
||||
|
||||
/** @brief Portability wrapper around free() in which `nullptr' is a safe argument */
|
||||
void tr_free(void* p);
|
||||
|
||||
@@ -138,9 +135,6 @@ void tr_free(void* p);
|
||||
|
||||
#define tr_new0(struct_type, n_structs) (static_cast<struct_type*>(tr_malloc0(sizeof(struct_type) * (size_t)(n_structs))))
|
||||
|
||||
#define tr_renew(struct_type, mem, n_structs) \
|
||||
(static_cast<struct_type*>(tr_realloc((mem), sizeof(struct_type) * (size_t)(n_structs))))
|
||||
|
||||
constexpr bool tr_str_is_empty(char const* value)
|
||||
{
|
||||
return value == nullptr || *value == '\0';
|
||||
|
||||
Reference in New Issue
Block a user