diff --git a/darwin/opentype.m b/darwin/opentype.m index 25939299..52db9560 100644 --- a/darwin/opentype.m +++ b/darwin/opentype.m @@ -20,7 +20,7 @@ void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf) uiFree(otf); } -uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf) +uiOpenTypeFeatures *uiOpenTypeFeaturesClone(const uiOpenTypeFeatures *otf) { uiOpenTypeFeatures *out; @@ -82,7 +82,7 @@ void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEac }]; } -int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b) +int uiOpenTypeFeaturesEqual(const uiOpenTypeFeatures *a, const uiOpenTypeFeatures *b) { return [a->tags isEqualToDictionary:b->tags]; } diff --git a/unix/opentype.c b/unix/opentype.c index 6ea317c5..6700b83e 100644 --- a/unix/opentype.c +++ b/unix/opentype.c @@ -28,7 +28,7 @@ static void cloneTags(gpointer key, gpointer value, gpointer data) g_hash_table_replace((GHashTable *) data, key, value); } -uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf) +uiOpenTypeFeatures *uiOpenTypeFeaturesClone(const uiOpenTypeFeatures *otf) { uiOpenTypeFeatures *out; @@ -119,10 +119,11 @@ static GList *copySortedKeys(GHashTable *tags) copy = g_list_copy(k); copy = g_list_sort(copy, tagcmp); // TODO do we free k? the docs contradict themselves + // TODO I already forgot, does g_list_sort() copy, or just change the head? return copy; } -int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b) +int uiOpenTypeFeaturesEqual(const uiOpenTypeFeatures *a, const uiOpenTypeFeatures *b) { GList *ak, *bk; GList *ai, *bi; diff --git a/windows/opentype.cpp b/windows/opentype.cpp index f3ca36c3..141f8a5f 100644 --- a/windows/opentype.cpp +++ b/windows/opentype.cpp @@ -22,7 +22,7 @@ void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf) uiFree(otf); } -uiOpenTypeFeatures *uiOpenTypeFeaturesClone(uiOpenTypeFeatures *otf) +uiOpenTypeFeatures *uiOpenTypeFeaturesClone(const uiOpenTypeFeatures *otf) { uiOpenTypeFeatures *out; @@ -75,7 +75,7 @@ void uiOpenTypeFeaturesForEach(uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEac } } -int uiOpenTypeFeaturesEqual(uiOpenTypeFeatures *a, uiOpenTypeFeatures *b) +int uiOpenTypeFeaturesEqual(const uiOpenTypeFeatures *a, const uiOpenTypeFeatures *b) { // TODO make sure this is correct return *(a->tags) == *(b->tags);