diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 49c2809e2..3ccaf554b 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -267,14 +267,14 @@ inline void *hb_atomic_ptr_impl_get (void **P) { void *v = *P; _hb_memory_r_barr #define HB_ATOMIC_INT_INIT(V) {V} struct hb_atomic_int_t { - inline void set_relaxed (int v_) const { hb_atomic_int_impl_set_relaxed (&v, v_); } - inline void set (int v_) const { hb_atomic_int_impl_set (&v, v_); } + inline void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } + inline void set (int v_) { hb_atomic_int_impl_set (&v, v_); } inline int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } inline int get (void) const { return hb_atomic_int_impl_get (&v); } inline int inc (void) { return hb_atomic_int_impl_add (&v, 1); } inline int dec (void) { return hb_atomic_int_impl_add (&v, -1); } - mutable int v; + int v; }; @@ -285,7 +285,7 @@ struct hb_atomic_ptr_t typedef typename hb_remove_pointer

::value T; inline void init (T* v_ = nullptr) { set_relaxed (v_); } - inline void set_relaxed (T* v_) const { hb_atomic_ptr_impl_set_relaxed (&v, v_); } + inline void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } inline T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } inline bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } @@ -293,7 +293,7 @@ struct hb_atomic_ptr_t inline T * operator -> (void) const { return get (); } template inline operator C * (void) const { return get (); } - mutable T *v; + T *v; }; diff --git a/src/hb-object.hh b/src/hb-object.hh index 74340c555..cdacf49f4 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -194,7 +194,7 @@ struct hb_user_data_array_t struct hb_object_header_t { hb_reference_count_t ref_count; - hb_atomic_int_t writable; + mutable hb_atomic_int_t writable; hb_atomic_ptr_t user_data; }; #define HB_OBJECT_HEADER_STATIC \