From 23ef8619d029b9edbe0f19212a6b3954b9f79874 Mon Sep 17 00:00:00 2001 From: Neil Hodgson Date: Sun, 22 Apr 2018 08:22:53 +1000 Subject: Reduce casts by moving casting from char* to UInt8* into QuartzTextLayout::SetText and adding helper TextStyleFromFont to cast from Font to QuartzTextStyle. --- cocoa/QuartzTextLayout.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cocoa/QuartzTextLayout.h') diff --git a/cocoa/QuartzTextLayout.h b/cocoa/QuartzTextLayout.h index 033859529..2f4de363b 100644 --- a/cocoa/QuartzTextLayout.h +++ b/cocoa/QuartzTextLayout.h @@ -37,8 +37,9 @@ public: } } - inline void setText(const UInt8 *buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle &r) { - CFStringRef str = CFStringCreateWithBytes(NULL, buffer, byteLength, encoding, false); + void setText(const char *buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle &r) { + const UInt8 *puiBuffer = reinterpret_cast(buffer); + CFStringRef str = CFStringCreateWithBytes(NULL, puiBuffer, byteLength, encoding, false); if (!str) return; -- cgit v1.2.3