> El 1 abr 2020, a las 9:31, Esteban Lorenzano <
[hidden email]> 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 time.
Parentheses are not needed anymore (yet they are still supported I guess) :)
You can now do
int -42
Since there is no ambiguity possible, and this is consistent with
int x
;)
>
> That’s why @tbrunz suggestion is accurate.
>
> Now, I remember writing that example years ago, but I do not remember where :P
> Can you point me to the source, so I can correct it ? (it should have been done before, but better later than never ;)
I wonder if for Pharo9 we should put the UFFI parser in strict mode.
Strict mode should
- not let people use constants without type declarations (because not doing so is a source of bugs)
- not let people use String declarations without declaring encodings (because not doing so is a source of bugs)
Of course, strictness is just a flag that people could turn off, at their own risk...
> Esteban
>
>> On 1 Apr 2020, at 06:57, tbrunz <
[hidden email]> wrote:
>>
>> 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>>
>
>