Cast from c_int to bool is forbidden. Replace `as bool` by `!= 0`