summaryrefslogtreecommitdiff
path: root/tikzit/src/common/RectangleShape.m
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2013-03-25 16:19:46 +0000
committerAlex Merry <dev@randomguy3.me.uk>2013-03-25 16:19:46 +0000
commit1b83e14b1f5640881deeb03c1d11df5197746b64 (patch)
tree15459d01d836db14064f120fdd7a3ab38ef2e421 /tikzit/src/common/RectangleShape.m
parentc0137b33c535eb04f5e7d5628e9a225e226c5b34 (diff)
Fix issues found by the clang static analyzer
Diffstat (limited to 'tikzit/src/common/RectangleShape.m')
-rw-r--r--tikzit/src/common/RectangleShape.m41
1 files changed, 21 insertions, 20 deletions
diff --git a/tikzit/src/common/RectangleShape.m b/tikzit/src/common/RectangleShape.m
index e332d40..db9c803 100644
--- a/tikzit/src/common/RectangleShape.m
+++ b/tikzit/src/common/RectangleShape.m
@@ -28,26 +28,27 @@
@implementation RectangleShape
- (id)init {
- [super init];
- Node *n0,*n1,*n2,*n3;
- float sz = 0.2f;
-
- n0 = [Node nodeWithPoint:NSMakePoint(-sz, sz)];
- n1 = [Node nodeWithPoint:NSMakePoint( sz, sz)];
- n2 = [Node nodeWithPoint:NSMakePoint( sz,-sz)];
- n3 = [Node nodeWithPoint:NSMakePoint(-sz,-sz)];
-
- Edge *e0,*e1,*e2,*e3;
-
- e0 = [Edge edgeWithSource:n0 andTarget:n1];
- e1 = [Edge edgeWithSource:n1 andTarget:n2];
- e2 = [Edge edgeWithSource:n2 andTarget:n3];
- e3 = [Edge edgeWithSource:n3 andTarget:n0];
-
- paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil];
-
- styleTikz = @"rectangle";
-
+ self = [super init];
+ if (self) {
+ Node *n0,*n1,*n2,*n3;
+ float sz = 0.2f;
+
+ n0 = [Node nodeWithPoint:NSMakePoint(-sz, sz)];
+ n1 = [Node nodeWithPoint:NSMakePoint( sz, sz)];
+ n2 = [Node nodeWithPoint:NSMakePoint( sz,-sz)];
+ n3 = [Node nodeWithPoint:NSMakePoint(-sz,-sz)];
+
+ Edge *e0,*e1,*e2,*e3;
+
+ e0 = [Edge edgeWithSource:n0 andTarget:n1];
+ e1 = [Edge edgeWithSource:n1 andTarget:n2];
+ e2 = [Edge edgeWithSource:n2 andTarget:n3];
+ e3 = [Edge edgeWithSource:n3 andTarget:n0];
+
+ paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil];
+
+ styleTikz = @"rectangle";
+ }
return self;
}