Skip to content

Commit

Permalink
Corrected a typo in function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim2266 committed Mar 14, 2021
1 parent 9b63d82 commit ddf0582
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion str.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ str str_ref_chars(const char* const s, const size_t n)
return (s && n > 0) ? ((str){ s, _ref_info(n) }) : str_null;
}

str _str_ref_form_ptr(const char* const s)
str _str_ref_from_ptr(const char* const s)
{
return s ? str_ref_chars(s, strlen(s)) : str_null;
}
Expand Down
6 changes: 3 additions & 3 deletions str.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ int _str_join_range_to_stream(FILE* const stream, const str sep, const str* src,
static inline
str _str_ref(const str s) { return (str){ s.ptr, s.info & ~(size_t)1 }; }

str _str_ref_form_ptr(const char* const s);
str _str_ref_from_ptr(const char* const s);

// string reference from anything
#define str_ref(s) \
_Generic((s), \
str: _str_ref, \
char*: _str_ref_form_ptr, \
const char*: _str_ref_form_ptr \
char*: _str_ref_from_ptr, \
const char*: _str_ref_from_ptr \
)(s)

// create a reference to the given range of chars
Expand Down

0 comments on commit ddf0582

Please sign in to comment.