Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy _Z_OWNED_FUNCTIONS_PTR_IMPL macro #644

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions include/zenoh-pico/api/olv_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,6 @@
z_internal_##name##_null(&src->_this); \
}

#define _Z_OWNED_FUNCTIONS_PTR_IMPL(type, name, f_copy, f_free) \
_Z_OWNED_FUNCTIONS_IMPL_MOVE_TAKE(name) \
void z_internal_##name##_null(z_owned_##name##_t *obj) { obj->_val = NULL; } \
_Bool z_internal_##name##_check(const z_owned_##name##_t *obj) { return obj->_val != NULL; } \
const z_loaned_##name##_t *z_##name##_loan(const z_owned_##name##_t *obj) { return obj->_val; } \
z_loaned_##name##_t *z_##name##_loan_mut(z_owned_##name##_t *obj) { return obj->_val; } \
int8_t z_##name##_clone(z_owned_##name##_t *obj, const z_loaned_##name##_t *src) { \
int8_t ret = _Z_RES_OK; \
obj->_val = (type *)z_malloc(sizeof(type)); \
if (obj->_val != NULL) { \
f_copy(obj->_val, src); \
} else { \
ret = _Z_ERR_SYSTEM_OUT_OF_MEMORY; \
} \
return ret; \
} \
void z_##name##_drop(z_moved_##name##_t *obj) { \
if ((obj != NULL) && (obj->_this._val != NULL)) { \
f_free(obj->_this._val); \
} \
}

#define _Z_OWNED_FUNCTIONS_VALUE_IMPL(type, name, f_check, f_null, f_copy, f_drop) \
_Z_OWNED_FUNCTIONS_IMPL_MOVE_TAKE(name) \
void z_internal_##name##_null(z_owned_##name##_t *obj) { obj->_val = f_null(); } \
Expand Down
Loading