[MacRuby] #1010: NSPoint/CGpoint =>NaN
#1010: NSPoint/CGpoint =>NaN --------------------------------------+------------------------------------- Reporter: zalavariandris@… | Owner: lsansonetti@… Type: defect | Status: new Priority: trivial | Milestone: MacRuby 0.8 Component: MacRuby | Keywords: NSPoint, CGPoint, 32Bit, NaN, NSEVent --------------------------------------+------------------------------------- NSEvent.mouseLocation result in an NSPoint without the corresponding values. I have the same bug when getting the position of a CALayer. irb(main):003:0> NSEvent.mouseLocation => #<NSPoint x=NaN y=NaN> irb(main):007:0> layer=CALayer.new => #<CALayer:0x1b7a100> irb(main):008:0> layer.position => #<CGPoint x=NaN y=NaN> Macruby 0.8 | Ruby 1.9.2 MacOSX 01.6.5 (32bit ) -- Ticket URL: <http://www.macruby.org/trac/ticket/1010> MacRuby <http://macruby.org/>
#1010: NSPoint/CGpoint =>NaN --------------------------------------+------------------------------------- Reporter: zalavariandris@… | Owner: lsansonetti@… Type: defect | Status: new Priority: trivial | Milestone: MacRuby 0.8 Component: MacRuby | Keywords: NSPoint, CGPoint, 32Bit, NaN, NSEVent --------------------------------------+------------------------------------- Old description:
NSEvent.mouseLocation result in an NSPoint without the corresponding values. I have the same bug when getting the position of a CALayer.
irb(main):003:0> NSEvent.mouseLocation => #<NSPoint x=NaN y=NaN>
irb(main):007:0> layer=CALayer.new => #<CALayer:0x1b7a100> irb(main):008:0> layer.position => #<CGPoint x=NaN y=NaN>
Macruby 0.8 | Ruby 1.9.2 MacOSX 01.6.5 (32bit )
New description: NSEvent.mouseLocation result in an NSPoint without the corresponding values. I have the same bug when getting the position of a CALayer. {{{ irb(main):003:0> NSEvent.mouseLocation => #<NSPoint x=NaN y=NaN> irb(main):007:0> layer=CALayer.new => #<CALayer:0x1b7a100> irb(main):008:0> layer.position => #<CGPoint x=NaN y=NaN> }}} Macruby 0.8 | Ruby 1.9.2 MacOSX 01.6.5 (32bit ) -- Comment(by martinlagardette@…): From a comment from a closed bug: {{{ $> arch -i386 macruby -e 'framework "Cocoa"; p NSMakeSize(400, 400)' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1010#comment:1> MacRuby <http://macruby.org/>
#1010: NSPoint/CGpoint =>NaN --------------------------------------+------------------------------------- Reporter: zalavariandris@… | Owner: lsansonetti@… Type: defect | Status: new Priority: trivial | Milestone: Component: MacRuby | Keywords: NSPoint, CGPoint, 32Bit, NaN, NSEVent --------------------------------------+------------------------------------- Changes (by lsansonetti@…): * milestone: MacRuby 0.8 => Comment: Indeed: {{{ $ ./miniruby -e "framework 'Cocoa'; p NSEvent.mouseLocation" #<CGPoint x=1113.0 y=728.0> $ arch -i386 ./miniruby -e "framework 'Cocoa'; p NSEvent.mouseLocation" #<NSPoint x=NaN y=NaN> }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1010#comment:2> MacRuby <http://macruby.org/>
#1010: NSPoint/CGpoint =>NaN --------------------------------------+------------------------------------- Reporter: zalavariandris@… | Owner: lsansonetti@… Type: defect | Status: new Priority: trivial | Milestone: Component: MacRuby | Keywords: NSPoint, CGPoint, 32Bit, NaN, NSEVent --------------------------------------+------------------------------------- Comment(by lsansonetti@…): Looks like yet another 32-bit ABI issue. The IR code we emit: {{{ %1 = type { float, float } define i32 @1(i8*, i32, i8*, i32, i32*) { EntryBlock: %5 = bitcast i8* %0 to %1 (i32, i8*)* ; <%1 (i32, i8*)*> [#uses=1] %6 = tail call %1 %5(i32 %1, i8* %2) ; <%1> [#uses=2] %7 = extractvalue %1 %6, 0 ; <float> [#uses=1] %8 = tail call i32 @vm_float_to_rval(float %7) ; <i32> [#uses=1] %9 = extractvalue %1 %6, 1 ; <float> [#uses=1] %10 = tail call i32 @vm_float_to_rval(float %9) ; <i32> [#uses=1] %11 = tail call i32 (i32, i32, ...)* @rb_vm_new_struct(i32 36883328, i32 2, i32 %8, i32 %10) ; <i32> [#uses=1] ret i32 %11 } }}} IR code emitted by llvm-gcc for a similar expression: {{{ %struct._NSPoint = type { float, float } %1 = alloca %struct._NSPoint ; <%struct._NSPoint*> [#uses=3] %6 = call i64 bitcast (%struct.objc_object* (%struct.objc_object*, %struct.objc_selector*, ...)* @objc_msgSend to i64 (%struct.objc_object*, %struct.objc_selector*)*)(%struct.objc_object* %5, %struct.objc_selector* %4) nounwind ; <i64> [#uses=1] %7 = bitcast %struct._NSPoint* %1 to i64* ; <i64*> [#uses=1] store i64 %6, i64* %7, align 4 }}} llvm-gcc seems to return the NSPoint struct into a 64-bit integer. -- Ticket URL: <http://www.macruby.org/trac/ticket/1010#comment:3> MacRuby <http://macruby.org/>
#1010: NSPoint/CGpoint =>NaN ---------------------------------------------------+------------------------ Reporter: zalavariandris@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: trivial | Milestone: MacRuby 0.8 Component: MacRuby | Resolution: fixed Keywords: NSPoint, CGPoint, 32Bit, NaN, NSEVent | ---------------------------------------------------+------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.8 Comment: Should be fixed in r4952. -- Ticket URL: <http://www.macruby.org/trac/ticket/1010#comment:4> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby