I am getting this warning when cross compiling the Squeak plugin to C code.
---
Kindly, Robert On 6/4/21 1:21 PM, Robert Withers
wrote:
|
Hi Levente, I hope you are having a great day! Are you in Budapest? That must be awesome! A very old city. I thought I would post the Squeak code for this instantiatePoly
primitive. My image still blows up on startUp:. I am grateful you
have guided me through this!
Which is calling:
---
Köszönöm, Robert On 6/4/21 1:38 PM, Robert Withers
wrote:
|
I consolidated the RS Plugins into 1 RSPlugin class. Here is the new load script:
---
Kindly, Robert On 6/4/21 2:51 PM, Robert Withers
wrote:
|
A bit more detail on my refactoring. I combined the Plugins to 1
RSPlugin. I updated the package: CryptographyRSPluginExtending to include all problematic primitives and their send sites. This includes GFPolyWithPlugin>>#initializeField:coefficients: and the ErasureOutputByteInputCodingLoopWithPlugin methods. To load this extension (which blows up the image by the way) run this compound script:
To unload and restore prior functionality, run this compound script: That is all. ---
Kindly, Robert On 6/5/21 8:34 AM, Robert Withers
wrote:
|
CryptographyRSPluginExtending-rww.7.mcz now has all 7 missing primitives, for the FECDecoder, the GFPoly and the GaloisCodingLoop. Here is a list.
---
Kindly, Robert On 6/5/21 9:50 AM, Robert Withers
wrote:
|
In reply to this post by Robert Withers-2
Hi Robert, On Jun 4, 2021, at 10:38 AM, Robert Withers <[hidden email]> wrote:
Eliot _,,,^..^,,,_ (phone)
|
In reply to this post by Robert Withers-2
Hi Robert, _,,,^..^,,,_ (phone) > On Jun 4, 2021, at 11:52 AM, Robert Withers <[hidden email]> wrote: > > fieldSize := interpreterProxy stackIntegerValue: 1. > coefficientsOop := interpreterProxy stackObjectValue: 0. Since you check for isBytes: below you can use stackValue:. isBytes: can safely be passed any object, including immediates. So the stackObjectValue: call implies a redundant validation. > > (interpreterProxy isIntegerValue: fieldSize) > ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. This is implicit. stackIntegerValue: fails if the object is not a SmallInteger (retiring zero) and otherwise answers its integerValue. So you should check if stackIntegerValue: fails since its return value will always answer true to isIntegerValue: > (interpreterProxy isBytes: coefficientsOop) > ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. I would write fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackValue: 0. (interpreterProxy failed not and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. or fieldSizeOop := interpreterProxy stackValue: 1. coefficientsOop := interpreterProxy stackValue: 0. ((interpreterProxy isIntegerObject: fieldSizeOop) and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. fieldSize := interpreterProxy integerValueOf: fieldSizeOop. |
Hi Eliot, I hope all is well with you! I will try to make these changes, both in my working primitives and in my 7 broken primitives. See if that might help. Kindly, Robert . .. ... ‘...^,^ Hi Robert, |
In reply to this post by Eliot Miranda-2
Alright, Eliot! I finally got the changes made. You know that time when you have 2 images and you do the work in one and forget, then delete that one and have to recode all those changes? Exactly. Nonetheless, I got the changes made and did a test of creating a ByteArray in a primitive/computation method:
In my case, I decided to create the result ByteArray in the computation method and return the resultOop to the primitive for #methodReturnValue:. Here is the primitive, followed by the computation method. This seems to work as I compiled and tested it. One consideration is that if we are in a primitive and call another, like happens in the decode methods, then I must remember to #interpreterProxy firstIndexableField: resultOop to access the array again (pass as argument to yet another compute method, for instance). Is this the best approach?
And the computation method
---
Kindly, Robert On 6/5/21 7:39 PM, Eliot Miranda wrote:
Hi Robert, _,,,^..^,,,_ (phone)On Jun 4, 2021, at 11:52 AM, Robert Withers [hidden email] wrote: fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackObjectValue: 0.Since you check for isBytes: below you can use stackValue:. isBytes: can safely be passed any object, including immediates. So the stackObjectValue: call implies a redundant validation.(interpreterProxy isIntegerValue: fieldSize) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].This is implicit. stackIntegerValue: fails if the object is not a SmallInteger (retiring zero) and otherwise answers its integerValue. So you should check if stackIntegerValue: fails since its return value will always answer true to isIntegerValue:(interpreterProxy isBytes: coefficientsOop) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ].I would write fieldSize := interpreterProxy stackIntegerValue: 1. coefficientsOop := interpreterProxy stackValue: 0. (interpreterProxy failed not and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. or fieldSizeOop := interpreterProxy stackValue: 1. coefficientsOop := interpreterProxy stackValue: 0. ((interpreterProxy isIntegerObject: fieldSizeOop) and: [interpreterProxy isBytes: coefficientsOop]) ifFalse: [ ^interpreterProxy primitiveFailFor: PrimErrBadArgument ]. fieldSize := interpreterProxy integerValueOf: fieldSizeOop. |
Free forum by Nabble | Edit this page |