From 6a575b5e80ea78e300112949b58ab7315f7c40b4 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 18 Nov 2010 23:00:49 -0800 Subject: [PATCH] Break CYColor::Create_ from CYColor::{CYColor,Set}. --- MobileCydia.mm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 7197a31b..950012cf 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -951,6 +951,11 @@ class CYColor { private: CGColorRef color_; + static CGColorRef Create_(CGColorSpaceRef space, float red, float green, float blue, float alpha) { + CGFloat color[] = {red, green, blue, alpha}; + return CGColorCreate(space, color); + } + public: CYColor() : color_(NULL) @@ -958,7 +963,7 @@ class CYColor { } CYColor(CGColorSpaceRef space, float red, float green, float blue, float alpha) : - color_(NULL) + color_(Create_(space, red, green, blue, alpha)) { Set(space, red, green, blue, alpha); } @@ -974,8 +979,7 @@ class CYColor { void Set(CGColorSpaceRef space, float red, float green, float blue, float alpha) { Clear(); - float color[] = {red, green, blue, alpha}; - color_ = CGColorCreate(space, (CGFloat *) color); + color_ = Create_(space, red, green, blue, alpha); } operator CGColorRef() { -- 2.50.0