Lines Matching refs:kind
63 zend_ffi_tag_kind kind; member
98 zend_ffi_type_kind kind; member
105 zend_ffi_type_kind kind; member
143 zend_ffi_symbol_kind kind; member
264 } else if (dst_type->kind == src_type->kind) { in zend_ffi_is_compatible_type()
265 if (dst_type->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_compatible_type()
267 } else if (dst_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_compatible_type()
270 if (dst_type->kind == ZEND_FFI_TYPE_VOID || in zend_ffi_is_compatible_type()
271 src_type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_compatible_type()
274 } else if (dst_type->kind == ZEND_FFI_TYPE_ARRAY && in zend_ffi_is_compatible_type()
282 } else if (dst_type->kind == ZEND_FFI_TYPE_POINTER && in zend_ffi_is_compatible_type()
283 src_type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_is_compatible_type()
286 if (dst_type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_compatible_type()
309 switch (ZEND_FFI_TYPE(field->type)->kind) { in zend_ffi_make_fake_struct_type()
355 zend_ffi_type_kind kind = type->kind; in zend_ffi_get_type() local
358 switch (kind) { in zend_ffi_get_type()
392 kind = type->enumeration.kind; in zend_ffi_get_type()
413 (type->kind < ZEND_FFI_TYPE_POINTER) ? in zend_ffi_cdata_to_zval_slow()
443 (type->kind < ZEND_FFI_TYPE_POINTER) ? in zend_ffi_cdata_to_zval_slow_ret()
448 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_to_zval_slow_ret()
451 } else if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_cdata_to_zval_slow_ret()
465 zend_ffi_type_kind kind = type->kind; in zend_ffi_cdata_to_zval() local
468 switch (kind) { in zend_ffi_cdata_to_zval()
511 kind = type->enumeration.kind; in zend_ffi_cdata_to_zval()
520 …} else if ((type->attr & ZEND_FFI_ATTR_CONST) && ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_F… in zend_ffi_cdata_to_zval()
598 if (ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_CHAR in zend_ffi_bit_field_to_zval()
599 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT8 in zend_ffi_bit_field_to_zval()
600 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT16 in zend_ffi_bit_field_to_zval()
601 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT32 in zend_ffi_bit_field_to_zval()
602 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT64) { in zend_ffi_bit_field_to_zval()
662 zend_ffi_type_kind kind = type->kind; in zend_ffi_zval_to_cdata() local
665 switch (kind) { in zend_ffi_zval_to_cdata()
726 kind = type->enumeration.kind; in zend_ffi_zval_to_cdata()
736 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_zval_to_cdata()
747 } else if (ZEND_FFI_TYPE(cdata->type)->kind != ZEND_FFI_TYPE_POINTER in zend_ffi_zval_to_cdata()
757 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_zval_to_cdata()
894 if (ret_type->kind != ZEND_FFI_TYPE_VOID) { in zend_ffi_callback_trampoline()
1044 zend_ffi_type_kind kind = ctype->kind; in zend_ffi_cdata_cast_object() local
1047 switch (kind) { in zend_ffi_cdata_cast_object()
1090 kind = ctype->enumeration.kind; in zend_ffi_cdata_cast_object()
1096 …} else if ((ctype->attr & ZEND_FFI_ATTR_CONST) && ZEND_FFI_TYPE(ctype->pointer.type)->kind == ZEND… in zend_ffi_cdata_cast_object()
1125 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_read_field()
1126 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_field()
1141 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_read_field()
1176 && field_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_field()
1203 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_write_field()
1204 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_write_field()
1219 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_write_field()
1278 if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) { in zend_ffi_cdata_read_dim()
1291 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_dim()
1302 } else if (EXPECTED(type->kind == ZEND_FFI_TYPE_POINTER)) { in zend_ffi_cdata_read_dim()
1308 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_dim()
1341 if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) { in zend_ffi_cdata_write_dim()
1357 } else if (EXPECTED(type->kind == ZEND_FFI_TYPE_POINTER)) { in zend_ffi_cdata_write_dim()
1415 switch (type->kind) { in zend_ffi_ctype_name()
1554 if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_return_unsupported()
1556 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_return_unsupported()
1567 if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_pass_unsupported()
1569 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_pass_unsupported()
1666 if (type1->kind == ZEND_FFI_TYPE_POINTER && type2->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_compare_objects()
1687 if (type->kind != ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_count_elements()
1704 if (base_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_add()
1722 new_type->kind = ZEND_FFI_TYPE_POINTER; in zend_ffi_add()
1763 if (type1->kind == ZEND_FFI_TYPE_POINTER || type1->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1776 if (type2->kind == ZEND_FFI_TYPE_POINTER || type2->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1780 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_do_operation()
1787 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_do_operation()
1813 if (type2->kind == ZEND_FFI_TYPE_POINTER || type2->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1866 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_it_get_current_data()
1915 if (type->kind != ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_get_iterator()
1951 switch (type->kind) { in zend_ffi_cdata_get_debug_info()
1981 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_cdata_get_debug_info()
2040 if (type->kind != ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_get_closure()
2045 if (type->kind != ZEND_FFI_TYPE_FUNC) { in zend_ffi_cdata_get_closure()
2113 } else if (type1->kind == type2->kind) { in zend_ffi_is_same_type()
2114 if (type1->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_same_type()
2116 } else if (type1->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_same_type()
2119 if (type1->kind == ZEND_FFI_TYPE_VOID || in zend_ffi_is_same_type()
2120 type2->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_same_type()
2123 } else if (type1->kind == ZEND_FFI_TYPE_ARRAY && in zend_ffi_is_same_type()
2194 switch (type->kind) { in _zend_ffi_type_dtor()
2349 if (type->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_clone_obj()
2370 …if (sym && sym->kind != ZEND_FFI_SYM_VAR && sym->kind != ZEND_FFI_SYM_CONST && sym->kind != ZEND_F… in zend_ffi_read_var()
2382 if (sym->kind == ZEND_FFI_SYM_VAR) { in zend_ffi_read_var()
2384 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in zend_ffi_read_var()
2388 new_type->kind = ZEND_FFI_TYPE_POINTER; in zend_ffi_read_var()
2419 if (sym && sym->kind != ZEND_FFI_SYM_VAR) { in zend_ffi_write_var()
2446 zend_ffi_type_kind kind = type->kind; in zend_ffi_pass_arg() local
2451 switch (kind) { in zend_ffi_pass_arg()
2515 && ((ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_CHAR) in zend_ffi_pass_arg()
2516 || (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_VOID))) { in zend_ffi_pass_arg()
2523 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_pass_arg()
2535 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_pass_arg()
2562 kind = type->enumeration.kind; in zend_ffi_pass_arg()
2653 ZEND_ASSERT(type->kind == ZEND_FFI_TYPE_FUNC); in ZEND_FUNCTION()
2796 if (sym && sym->kind != ZEND_FFI_SYM_FUNC) { in zend_ffi_get_func()
2806 ZEND_ASSERT(type->kind == ZEND_FFI_TYPE_FUNC); in zend_ffi_get_func()
2919 if (sym->kind == ZEND_FFI_SYM_VAR) { in ZEND_METHOD()
2925 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in ZEND_METHOD()
2957 if (old->kind != type->kind in zend_ffi_same_types()
2964 switch (old->kind) { in zend_ffi_same_types()
2966 return old->enumeration.kind == type->enumeration.kind; in zend_ffi_same_types()
3035 if (old->kind != sym->kind || old->is_const != sym->is_const) { in zend_ffi_same_symbols()
3039 if (old->kind == ZEND_FFI_SYM_CONST) { in zend_ffi_same_symbols()
3051 if (old->kind != tag->kind) { in zend_ffi_same_tags()
3069 switch (dcl_type->kind) { in zend_ffi_subst_old_type()
3236 if (sym->kind == ZEND_FFI_SYM_VAR) { in zend_ffi_load()
3250 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in zend_ffi_load()
3305 …ading '%s', redefinition of '%s %s'", filename, zend_ffi_tag_kind_name[tag->kind], ZSTR_VAL(name)); in zend_ffi_load()
3498 if (type->kind == ZEND_FFI_TYPE_ENUM) { in zend_ffi_validate_incomplete_type()
3535 if (type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_validate_type()
3545 if (type->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_validate_var_type()
3573 switch (dcl_type->kind) { in zend_ffi_subst_type()
3729 if (type->kind < ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3755 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3868 if (type->kind < ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) < IS_STRING) { in ZEND_METHOD()
3880 } else if (type->kind == ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) == IS_LONG) { in ZEND_METHOD()
3890 } else if (type->kind == ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) == IS_NULL) { in ZEND_METHOD()
3911 if (type->kind < ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3916 if (old_type->kind == ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3917 && type->kind != ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3918 && ZEND_FFI_TYPE(old_type->pointer.type)->kind == ZEND_FFI_TYPE_VOID) { in ZEND_METHOD()
3921 } else if (old_type->kind == ZEND_FFI_TYPE_ARRAY in ZEND_METHOD()
3922 && type->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4070 if (type->kind == ZEND_FFI_TYPE_FUNC) { in ZEND_METHOD()
4073 } else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) { in ZEND_METHOD()
4076 } else if (type->kind == ZEND_FFI_TYPE_VOID) { in ZEND_METHOD()
4104 …} else if (ZEND_FFI_TYPE(type)->kind == ZEND_FFI_TYPE_ARRAY && (ZEND_FFI_TYPE(type)->attr & ZEND_F… in ZEND_METHOD()
4111 new_type->kind = ZEND_FFI_TYPE_ARRAY; in ZEND_METHOD()
4154 new_type->kind = ZEND_FFI_TYPE_POINTER; in ZEND_METHOD()
4252 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4256 if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) { in ZEND_METHOD()
4272 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4276 if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) { in ZEND_METHOD()
4316 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4320 if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) { in ZEND_METHOD()
4340 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4344 if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) { in ZEND_METHOD()
4382 if (type->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4386 if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) { in ZEND_METHOD()
4414 if (type->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4418 if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) { in ZEND_METHOD()
4425 …if (type->kind == ZEND_FFI_TYPE_POINTER && ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYP… in ZEND_METHOD()
4427 …} else if (type->kind == ZEND_FFI_TYPE_ARRAY && ZEND_FFI_TYPE(type->array.type)->kind == ZEND_FFI_… in ZEND_METHOD()
4458 if (type->kind != ZEND_FFI_TYPE_POINTER){ in ZEND_METHOD()
5204 static const zend_ffi_type zend_ffi_type_void = {.kind=ZEND_FFI_TYPE_VOID, .size=1, .align=1};
5205 static const zend_ffi_type zend_ffi_type_char = {.kind=ZEND_FFI_TYPE_CHAR, .size=1, .align=_Alignof…
5206 static const zend_ffi_type zend_ffi_type_bool = {.kind=ZEND_FFI_TYPE_BOOL, .size=1, .align=_Alignof…
5207 static const zend_ffi_type zend_ffi_type_sint8 = {.kind=ZEND_FFI_TYPE_SINT8, .size=1, .align=_Align…
5208 static const zend_ffi_type zend_ffi_type_uint8 = {.kind=ZEND_FFI_TYPE_UINT8, .size=1, .align=_Align…
5209 static const zend_ffi_type zend_ffi_type_sint16 = {.kind=ZEND_FFI_TYPE_SINT16, .size=2, .align=_Ali…
5210 static const zend_ffi_type zend_ffi_type_uint16 = {.kind=ZEND_FFI_TYPE_UINT16, .size=2, .align=_Ali…
5211 static const zend_ffi_type zend_ffi_type_sint32 = {.kind=ZEND_FFI_TYPE_SINT32, .size=4, .align=_Ali…
5212 static const zend_ffi_type zend_ffi_type_uint32 = {.kind=ZEND_FFI_TYPE_UINT32, .size=4, .align=_Ali…
5213 static const zend_ffi_type zend_ffi_type_sint64 = {.kind=ZEND_FFI_TYPE_SINT64, .size=8, .align=_Ali…
5214 static const zend_ffi_type zend_ffi_type_uint64 = {.kind=ZEND_FFI_TYPE_UINT64, .size=8, .align=_Ali…
5215 static const zend_ffi_type zend_ffi_type_float = {.kind=ZEND_FFI_TYPE_FLOAT, .size=sizeof(float), .…
5216 static const zend_ffi_type zend_ffi_type_double = {.kind=ZEND_FFI_TYPE_DOUBLE, .size=sizeof(double)…
5219 static const zend_ffi_type zend_ffi_type_long_double = {.kind=ZEND_FFI_TYPE_LONGDOUBLE, .size=sizeo…
5222 static const zend_ffi_type zend_ffi_type_ptr = {.kind=ZEND_FFI_TYPE_POINTER, .size=sizeof(void*), .…
5446 return (sym->kind == ZEND_FFI_SYM_TYPE);
5464 if (sym && sym->kind == ZEND_FFI_SYM_TYPE) {
5486 val->kind = ZEND_FFI_VAL_NAME;
5492 if (sym && sym->kind == ZEND_FFI_SYM_CONST) {
5494 switch (sym->type->kind) {
5498 val->kind = ZEND_FFI_VAL_INT32;
5501 val->kind = ZEND_FFI_VAL_INT64;
5506 val->kind = ZEND_FFI_VAL_UINT32;
5509 val->kind = ZEND_FFI_VAL_UINT64;
5517 val->kind = ZEND_FFI_VAL_ERROR;
5524 type->kind = ZEND_FFI_TYPE_ENUM;
5530 type->enumeration.kind = ZEND_FFI_TYPE_UINT8;
5534 type->enumeration.kind = ZEND_FFI_TYPE_UINT32;
5549 (enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT8 ||
5550 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT16 ||
5551 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT32 ||
5552 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT64);
5554 ZEND_ASSERT(enum_type && enum_type->kind == ZEND_FFI_TYPE_ENUM);
5555 if (val->kind == ZEND_FFI_VAL_EMPTY) {
5567 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
5576 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
5585 } else if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
5629 enum_type->enumeration.kind = sym_type->kind;
5643 sym->kind = ZEND_FFI_SYM_CONST;
5654 type->kind = ZEND_FFI_TYPE_STRUCT;
5709 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5754 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5757 if (field_type->kind != ZEND_FFI_TYPE_STRUCT) {
5821 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5829 if (field_type->kind < ZEND_FFI_TYPE_UINT8 || field_type->kind > ZEND_FFI_TYPE_BOOL) {
5834 if (bits->kind == ZEND_FFI_VAL_INT32 || bits->kind == ZEND_FFI_VAL_INT64) {
5848 } else if (bits->kind == ZEND_FFI_VAL_UINT32 || bits->kind == ZEND_FFI_VAL_UINT64) {
5921 ZEND_ASSERT(struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5935 type->kind = ZEND_FFI_TYPE_POINTER;
5954 if (type->kind == ZEND_FFI_TYPE_FUNC) {
5957 } else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
5974 if (len->kind == ZEND_FFI_VAL_EMPTY) {
5976 } else if (len->kind == ZEND_FFI_VAL_UINT32 || len->kind == ZEND_FFI_VAL_UINT64) {
5978 } else if (len->kind == ZEND_FFI_VAL_INT32 || len->kind == ZEND_FFI_VAL_INT64) {
5980 } else if (len->kind == ZEND_FFI_VAL_CHAR) {
5999 type->kind = ZEND_FFI_TYPE_ARRAY;
6014 if (type->kind == ZEND_FFI_TYPE_FUNC) {
6017 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) {
6039 if (arg_type->kind == ZEND_FFI_TYPE_VOID) {
6067 …if (i >= 4 && i <= 5 && (arg_type->kind == ZEND_FFI_TYPE_FLOAT || arg_type->kind == ZEND_FFI_TYPE_…
6069 if (i < 6 && (arg_type->kind == ZEND_FFI_TYPE_FLOAT || arg_type->kind == ZEND_FFI_TYPE_DOUBLE)) {
6093 type->kind = ZEND_FFI_TYPE_FUNC;
6173 if (type->kind == ZEND_FFI_TYPE_ARRAY) {
6175 type->kind = ZEND_FFI_TYPE_POINTER;
6179 new_type->kind = ZEND_FFI_TYPE_POINTER;
6186 } else if (type->kind == ZEND_FFI_TYPE_FUNC) {
6188 new_type->kind = ZEND_FFI_TYPE_POINTER;
6218 && sym->kind == ZEND_FFI_SYM_TYPE
6228 if (type->kind == ZEND_FFI_TYPE_FUNC) {
6229 if (sym->kind == ZEND_FFI_SYM_FUNC
6236 if (sym->kind == ZEND_FFI_SYM_VAR
6265 sym->kind = ZEND_FFI_SYM_TYPE;
6281 sym->kind = (type->kind == ZEND_FFI_TYPE_FUNC) ? ZEND_FFI_SYM_FUNC : ZEND_FFI_SYM_VAR;
6309 if (tag->kind != ZEND_FFI_TAG_STRUCT) {
6317 if (tag->kind != ZEND_FFI_TAG_UNION) {
6325 if (tag->kind != ZEND_FFI_TAG_ENUM) {
6345 tag->kind = ZEND_FFI_TAG_STRUCT;
6350 tag->kind = ZEND_FFI_TAG_UNION;
6355 tag->kind = ZEND_FFI_TAG_ENUM;
6523 …&& (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_V…
6532 …&& (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_V…
6541 && (val->kind == ZEND_FFI_VAL_NAME)) {
6608 …if ((val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_…
6623 switch (nested_type->kind) {
6689 switch (align_val->kind) {
6720 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6721 val->kind = ZEND_FFI_VAL_INT32; \
6723 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6724 val->kind = ZEND_FFI_VAL_INT32; \
6726 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6727 val->kind = ZEND_FFI_VAL_INT32; \
6729 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6730 val->kind = ZEND_FFI_VAL_INT32; \
6733 val->kind = ZEND_FFI_VAL_ERROR; \
6738 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6739 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6740 val->kind = MAX(val->kind, op2->kind); \
6742 } else if (op2->kind == ZEND_FFI_VAL_INT32) { \
6744 } else if (op2->kind == ZEND_FFI_VAL_INT64) { \
6746 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6747 val->kind = op2->kind; \
6749 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6752 val->kind = ZEND_FFI_VAL_ERROR; \
6754 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6755 if (op2->kind == ZEND_FFI_VAL_UINT32) { \
6757 } else if (op2->kind == ZEND_FFI_VAL_UINT64) { \
6759 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6760 val->kind = MAX(val->kind, op2->kind); \
6762 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6763 val->kind = op2->kind; \
6765 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6768 val->kind = ZEND_FFI_VAL_ERROR; \
6770 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6771 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6773 } else if (op2->kind == ZEND_FFI_VAL_INT32 ||op2->kind == ZEND_FFI_VAL_INT64) { \
6775 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6776 val->kind = MAX(val->kind, op2->kind); \
6778 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6781 val->kind = ZEND_FFI_VAL_ERROR; \
6783 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6784 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6785 val->kind = op2->kind; \
6787 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6788 val->kind = ZEND_FFI_VAL_INT64; \
6790 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6791 val->kind = op2->kind; \
6793 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6796 val->kind = ZEND_FFI_VAL_ERROR; \
6799 val->kind = ZEND_FFI_VAL_ERROR; \
6804 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6805 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6806 val->kind = MAX(val->kind, op2->kind); \
6808 } else if (op2->kind == ZEND_FFI_VAL_INT32) { \
6810 } else if (op2->kind == ZEND_FFI_VAL_INT64) { \
6812 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6814 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6817 val->kind = ZEND_FFI_VAL_ERROR; \
6819 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6820 if (op2->kind == ZEND_FFI_VAL_UINT32) { \
6822 } else if (op2->kind == ZEND_FFI_VAL_UINT64) { \
6824 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6825 val->kind = MAX(val->kind, op2->kind); \
6827 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6829 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6832 val->kind = ZEND_FFI_VAL_ERROR; \
6834 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6835 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6836 val->kind = op2->kind; \
6838 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6839 val->kind = op2->kind; \
6842 val->kind = ZEND_FFI_VAL_ERROR; \
6844 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6845 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6846 val->kind = op2->kind; \
6848 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6849 val->kind = op2->kind; \
6851 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6854 val->kind = ZEND_FFI_VAL_ERROR; \
6857 val->kind = ZEND_FFI_VAL_ERROR; \
6862 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6863 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6864 val->kind = ZEND_FFI_VAL_INT32; \
6866 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6867 val->kind = ZEND_FFI_VAL_INT32; \
6869 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6870 val->kind = ZEND_FFI_VAL_INT32; \
6872 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6873 val->kind = ZEND_FFI_VAL_INT32; \
6876 val->kind = ZEND_FFI_VAL_ERROR; \
6878 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6879 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6880 val->kind = ZEND_FFI_VAL_INT32; \
6882 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6883 val->kind = ZEND_FFI_VAL_INT32; \
6885 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6886 val->kind = ZEND_FFI_VAL_INT32; \
6888 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6889 val->kind = ZEND_FFI_VAL_INT32; \
6892 val->kind = ZEND_FFI_VAL_ERROR; \
6894 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6895 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6896 val->kind = ZEND_FFI_VAL_INT32; \
6898 } else if (op2->kind == ZEND_FFI_VAL_INT32 ||op2->kind == ZEND_FFI_VAL_INT64) { \
6899 val->kind = ZEND_FFI_VAL_INT32; \
6901 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6902 val->kind = ZEND_FFI_VAL_INT32; \
6904 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6905 val->kind = ZEND_FFI_VAL_INT32; \
6908 val->kind = ZEND_FFI_VAL_ERROR; \
6910 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6911 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6912 val->kind = ZEND_FFI_VAL_INT32; \
6914 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6915 val->kind = ZEND_FFI_VAL_INT32; \
6917 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6918 val->kind = ZEND_FFI_VAL_INT32; \
6920 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6921 val->kind = ZEND_FFI_VAL_INT32; \
6924 val->kind = ZEND_FFI_VAL_ERROR; \
6927 val->kind = ZEND_FFI_VAL_ERROR; \
6934 if (val->kind == ZEND_FFI_VAL_INT32) {
6948 if (val->kind == ZEND_FFI_VAL_INT32 && op2->kind == ZEND_FFI_VAL_INT32) {
6951 val->kind = ZEND_FFI_VAL_ERROR;
6960 if (val->kind == ZEND_FFI_VAL_INT32 && op2->kind == ZEND_FFI_VAL_INT32) {
6963 val->kind = ZEND_FFI_VAL_ERROR;
7067 switch (ZEND_FFI_TYPE(dcl->type)->kind) {
7069 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7070 val->kind = ZEND_FFI_VAL_FLOAT;
7072 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7073 val->kind = ZEND_FFI_VAL_FLOAT;
7075 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7076 val->kind = ZEND_FFI_VAL_FLOAT;
7077 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7078 val->kind = ZEND_FFI_VAL_FLOAT;
7081 val->kind = ZEND_FFI_VAL_ERROR;
7085 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7086 val->kind = ZEND_FFI_VAL_DOUBLE;
7088 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7089 val->kind = ZEND_FFI_VAL_DOUBLE;
7091 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7092 val->kind = ZEND_FFI_VAL_DOUBLE;
7093 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7094 val->kind = ZEND_FFI_VAL_DOUBLE;
7097 val->kind = ZEND_FFI_VAL_ERROR;
7102 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7103 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7105 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7106 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7108 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7109 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7110 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7111 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7114 val->kind = ZEND_FFI_VAL_ERROR;
7122 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7123 val->kind = ZEND_FFI_VAL_UINT32;
7124 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7125 val->kind = ZEND_FFI_VAL_UINT32;
7127 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7128 val->kind = ZEND_FFI_VAL_UINT32;
7131 val->kind = ZEND_FFI_VAL_ERROR;
7137 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7138 val->kind = ZEND_FFI_VAL_INT32;
7139 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7140 val->kind = ZEND_FFI_VAL_INT32;
7142 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7143 val->kind = ZEND_FFI_VAL_INT32;
7146 val->kind = ZEND_FFI_VAL_ERROR;
7150 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7151 val->kind = ZEND_FFI_VAL_UINT64;
7152 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7153 val->kind = ZEND_FFI_VAL_UINT64;
7155 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7156 val->kind = ZEND_FFI_VAL_UINT64;
7159 val->kind = ZEND_FFI_VAL_ERROR;
7163 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7164 val->kind = ZEND_FFI_VAL_CHAR;
7166 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7167 val->kind = ZEND_FFI_VAL_CHAR;
7169 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7170 val->kind = ZEND_FFI_VAL_CHAR;
7172 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7174 val->kind = ZEND_FFI_VAL_ERROR;
7178 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7179 val->kind = ZEND_FFI_VAL_UINT32;
7180 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7181 val->kind = ZEND_FFI_VAL_UINT32;
7183 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7184 val->kind = ZEND_FFI_VAL_UINT32;
7187 val->kind = ZEND_FFI_VAL_ERROR;
7191 val->kind = ZEND_FFI_VAL_ERROR;
7200 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7201 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7202 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7203 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7205 val->kind = ZEND_FFI_VAL_ERROR;
7212 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7214 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7216 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7218 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7221 val->kind = ZEND_FFI_VAL_ERROR;
7228 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7230 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7232 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7235 val->kind = ZEND_FFI_VAL_ERROR;
7243 if (val->kind == ZEND_FFI_VAL_INT32) {
7251 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_INT32) {
7252 val->kind = ZEND_FFI_VAL_UINT32;
7254 } else if (val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_VAL_INT64) {
7255 val->kind = ZEND_FFI_VAL_UINT32;
7257 } else if (val->kind == ZEND_FFI_VAL_FLOAT) {
7258 val->kind = ZEND_FFI_VAL_UINT32;
7260 } else if (val->kind == ZEND_FFI_VAL_DOUBLE) {
7261 val->kind = ZEND_FFI_VAL_UINT32;
7263 } else if (val->kind == ZEND_FFI_VAL_LONG_DOUBLE) {
7264 val->kind = ZEND_FFI_VAL_UINT32;
7270 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7271 val->kind = ZEND_FFI_VAL_UINT32;
7273 } else if (val->kind == ZEND_FFI_VAL_STRING) {
7276 val->kind = ZEND_FFI_VAL_ERROR;
7278 val->kind = ZEND_FFI_VAL_UINT32;
7282 val->kind = ZEND_FFI_VAL_ERROR;
7293 val->kind = (type->size > 0xffffffff) ? ZEND_FFI_VAL_UINT64 : ZEND_FFI_VAL_UINT32;
7301 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_INT32) {
7302 val->kind = ZEND_FFI_VAL_UINT32;
7304 } else if (val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_VAL_INT64) {
7305 val->kind = ZEND_FFI_VAL_UINT32;
7307 } else if (val->kind == ZEND_FFI_VAL_FLOAT) {
7308 val->kind = ZEND_FFI_VAL_UINT32;
7310 } else if (val->kind == ZEND_FFI_VAL_DOUBLE) {
7311 val->kind = ZEND_FFI_VAL_UINT32;
7314 } else if (val->kind == ZEND_FFI_VAL_LONG_DOUBLE) {
7315 val->kind = ZEND_FFI_VAL_UINT32;
7318 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7319 val->kind = ZEND_FFI_VAL_UINT32;
7321 } else if (val->kind == ZEND_FFI_VAL_STRING) {
7322 val->kind = ZEND_FFI_VAL_UINT32;
7325 val->kind = ZEND_FFI_VAL_ERROR;
7333 val->kind = ZEND_FFI_VAL_UINT32;
7366 val->kind = ZEND_FFI_VAL_UINT32;
7368 val->kind = (sizeof(long) == 4) ? ZEND_FFI_VAL_UINT32 : ZEND_FFI_VAL_UINT64;
7370 val->kind = ZEND_FFI_VAL_UINT64;
7375 val->kind = ZEND_FFI_VAL_INT32;
7377 val->kind = (sizeof(long) == 4) ? ZEND_FFI_VAL_INT32 : ZEND_FFI_VAL_INT64;
7379 val->kind = ZEND_FFI_VAL_INT64;
7389 val->kind = ZEND_FFI_VAL_FLOAT;
7391 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7393 val->kind = ZEND_FFI_VAL_DOUBLE;
7401 val->kind = ZEND_FFI_VAL_ERROR;
7403 val->kind = ZEND_FFI_VAL_STRING;
7415 val->kind = ZEND_FFI_VAL_ERROR;
7417 val->kind = ZEND_FFI_VAL_CHAR;
7441 val->kind = ZEND_FFI_VAL_ERROR;
7444 val->kind = ZEND_FFI_VAL_ERROR;
7449 val->kind = ZEND_FFI_VAL_ERROR;
7459 val->kind = ZEND_FFI_VAL_ERROR;
7469 val->kind = ZEND_FFI_VAL_ERROR;
7476 val->kind = ZEND_FFI_VAL_ERROR;
7479 val->kind = ZEND_FFI_VAL_ERROR;