From 6e4dc8e3f51a1e8de7b60e8d9275a9d9fcf023fc Mon Sep 17 00:00:00 2001 From: Scott Gonyea Date: Sun, 10 Oct 2010 18:54:53 -0700 Subject: [PATCH] Small change to global var and allocating it to Ruby. --- .gitignore | 1 + rb_fraction.m | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3a0d8ae..3f2cb01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.o *.bundle +Makefile diff --git a/rb_fraction.m b/rb_fraction.m index 167bb7a..f3410cf 100644 --- a/rb_fraction.m +++ b/rb_fraction.m @@ -50,12 +50,12 @@ void fraction_free(Fraction *fraction) { } VALUE fraction_allocate(VALUE klass) { - Fraction *fraction = [[Fraction alloc] init]; + frac = [[Fraction alloc] init]; - [fraction setDenominator:Qnil]; - [fraction setNumerator:Qnil]; + [frac setDenominator:Qnil]; + [frac setNumerator:Qnil]; - return Data_Wrap_Struct(klass, fraction_mark, fraction_free, fraction); + return Data_Wrap_Struct(klass, fraction_mark, fraction_free, frac); } VALUE fraction_initialize(VALUE self) {