Skip to content

Commit

Permalink
Remove z_null and z_check for system owned types + cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Aug 8, 2024
1 parent 8464484 commit 15d8348
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions include/zenoh-pico/api/olv_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,6 @@
//
// !!! FOR INTERNAL USAGE ONLY !!!

// For pointer types
#define _Z_OWNED_TYPE_PTR(type, name) \
typedef struct { \
type *_val; \
} z_owned_##name##_t;

// For value types
#define _Z_OWNED_TYPE_VALUE(type, name) \
typedef struct { \
type _val; \
} z_owned_##name##_t;

// For value types
#define _Z_OWNED_TYPE_VALUE(type, name) \
typedef struct { \
Expand Down Expand Up @@ -76,11 +64,9 @@
void z_##name##_null(z_owned_##name##_t *obj);

#define _Z_OWNED_FUNCTIONS_SYSTEM_DEF(name) \
_Bool z_##name##_check(const z_owned_##name##_t *obj); \
const z_loaned_##name##_t *z_##name##_loan(const z_owned_##name##_t *obj); \
z_loaned_##name##_t *z_##name##_loan_mut(z_owned_##name##_t *obj); \
z_owned_##name##_t *z_##name##_move(z_owned_##name##_t *obj); \
void z_##name##_null(z_owned_##name##_t *obj);
z_owned_##name##_t *z_##name##_move(z_owned_##name##_t *obj);

#define _Z_VIEW_FUNCTIONS_DEF(name) \
_Bool z_view_##name##_check(const z_view_##name##_t *obj); \
Expand Down Expand Up @@ -161,10 +147,8 @@
}

#define _Z_OWNED_FUNCTIONS_SYSTEM_IMPL(type, name) \
_Bool z_##name##_check(const z_owned_##name##_t *obj) { return obj != 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; } \
void z_##name##_null(z_owned_##name##_t *obj) { (void)obj; } \
z_owned_##name##_t *z_##name##_move(z_owned_##name##_t *obj) { return obj; }

#define _Z_VIEW_FUNCTIONS_IMPL(type, name, f_check) \
Expand Down

0 comments on commit 15d8348

Please sign in to comment.