Skip to content

Commit

Permalink
Small changes, again. Cleaning up leftover bits from playing around.
Browse files Browse the repository at this point in the history
  • Loading branch information
sgonyea committed Oct 11, 2010
1 parent 37b3e34 commit 5fda1c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fraction.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import "Fraction.h"

@implementation Fraction
-(void) setNumerator: (VALUE) _numerator {
-(void) setNumerator: (VALUE) _numerator {
numerator = _numerator;
}

Expand Down
2 changes: 1 addition & 1 deletion rb_fraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ VALUE rb_set_denominator(VALUE, VALUE);
void fraction_mark(Fraction*);
void fraction_free(Fraction*);
VALUE fraction_allocate(VALUE);
VALUE fraction_initialize(VALUE);
VALUE fraction_initialize(VALUE);
3 changes: 1 addition & 2 deletions rb_fraction.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ VALUE fraction_allocate(VALUE klass) {
}

VALUE fraction_initialize(VALUE self) {
Fraction *fraction;
// Can't use Data_Get_Struct, but it's 'coo.
// Data_Get_Struct(self, Fraction, fraction);
fraction = (Fraction*)DATA_PTR(self);
frac = (Fraction*)DATA_PTR(self);
return self;
}

8 changes: 5 additions & 3 deletions tst.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
puts %Q{requiring... ./fraction}
puts %Q{requiring... './fraction'}
puts require './fraction'

puts %Q{including... Fraction}
puts a = Fraction.new
puts "initializing Fraction..."

puts "a = Fraction.new"
puts "=> #{a = Fraction.new}"

puts "a.numerator = 23"
puts "=> #{a.numerator = 23}"
Expand Down

0 comments on commit 5fda1c4

Please sign in to comment.