Re: [Pharo-users] UFFI code problem

2020-04-01 Thread Guillermo Polito
> El 1 abr 2020, a las 9:31, Esteban Lorenzano escribió: > > There has been a change in how the constant values needs to be declared > (because in a 64bit environment, you cannot “guess” the type by its value: 42 > can be (int32)42 or (int64)42. > Hence, you need to be explicit on the

Re: [Pharo-users] UFFI code problem

2020-04-01 Thread Esteban Lorenzano
There has been a change in how the constant values needs to be declared (because in a 64bit environment, you cannot “guess” the type by its value: 42 can be (int32)42 or (int64)42. Hence, you need to be explicit on the time. That’s why @tbrunz suggestion is accurate. Now, I remember writing

Re: [Pharo-users] UFFI code problem

2020-03-31 Thread tbrunz
Try using this expression: ^ self ffiCall: #( int abs ( int TheAnswer ) ) module: LibC i.e., add 'int' to tell Pharo that 'TheAnswer' is to be interpreted as a C integer. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] UFFI code problem

2020-03-31 Thread shawon58
that means i cant able to use Theanswer ? i attach my screenshot how i initialize the value in variable . -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] UFFI code problem

2020-03-31 Thread tbrunz
Where did you get this example? The straightforward answer is that "TheAnswer" appears to be undefined. In this context, 'ffiCall:' is expecting a valid C expression that indicates the type of a formal argument, followed by the formal argument. Based on the examples in the UFFI booklet, I would