Fix a type checking test
Use int instead of enums, because cffi returns strings for enum values :(
Fix compilation warnings
use @callback decorator. It's simpler, and cffi requires that the object stays alive.