gir.core icon indicating copy to clipboard operation
gir.core copied to clipboard

Verify: Long values in properties

Open badcel opened this issue 7 months ago • 2 comments

Using long values in properties is probably broken as GObject.Value uses long instead of CLong.

badcel avatar May 23 '25 04:05 badcel

Some findings from looking into this a bit:

  • A gint64 property in C should translate into long in C#. Like #1259 this doesn't work because GObject.Value is using SetLong() and similar methods rather than SetInt64()
  • If you do have a glong property on the C side, this also translates into long on the C# side which is a problem. If the C# side uses GObject.Value.SetInt64(), this fails on the C side when using gobject_value_get_long() since gint64 and glong are unique types
  • I expect a gulong property would have the same issue.

cameronwhite avatar May 24 '25 03:05 cameronwhite

The translation is probably wrong:

  • Gint64 is correct to be translated to dotnet long as both are 64 bit in all cases.
  • glong should probably translate to dotnet CLong like it is already done for parameters and return types.

badcel avatar May 24 '25 05:05 badcel