morphisms: remove 'return 0;' at end since it is now added by default

This commit is contained in:
Michael Sippel 2025-04-03 16:37:46 +02:00
parent 3f1397735c
commit ef819b4711
Signed by: senvas
GPG key ID: F96CF119C34B64A6
11 changed files with 42 additions and 107 deletions

View file

@ -5,43 +5,27 @@
morph_real_as_decimalstr_to_float ()
~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
--> ~ native.Float32
```
sscanf(src, "%f", dst);
return 0;
```
```sscanf(src, "%f", dst);```
morph_real_as_decimalstr_to_double ()
~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
--> ~ native.Float64
```
sscanf(src, "%lf", dst);
return 0;
```
```sscanf(src, "%lf", dst);```
morph_real_as_float_to_decimalstr ()
~ native.Float32
--> ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
```
sprintf(dst, "%f", *src);
return 0;
```
```sprintf(dst, "%f", *src);```
morph_real_as_double_to_decimalstr ()
~ native.Float64
--> ~ <PosInt 10 BigEndian> ~ <Seq~<ValueTerminated 0> <Digit 10>~Char~Ascii~native.UInt8>
```
sprintf(dst, "%f", *src);
return 0;
```
```sprintf(dst, "%f", *src);```
morph_real_as_float_to_double ()
~ native.Float32
--> ~ native.Float64
```
*dst = *src;
return 0;
```
```*dst = *src;```
morph_real_as_double_to_float ()
~ native.Float64
@ -49,7 +33,6 @@ morph_real_as_double_to_float ()
```
fprintf(stderr, "Warning: morphin Double -> Float. Precision loss!");
*dst = *src;
return 0;
```
morph_real_as_u64_to_float ()
@ -58,7 +41,6 @@ morph_real_as_u64_to_float ()
```
fprintf(stderr, "Warning: morphin UInt64 -> Float. Precision loss!");
*dst = *src;
return 0;
```
morph_real_as_u64_to_double ()
@ -67,7 +49,14 @@ morph_real_as_u64_to_double ()
```
fprintf(stderr, "Warning: morphin UInt64 -> Double. Precision loss!");
*dst = *src;
return 0;
```
morph_real_as_nat_to_quantized_linear ()
~ ~ native.UInt64
--> ~ <QuantizedLinear 0 1 1> ~ ~ native.UInt64
```
*dst = *src;
```
morph_real_as_quantized_linear_to_float (Begin: , End: , Steps: )
@ -75,7 +64,6 @@ morph_real_as_quantized_linear_to_float (Begin: , End: , Steps: )
--> ~ native.Float32
```
*dst = (float)Begin + ( *src * ((float)End - (float)Begin) ) / (float)Steps;
return 0;
```
morph_real_as_float_to_quantized_linear (Begin: , End: , Steps: )
@ -83,7 +71,6 @@ morph_real_as_float_to_quantized_linear (Begin: , End: , Steps: )
--> ~ <QuantizedLinear Begin End Steps> ~ ~ native.UInt64
```
*dst = ((*src - (float)Begin) * (float)Steps) / ((float)End - (float)Begin);
return 0;
```
@ -93,7 +80,6 @@ morph_real_as_quantized_linear_to_double (Begin: , End: , Steps: )
--> ~ native.Float64
```
*dst = (double)Begin + ( *src * ((double)End - (double)Begin) ) / (double)Steps;
return 0;
```
morph_real_as_double_to_quantized_linear (Begin: , End: , Steps: )
@ -101,5 +87,4 @@ morph_real_as_double_to_quantized_linear (Begin: , End: , Steps: )
--> ~ <QuantizedLinear Begin End Steps> ~ ~ native.UInt64
```
*dst = ((*src - (double)Begin) * (double)Steps) / ((double)End - (double)Begin);
return 0;
```