rz_str_trim_tail: Declare RZ_INOUT on both parameter and return value (#5546)
This commit is contained in:
parent
451eab4e09
commit
4cbba6a263
4 changed files with 5 additions and 5 deletions
|
|
@ -376,7 +376,7 @@ In Rizin code, there are some conventions to help developers use pointers more s
|
|||
```c
|
||||
#define RZ_IN /* do not use, implicit */
|
||||
#define RZ_OUT /* parameter is written, not read */
|
||||
#define RZ_INOUT /* parameter is read and written */
|
||||
#define RZ_INOUT /* parameter is read and written / return value is copy of RZ_INOUT parameter */
|
||||
#define RZ_OWN /* pointer ownership is transferred */
|
||||
#define RZ_BORROW /* pointer ownership is not transferred, it must not be freed by the receiver */
|
||||
#define RZ_NONNULL /* pointer cannot be null */
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
|
||||
#define RZ_IN /* do not use, implicit */
|
||||
#define RZ_OUT /* parameter is written, not read */
|
||||
#define RZ_INOUT /* parameter is read and written */
|
||||
#define RZ_INOUT /* parameter is read and written / return value is copy of RZ_INOUT parameter */
|
||||
|
||||
#ifdef RZ_BINDINGS
|
||||
#define RZ_OWN __attribute__((annotate("RZ_OWN")))
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ RZ_API void rz_str_trim_head(RZ_NONNULL RZ_INOUT char *str);
|
|||
RZ_API void rz_str_trim_head_char(RZ_NONNULL RZ_INOUT char *str, const char c);
|
||||
RZ_API const char *rz_str_trim_head_ro(RZ_NONNULL const char *str);
|
||||
RZ_API const char *rz_str_trim_head_wp(RZ_NONNULL const char *str);
|
||||
RZ_API RZ_BORROW char *rz_str_trim_tail(RZ_NONNULL char *str);
|
||||
RZ_API RZ_INOUT char *rz_str_trim_tail(RZ_NONNULL RZ_INOUT char *str);
|
||||
RZ_API void rz_str_trim_tail_char(RZ_NONNULL RZ_INOUT char *str, const char c);
|
||||
RZ_API ut64 rz_str_djb2_hash(const char *str);
|
||||
RZ_API char *rz_str_trim_nc(char *str);
|
||||
|
|
|
|||
|
|
@ -126,9 +126,9 @@ RZ_API void rz_str_trim_head(RZ_NONNULL RZ_INOUT char *str) {
|
|||
* The string is changed in place.
|
||||
*
|
||||
* \param str The string to trim.
|
||||
* \return The edited string.
|
||||
* \return The `str` pointer.
|
||||
*/
|
||||
RZ_API RZ_BORROW char *rz_str_trim_tail(RZ_NONNULL char *str) {
|
||||
RZ_API RZ_INOUT char *rz_str_trim_tail(RZ_NONNULL RZ_INOUT char *str) {
|
||||
rz_return_val_if_fail(str, NULL);
|
||||
size_t length = strlen(str);
|
||||
while (length-- > 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue