Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility of implementing the TODO: CTA_QUAL ? #9

Open
folays opened this issue Feb 13, 2023 · 0 comments
Open

Possibility of implementing the TODO: CTA_QUAL ? #9

folays opened this issue Feb 13, 2023 · 0 comments

Comments

@folays
Copy link

folays commented Feb 13, 2023

Hello, I'm encountering the following

ffi.cdef[[ struct ImVec4 { float x,y,z,w; }; ]]

reflect.typeof(ffi.typeof("      struct ImVec4")) -- okay
reflect.typeof(ffi.typeof("const struct ImVec4")) -- complains due to some TODO

error :

./reflect.lua:208: TODO: CTA_QUAL
stack traceback:
	[C]: in function 'error'
	./reflect.lua:208: in function 'CTA'
	./reflect.lua:281: in function 'typeof'

which is into those lines belonging to reflect.lua :

-- Logic for merging an attribute CType onto the annotated CType.
local CTAs = {[0] =
  function(a, refct) error("TODO: CTA_NONE") end,
  function(a, refct) error("TODO: CTA_QUAL") end,          <<< ERROR THERE
  function(a, refct)
    a = 2^a.value
    refct.alignment = a
    refct.attributes.align = a
  end,
  function(a, refct)
    refct.transparent = true
    refct.attributes.subtype = refct.typeid
  end,
  function(a, refct) refct.sym_name = a.name end,
  function(a, refct) error("TODO: CTA_BAD") end,
}

The "types" that I get in input are not under my control, I get those const ImVec4 from a 3rd party : https://github.com/cimgui/cimgui/blob/docking_inter/generator/output/definitions.lua

Of course I could also workaround my problem by tricking my code into stripping the const problematics to reflect.typeof()

Would you have time... to do... this TODO: CTA_QUAL ? :)

Thanks,

Kind Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant