Oxidizer issue

Code lines like :

if ((count+=update) > BM.MaxCount) {}

if(--bits_until_update==0) update();

uint sym=value/(length>>=1);

are not imported correctly.

Can you elaborate?

In .2359 this is what I get from the Oxidizer:

if (count := update) > BM.MaxCount then begin
end;

if dec(bits_until_update) = 0 then begin
  update();
end;

var sym: Integer := value / (length := 1);

The first assigns update to count rather than incrementing count by update. It should be something like

if (inc(count,update)) > Bm.MaxCount then ...

The second seems correct, but the Oxidizer gives the same result if the Java decrement operator is postfixed, i.e. if (bits_until_update-- == 0), in which case it should evaluate first and then assign.

The third does a right bit shift on length by 1 and assigns the value to length, but the Oxidized code simply assigns 1 to length.

What’s the source language? From the snippet, this could be Objective-C, C#, Java… These kind of details matter :wink:

Since I use Oxygene for Android development, I forget sometimes that there’s more than just Java :slight_smile: The code I posted is Java.

Sorry for delay. My test code was C#. As Matt wrote such code either skip -= or – operator or insert inc/dec method that is not a function so cannot be used inside if clause.

Thanks, logged as bugs://81688

Other cases failing to convert you can test by trying to import C# as Oxygene files from project at https://github.com/shintadono/laszip.net .
I wonder how to fix error :
(E236) The "unsafe" modifier is required for this member
generated by translating code :
fixed(byte* pBuffer=buffer) {...}
Is unsafe still supported? Setting this flag in project option doesn’t help.

did you apply it to the method too? It needs to be on the method and in the project.

Ah, ok, now it works. I couldn’t find in this in doc. Why in the documentation most text styling related with “unsafe” is strike through?

Documentation links that are struck out are still missing (ie being worked on). I apologize for the inconvenience, please see https://blogs.remobjects.com/2018/12/03/an-update-on-docs/ for an update on docs status. Unsafe is documented here: https://docs.elementscompiler.com/Oxygene/Members/Modifiers/