diff options
| author | Tyge Lovset <[email protected]> | 2022-08-12 11:38:10 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2022-08-12 11:38:10 +0200 |
| commit | a417e5affc99233abb6dbb685154bfdea1b726e3 (patch) | |
| tree | 211f1e1c000d57ea7e5ca318c625996ce094dc76 /include/stc/cbox.h | |
| parent | f534db7ac4a993a05074868b8840a3a674ac76b4 (diff) | |
| download | STC-modified-a417e5affc99233abb6dbb685154bfdea1b726e3.tar.gz STC-modified-a417e5affc99233abb6dbb685154bfdea1b726e3.zip | |
More misc changes carc/cbox, cdeq/cvec.
Diffstat (limited to 'include/stc/cbox.h')
| -rw-r--r-- | include/stc/cbox.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/include/stc/cbox.h b/include/stc/cbox.h index d26a63c8..02a73fdc 100644 --- a/include/stc/cbox.h +++ b/include/stc/cbox.h @@ -82,8 +82,8 @@ _cx_deftypes(_c_cbox_types, _cx_self, i_key); STC_INLINE _cx_self _cx_memb(_init)(void) { return c_make(_cx_self){NULL}; } -STC_INLINE long _cx_memb(_use_count)(_cx_self box) - { return (long)(box.get != NULL); } +STC_INLINE long _cx_memb(_use_count)(const _cx_self* self) + { return (long)(self->get != NULL); } STC_INLINE _cx_self _cx_memb(_from_ptr)(_cx_value* p) { return c_make(_cx_self){p}; } @@ -100,9 +100,6 @@ STC_INLINE _cx_self _cx_memb(_make)(_cx_value val) STC_INLINE _cx_raw _cx_memb(_toraw)(const _cx_self* self) { return i_keyto(self->get); } -STC_INLINE _cx_value _cx_memb(_toval)(const _cx_self* self) - { return *self->get; } - // destructor STC_INLINE void _cx_memb(_drop)(_cx_self* self) { if (self->get) { @@ -129,11 +126,11 @@ STC_INLINE void _cx_memb(_reset_to)(_cx_self* self, _cx_value* p) { self->get = p; } -#if !defined _i_no_clone #if !defined _i_no_emplace STC_INLINE _cx_self _cx_memb(_new)(_cx_raw raw) { return _cx_memb(_from)(i_keyfrom(raw)); } #endif +#if !defined _i_no_clone STC_INLINE _cx_self _cx_memb(_clone)(_cx_self other) { if (!other.get) return other; @@ -141,13 +138,6 @@ STC_INLINE void _cx_memb(_reset_to)(_cx_self* self, _cx_value* p) { *out.get = i_keyclone(*other.get); return out; } - - STC_INLINE void _cx_memb(_assign)(_cx_self* self, const _cx_self ptr) { - if (self->get == ptr.get) - return; - _cx_memb(_drop)(self); - *self = _cx_memb(_clone)(ptr); - } #endif // !_i_no_clone STC_INLINE void _cx_memb(_take)(_cx_self* self, _cx_self other) { |
