~donmcc/astr

5a90284f769932b6045ca61f61135beddcfbc5db — Don McCaughey 1 year, 1 month ago ab0cbaa
Remove `const` from `va_list` parameters.

For FreeBSD compatibility, remove the `const` qualifier from various
`va_list` parameters.
4 files changed, 12 insertions(+), 12 deletions(-)

M README.md
M astr.3
M astr.c
M astr.h
M README.md => README.md +3 -3
@@ 44,7 44,7 @@ Allocate an empty string.
    astr_alloc_formatted(char const *format, ...);

    char *
    astr_alloc_formatted_from_va_list(char const *format, va_list const arguments);
    astr_alloc_formatted_from_va_list(char const *format, va_list arguments);

Allocate a formatted string.



@@ 70,7 70,7 @@ Compare the bytes of two strings for equality; `s1` and `s2` may be `NULL`.
    astr_formatted_length(char const *format, ...);

    size_t
    astr_formatted_length_from_va_list(char const *format, va_list const arguments);
    astr_formatted_length_from_va_list(char const *format, va_list arguments);

Calculate the length in bytes needed for the formatted string.



@@ 78,7 78,7 @@ Calculate the length in bytes needed for the formatted string.
    astr_realloc_append_formatted(char **s, char const *format, ...);

    int
    astr_realloc_append_foramtted_from_va_list(char **s, char const *format, va_list const arguments);
    astr_realloc_append_formatted_from_va_list(char **s, char const *format, va_list arguments);

Append formatted characters to the end of the given string, returning 0 on 
success and -1 on error.

M astr.3 => astr.3 +3 -3
@@ 20,7 20,7 @@
.Ft char *
.Fn astr_alloc_formatted "char const *format" "..."
.Ft char *
.Fn astr_alloc_formatted_from_va_list "char const *format" "va_list const arguments"
.Fn astr_alloc_formatted_from_va_list "char const *format" "va_list arguments"
.Ft int
.Fn astr_cmp "char const *s1" "char const *s2"
.Ft bool


@@ 30,11 30,11 @@
.Ft size_t
.Fn astr_formatted_length "char const *format" "..."
.Ft size_t
.Fn astr_formatted_length_from_va_list "char const *format" "va_list const arguments"
.Fn astr_formatted_length_from_va_list "char const *format" "va_list arguments"
.Ft int
.Fn astr_realloc_append_formatted "char **s" "char const *format"
.Ft int
.Fn astr_realloc_append_formatted_from_va_list "char **s" "char const *format" "va_list const arguments"
.Fn astr_realloc_append_formatted_from_va_list "char **s" "char const *format" "va_list arguments"
.Sh DESCRIPTION
The
.Nm astr

M astr.c => astr.c +3 -3
@@ 27,7 27,7 @@ astr_formatted_length(char const *format, ...)


size_t
astr_formatted_length_from_va_list(char const *format, va_list const arguments)
astr_formatted_length_from_va_list(char const *format, va_list arguments)
{
    if (!format) {
        errno = EINVAL;


@@ 56,7 56,7 @@ astr_realloc_append_formatted(char **s, char const *format, ...)
int
astr_realloc_append_formatted_from_va_list(char **s, 
                                           char const *format, 
                                           va_list const arguments)
                                           va_list arguments)
{
    if (!s || !format) {
        errno = EINVAL;


@@ 84,7 84,7 @@ extern char *
astr_alloc_empty(void);

extern char *
astr_alloc_formatted_from_va_list(char const *format, const va_list arguments);
astr_alloc_formatted_from_va_list(char const *format, va_list arguments);

extern int 
astr_cmp(char const *s1, char const *s2);

M astr.h => astr.h +3 -3
@@ 15,7 15,7 @@ size_t
astr_formatted_length(char const *format, ...);

size_t
astr_formatted_length_from_va_list(char const *format, va_list const arguments);
astr_formatted_length_from_va_list(char const *format, va_list arguments);

int
astr_realloc_append_formatted(char **s, char const *format, ...);


@@ 23,7 23,7 @@ astr_realloc_append_formatted(char **s, char const *format, ...);
int
astr_realloc_append_formatted_from_va_list(char **s, 
                                           char const *format, 
                                           va_list const arguments);
                                           va_list arguments);


inline char *


@@ 33,7 33,7 @@ astr_alloc_empty(void)
}

inline char *
astr_alloc_formatted_from_va_list(char const *format, const va_list arguments)
astr_alloc_formatted_from_va_list(char const *format, va_list arguments)
{
    char *s = NULL;
    int result = astr_realloc_append_formatted_from_va_list(&s, format, arguments);