struct by value break bool parameters

Bug #1517578 reported by Lorenzo Marcantonio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
CFFI
Confirmed
Undecided
Unassigned

Bug Description

Possibly related to #1473273

Given the following defs

(defcstruct key-t
  (keycode :int)
  (c :char)
  (pressed :bool)
  (lalt :bool)
  (lctrl :bool)
  (ralt :bool)
  (rctrl :bool)
  (shift :bool))

(defcfun ("TCOD_console_wait_for_keypress" console-wait-for-keypress) (:struct key-t)
  (flush :bool))

a call to (console-wait-for-keypress nil) gives

The value 0 is not of type SB-SYS:SYSTEM-AREA-POINTER.

... for some reason the bool is 'expected' as a pointer (in the original signature it was an int)

As a workaround, using :int instead of :bool in the definition seems to work (at least doesn't give an error)

Revision history for this message
Attila Lendvai (attila-lendvai) wrote :
Changed in cffi:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.