From 6a45df0a543a74d6d19e249f043c9b223aae1935 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 8 Jul 2020 18:17:40 -0500 Subject: [PATCH] Fix -Wambiguous-reversed-operator warning Fixes https://github.com/harfbuzz/harfbuzz/issues/2554 --- src/hb-map.hh | 2 +- src/hb-object.hh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index 1635b4a62..92c1bd67e 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -54,7 +54,7 @@ struct hb_hashmap_t void clear () { key = kINVALID; value = vINVALID; hash = 0; } - bool operator == (K o) { return hb_deref (key) == hb_deref (o); } + bool operator == (const K &o) { return hb_deref (key) == hb_deref (o); } bool operator == (const item_t &o) { return *this == o.key; } bool is_unused () const { return key == kINVALID; } bool is_tombstone () const { return key != kINVALID && value == vINVALID; } diff --git a/src/hb-object.hh b/src/hb-object.hh index c470532aa..39845a70e 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -168,8 +168,8 @@ struct hb_user_data_array_t void *data; hb_destroy_func_t destroy; - bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } - bool operator == (hb_user_data_item_t &other) const { return key == other.key; } + bool operator == (const hb_user_data_key_t *other_key) const { return key == other_key; } + bool operator == (const hb_user_data_item_t &other) const { return key == other.key; } void fini () { if (destroy) destroy (data); } };