Skip to content

write_compute_value_instructions` doesn't consider Nullable pointers #28

@ManasJayanth

Description

@ManasJayanth

Trying to generate bindings for Gstreamer (GstTagList), I get the following on compiling the generated bindings.

File "lib/Tag_list.ml", line 38, characters 34-43:
Error: This expression has type
         GLib.Date.t Ctypes.structure Ctypes_static.ptr option Ctypes.ptr =
           (GLib.Date.t Ctypes.structure Ctypes_static.ptr option, [ `C ])
           Ctypes_static.pointer
       but an expression was expected of type
         GLib.Date.t Ctypes.structure Ctypes_static.ptr Ctypes_static.ptr =
           (GLib.Date.t Ctypes.structure Ctypes_static.ptr, [ `C ])
           Ctypes_static.pointer
       Type GLib.Date.t Ctypes.structure Ctypes_static.ptr option
       is not compatible with type
         GLib.Date.t Ctypes.structure Ctypes_static.ptr =
           (GLib.Date.t Ctypes.structure, [ `C ]) Ctypes_static.pointer

Pointing to a line like this

  let value_ptr = allocate (ptr_opt Date.t_typ) None in                                                                                                                                                            
  let ret = get_date_raw self tag value_ptr in 

I think write_compute_value_instructions must check if the out args (inout args too I'm guessing) could be a Nullable.

I couldn't find the right patch to get this work, if I have any luck, I'll raise a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions