Browse files

Merge pull request #10 from larcus94/master

Fix a Xcode warning
  • Loading branch information...
2 parents cf6ceff + 6ac4428 commit f01a750a17276e74e6862e4338b0efb282db1344 @kgn committed Feb 1, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 KGNoise.m
View
12 KGNoise.m
@@ -8,12 +8,12 @@
#import "KGNoise.h"
-static NSUInteger const kImageSize = 128;
+static NSUInteger const kKGNoiseImageSize = 128;
#if TARGET_OS_IPHONE
-static CGFloat *gradientComponentsForColors(UIColor *color1, UIColor *color2){
+static inline CGFloat *gradientComponentsForColors(UIColor *color1, UIColor *color2){
#else
-static CGFloat *gradientComponentsForColors(NSColor *color1, NSColor *color2){
+static inline CGFloat *gradientComponentsForColors(NSColor *color1, NSColor *color2){
#endif
CGFloat *components = malloc(8*sizeof(CGFloat));
const CGFloat *alternateBackgroundComponents = CGColorGetComponents([color1 CGColor]);
@@ -56,7 +56,7 @@ + (void)drawNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMod
static CGImageRef noiseImageRef = nil;
static dispatch_once_t oncePredicate;
dispatch_once(&oncePredicate, ^{
- NSUInteger width = kImageSize, height = width;
+ NSUInteger width = kKGNoiseImageSize, height = width;
NSUInteger size = width*height;
char *rgba = (char *)malloc(size); srand(115);
for(NSUInteger i=0; i < size; ++i){rgba[i] = rand()%256;}
@@ -106,7 +106,7 @@ - (UIColor *)colorWithNoiseWithOpacity:(CGFloat)opacity{
return [self colorWithNoiseWithOpacity:opacity andBlendMode:kCGBlendModeScreen];
}
- (UIColor *)colorWithNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMode{
- CGRect rect = {CGPointZero, kImageSize, kImageSize};
+ CGRect rect = {CGPointZero, kKGNoiseImageSize, kKGNoiseImageSize};
UIGraphicsBeginImageContextWithOptions(rect.size, YES, 0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[self setFill]; CGContextFillRect(context, rect);
@@ -122,7 +122,7 @@ - (NSColor *)colorWithNoiseWithOpacity:(CGFloat)opacity{
return [self colorWithNoiseWithOpacity:opacity andBlendMode:kCGBlendModeScreen];
}
- (NSColor *)colorWithNoiseWithOpacity:(CGFloat)opacity andBlendMode:(CGBlendMode)blendMode{
- CGRect rect = {CGPointZero, kImageSize, kImageSize};
+ CGRect rect = {CGPointZero, kKGNoiseImageSize, kKGNoiseImageSize};
NSImage *image = [[NSImage alloc] initWithSize:rect.size];
[image lockFocus];
CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];

0 comments on commit f01a750

Please sign in to comment.