Lisp HUG Maillist Archive

Problem with long-long NSNumber

LWM 5.02

Hello,

This code works normally on an Intel Mac :

(let ((NSNumber (objc:invoke "NSNumber" "numberWithLongLong:"
9223372036854775807)))
  (objc:invoke NSNumber "longLongValue"))

=> 9223372036854775807

but it crashes on a Power PC (Mac OS 10.4)

(objc:invoke NSNumber "longLongValue")

=> SIGNAL B [code F0284988] at 90A3E0F8 {inside foreign code}


In addition, this code returns an incorrect value on an Intel Mac (and
crashes also on PowerPC) :

(let ((NSNumber (objc:invoke "NSNumber" "numberWithLongLong:" -1)))
  (objc:invoke NSNumber "longLongValue"))

=> 4294967295



I work with foreign codes witch return long-long NSNumbers. My application
run well on Intel but crashes on PowerPC...

How may I fix this problem ? Is this bug fixed on LW 5.1 ?

Thanks for any help

Denis


-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Re: Problem with long-long NSNumber

Unable to parse email body. Email id is 8117

Re: Problem with long-long NSNumber




Le 12/05/08 20:11, « [NOM] » <[ADRESSE]> a écrit :

> 
>>>>>> On Sun, 11 May 2008 22:20:51 +0200, Denis Pousseur said:
>> 
>> LWM 5.02
>> 
>> Hello,
>> 
>> This code works normally on an Intel Mac :
>> 
>> (let ((NSNumber (objc:invoke "NSNumber" "numberWithLongLong:"
>> 9223372036854775807)))
>>   (objc:invoke NSNumber "longLongValue"))
>> 
>> => 9223372036854775807
>> 
>> but it crashes on a Power PC (Mac OS 10.4)
>> 
>> (objc:invoke NSNumber "longLongValue")
>> 
>> => SIGNAL B [code F0284988] at 90A3E0F8 {inside foreign code}
>> 
>> 
>> In addition, this code returns an incorrect value on an Intel Mac (and
>> crashes also on PowerPC) :
>> 
>> (let ((NSNumber (objc:invoke "NSNumber" "numberWithLongLong:" -1)))
>>   (objc:invoke NSNumber "longLongValue"))
>> 
>> => 4294967295
>> 
>> 
>> 
>> I work with foreign codes witch return long-long NSNumbers. My application
>> run well on Intel but crashes on PowerPC...
>> 
>> How may I fix this problem ? Is this bug fixed on LW 5.1 ?
> 
> The crash is fixed in LW 5.1 on PowerPC, but there is still a bug when passing
> a long-long on Intel for values from (- (expt 2 31)) to -1.  We will fix this.

Thanks for this info

Best regards

Denis

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Updated at: 2020-12-10 08:43 UTC