Project

General

Profile

Feature #589 ยป 0077-astring.h-Replace-NULLs-with-nullptrs.patch

Marko Lindqvist, 05/11/2024 11:30 PM

View differences:

utility/astring.h
/* Can assign this in variable declaration to initialize:
* Notice a static astring var is exactly this already. */
#define ASTRING_INIT { NULL, 0, 0 }
#define ASTRING_INIT { nullptr, 0, 0 }
void astr_init(struct astring *astr) fc__attribute((nonnull (1)));
void astr_free(struct astring *astr) fc__attribute((nonnull (1)));
......
****************************************************************************/
static inline size_t astr_len(const struct astring *astr)
{
return (NULL != astr->str ? strlen(astr->str) : 0);
return (astr->str != nullptr ? strlen(astr->str) : 0);
}
/************************************************************************//**
    (1-1/1)