Skip to content

Instantly share code, notes, and snippets.

@DoubleEqual
Created August 14, 2012 21:28
Show Gist options
  • Save DoubleEqual/3353195 to your computer and use it in GitHub Desktop.
Save DoubleEqual/3353195 to your computer and use it in GitHub Desktop.
Struct for Integer type as CGPoint Struct
//
// DEIntegerPoint.h
//
//
// Created by Sergio on 18/07/12.
// Copyright (c) 2012 Doubleequal.com. All rights reserved.
//
#import <Foundation/Foundation.h>
struct DEIntegerPoint
{
NSInteger x;
NSInteger y;
};
CG_INLINE struct DEIntegerPoint
DEIntegerPointMake(NSInteger x, NSInteger y)
{
struct DEIntegerPoint p;
p.x = x;
p.y = y;
return p;
}
CG_INLINE bool
__DEIntegerPointEqualToPoint(struct DEIntegerPoint point1, struct DEIntegerPoint point2)
{
return point1.x == point2.x && point1.y == point2.y;
}
#define DEIntegerPointEqualToPoint __DEIntegerPointEqualToPoint
#define DEIntegerPointZero DEIntegerPointMake(0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment