From db889c182ee5f54127285bfaab5bc94dafe46bda Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 3 Nov 2018 16:04:19 -0400 Subject: [PATCH] Add operator char * to the naked array types as well --- src/hb-dsalgs.hh | 4 +++- src/hb-open-type.hh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index f2bff063d..fafac1f72 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -553,8 +553,10 @@ struct hb_array_t inline unsigned int get_size (void) const { return len * sizeof (Type); } - template inline operator T * (void) { return arrayZ; } + template inline operator T * (void) { return arrayZ; } template inline operator const T * (void) const { return arrayZ; } + inline operator char * (void) { return (char *) arrayZ; } + inline operator const char * (void) const { return (const char *) arrayZ; } inline Type * operator & (void) { return arrayZ; } inline const Type * operator & (void) const { return arrayZ; } diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 0f6efdc69..e1dc8aab1 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -342,6 +342,8 @@ struct UnsizedArrayOf template inline operator T * (void) { return arrayZ; } template inline operator const T * (void) const { return arrayZ; } + inline operator char * (void) { return (char *) arrayZ; } + inline operator const char * (void) const { return (const char *) arrayZ; } inline unsigned int get_size (unsigned int len) const { return len * Type::static_size; }