Lines Matching refs:kind
62 zend_ffi_tag_kind kind; member
97 zend_ffi_type_kind kind; member
104 zend_ffi_type_kind kind; member
142 zend_ffi_symbol_kind kind; member
263 } else if (dst_type->kind == src_type->kind) { in zend_ffi_is_compatible_type()
264 if (dst_type->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_compatible_type()
266 } else if (dst_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_compatible_type()
269 if (dst_type->kind == ZEND_FFI_TYPE_VOID || in zend_ffi_is_compatible_type()
270 src_type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_compatible_type()
273 } else if (dst_type->kind == ZEND_FFI_TYPE_ARRAY && in zend_ffi_is_compatible_type()
281 } else if (dst_type->kind == ZEND_FFI_TYPE_POINTER && in zend_ffi_is_compatible_type()
282 src_type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_is_compatible_type()
285 if (dst_type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_compatible_type()
301 switch (ZEND_FFI_TYPE(field->type)->kind) { in zend_ffi_face_struct_add_fields()
382 zend_ffi_type_kind kind = type->kind; in zend_ffi_get_type() local
385 switch (kind) { in zend_ffi_get_type()
419 kind = type->enumeration.kind; in zend_ffi_get_type()
436 (type->kind < ZEND_FFI_TYPE_POINTER) ? in zend_ffi_cdata_to_zval_slow()
466 (type->kind < ZEND_FFI_TYPE_POINTER) ? in zend_ffi_cdata_to_zval_slow_ret()
471 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_to_zval_slow_ret()
474 } else if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_cdata_to_zval_slow_ret()
488 zend_ffi_type_kind kind = type->kind; in zend_ffi_cdata_to_zval() local
491 switch (kind) { in zend_ffi_cdata_to_zval()
534 kind = type->enumeration.kind; in zend_ffi_cdata_to_zval()
543 …} else if ((type->attr & ZEND_FFI_ATTR_CONST) && ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_F… in zend_ffi_cdata_to_zval()
621 if (ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_CHAR in zend_ffi_bit_field_to_zval()
622 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT8 in zend_ffi_bit_field_to_zval()
623 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT16 in zend_ffi_bit_field_to_zval()
624 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT32 in zend_ffi_bit_field_to_zval()
625 || ZEND_FFI_TYPE(field->type)->kind == ZEND_FFI_TYPE_SINT64) { in zend_ffi_bit_field_to_zval()
685 zend_ffi_type_kind kind = type->kind; in zend_ffi_zval_to_cdata() local
688 switch (kind) { in zend_ffi_zval_to_cdata()
749 kind = type->enumeration.kind; in zend_ffi_zval_to_cdata()
759 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_zval_to_cdata()
770 } else if (ZEND_FFI_TYPE(cdata->type)->kind != ZEND_FFI_TYPE_POINTER in zend_ffi_zval_to_cdata()
780 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_zval_to_cdata()
925 if (ret_type->kind != ZEND_FFI_TYPE_VOID) { in zend_ffi_callback_trampoline()
1092 zend_ffi_type_kind kind = ctype->kind; in zend_ffi_cdata_cast_object() local
1095 switch (kind) { in zend_ffi_cdata_cast_object()
1138 kind = ctype->enumeration.kind; in zend_ffi_cdata_cast_object()
1144 …} else if ((ctype->attr & ZEND_FFI_ATTR_CONST) && ZEND_FFI_TYPE(ctype->pointer.type)->kind == ZEND… in zend_ffi_cdata_cast_object()
1173 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_read_field()
1174 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_field()
1187 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_read_field()
1218 && field_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_field()
1242 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_write_field()
1243 if (type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_write_field()
1256 if (UNEXPECTED(type->kind != ZEND_FFI_TYPE_STRUCT)) { in zend_ffi_cdata_write_field()
1308 if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) { in zend_ffi_cdata_read_dim()
1321 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_dim()
1332 } else if (EXPECTED(type->kind == ZEND_FFI_TYPE_POINTER)) { in zend_ffi_cdata_read_dim()
1338 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_read_dim()
1371 if (EXPECTED(type->kind == ZEND_FFI_TYPE_ARRAY)) { in zend_ffi_cdata_write_dim()
1387 } else if (EXPECTED(type->kind == ZEND_FFI_TYPE_POINTER)) { in zend_ffi_cdata_write_dim()
1445 switch (type->kind) { in zend_ffi_ctype_name()
1584 if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_return_unsupported()
1586 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_return_unsupported()
1597 if (type->kind == ZEND_FFI_TYPE_STRUCT) { in zend_ffi_pass_unsupported()
1599 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_pass_unsupported()
1692 if (type1->kind == ZEND_FFI_TYPE_POINTER && type2->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_compare_objects()
1713 if (type->kind != ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_count_elements()
1730 if (base_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_add()
1748 new_type->kind = ZEND_FFI_TYPE_POINTER; in zend_ffi_add()
1789 if (type1->kind == ZEND_FFI_TYPE_POINTER || type1->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1802 if (type2->kind == ZEND_FFI_TYPE_POINTER || type2->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1806 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_do_operation()
1813 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_do_operation()
1839 if (type2->kind == ZEND_FFI_TYPE_POINTER || type2->kind == ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_do_operation()
1892 && dim_type->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_it_get_current_data()
1942 if (type->kind != ZEND_FFI_TYPE_ARRAY) { in zend_ffi_cdata_get_iterator()
1978 switch (type->kind) { in zend_ffi_cdata_get_debug_info()
2008 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_cdata_get_debug_info()
2067 if (type->kind != ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_get_closure()
2074 if (type->kind != ZEND_FFI_TYPE_FUNC) { in zend_ffi_cdata_get_closure()
2146 } else if (type1->kind == type2->kind) { in zend_ffi_is_same_type()
2147 if (type1->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_same_type()
2149 } else if (type1->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_is_same_type()
2152 if (type1->kind == ZEND_FFI_TYPE_VOID || in zend_ffi_is_same_type()
2153 type2->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_is_same_type()
2156 } else if (type1->kind == ZEND_FFI_TYPE_ARRAY && in zend_ffi_is_same_type()
2227 switch (type->kind) { in _zend_ffi_type_dtor()
2382 if (type->kind < ZEND_FFI_TYPE_POINTER) { in zend_ffi_cdata_clone_obj()
2401 …if (sym && sym->kind != ZEND_FFI_SYM_VAR && sym->kind != ZEND_FFI_SYM_CONST && sym->kind != ZEND_F… in zend_ffi_read_var()
2410 if (sym->kind == ZEND_FFI_SYM_VAR) { in zend_ffi_read_var()
2412 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in zend_ffi_read_var()
2416 new_type->kind = ZEND_FFI_TYPE_POINTER; in zend_ffi_read_var()
2445 if (sym && sym->kind != ZEND_FFI_SYM_VAR) { in zend_ffi_write_var()
2469 zend_ffi_type_kind kind = type->kind; in zend_ffi_pass_arg() local
2474 switch (kind) { in zend_ffi_pass_arg()
2538 && ((ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_CHAR) in zend_ffi_pass_arg()
2539 || (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_VOID))) { in zend_ffi_pass_arg()
2546 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in zend_ffi_pass_arg()
2558 } else if (ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_pass_arg()
2585 kind = type->enumeration.kind; in zend_ffi_pass_arg()
2671 ZEND_ASSERT(type->kind == ZEND_FFI_TYPE_FUNC); in ZEND_FUNCTION()
2814 if (sym && sym->kind != ZEND_FFI_SYM_FUNC) { in zend_ffi_get_func()
2824 ZEND_ASSERT(type->kind == ZEND_FFI_TYPE_FUNC); in zend_ffi_get_func()
2937 if (sym->kind == ZEND_FFI_SYM_VAR) { in ZEND_METHOD()
2944 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in ZEND_METHOD()
2977 if (old->kind != type->kind in zend_ffi_same_types()
2984 switch (old->kind) { in zend_ffi_same_types()
2986 return old->enumeration.kind == type->enumeration.kind; in zend_ffi_same_types()
3055 if (old->kind != sym->kind || old->is_const != sym->is_const) { in zend_ffi_same_symbols()
3059 if (old->kind == ZEND_FFI_SYM_CONST) { in zend_ffi_same_symbols()
3071 if (old->kind != tag->kind) { in zend_ffi_same_tags()
3089 switch (dcl_type->kind) { in zend_ffi_subst_old_type()
3256 if (sym->kind == ZEND_FFI_SYM_VAR) { in zend_ffi_load()
3270 } else if (sym->kind == ZEND_FFI_SYM_FUNC) { in zend_ffi_load()
3325 …ading '%s', redefinition of '%s %s'", filename, zend_ffi_tag_kind_name[tag->kind], ZSTR_VAL(name)); in zend_ffi_load()
3518 if (type->kind == ZEND_FFI_TYPE_ENUM) { in zend_ffi_validate_incomplete_type()
3555 if (type->kind == ZEND_FFI_TYPE_VOID) { in zend_ffi_validate_type()
3565 if (type->kind == ZEND_FFI_TYPE_FUNC) { in zend_ffi_validate_var_type()
3593 switch (dcl_type->kind) { in zend_ffi_subst_type()
3745 if (type->kind < ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3771 if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3880 if (type->kind < ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) < IS_STRING) { in ZEND_METHOD()
3892 } else if (type->kind == ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) == IS_LONG) { in ZEND_METHOD()
3902 } else if (type->kind == ZEND_FFI_TYPE_POINTER && Z_TYPE_P(zv) == IS_NULL) { in ZEND_METHOD()
3923 if (type->kind < ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
3928 if (old_type->kind == ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3929 && type->kind != ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3930 && ZEND_FFI_TYPE(old_type->pointer.type)->kind == ZEND_FFI_TYPE_VOID) { in ZEND_METHOD()
3933 } else if (old_type->kind == ZEND_FFI_TYPE_ARRAY in ZEND_METHOD()
3934 && type->kind == ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3938 } else if (old_type->kind == ZEND_FFI_TYPE_POINTER in ZEND_METHOD()
3939 && type->kind == ZEND_FFI_TYPE_ARRAY in ZEND_METHOD()
4087 if (type->kind == ZEND_FFI_TYPE_FUNC) { in ZEND_METHOD()
4090 } else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) { in ZEND_METHOD()
4093 } else if (type->kind == ZEND_FFI_TYPE_VOID) { in ZEND_METHOD()
4121 …} else if (ZEND_FFI_TYPE(type)->kind == ZEND_FFI_TYPE_ARRAY && (ZEND_FFI_TYPE(type)->attr & ZEND_F… in ZEND_METHOD()
4128 new_type->kind = ZEND_FFI_TYPE_ARRAY; in ZEND_METHOD()
4171 new_type->kind = ZEND_FFI_TYPE_POINTER; in ZEND_METHOD()
4269 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4273 if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) { in ZEND_METHOD()
4289 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4293 if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) { in ZEND_METHOD()
4333 if (type1->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4337 if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) { in ZEND_METHOD()
4357 if (type2->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4361 if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) { in ZEND_METHOD()
4399 if (type->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4403 if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) { in ZEND_METHOD()
4432 if (type->kind == ZEND_FFI_TYPE_POINTER) { in ZEND_METHOD()
4436 if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) { in ZEND_METHOD()
4443 …if (type->kind == ZEND_FFI_TYPE_POINTER && ZEND_FFI_TYPE(type->pointer.type)->kind == ZEND_FFI_TYP… in ZEND_METHOD()
4445 …} else if (type->kind == ZEND_FFI_TYPE_ARRAY && ZEND_FFI_TYPE(type->array.type)->kind == ZEND_FFI_… in ZEND_METHOD()
4476 if (type->kind != ZEND_FFI_TYPE_POINTER){ in ZEND_METHOD()
5133 static const zend_ffi_type zend_ffi_type_void = {.kind=ZEND_FFI_TYPE_VOID, .size=1, .align=1};
5134 static const zend_ffi_type zend_ffi_type_char = {.kind=ZEND_FFI_TYPE_CHAR, .size=1, .align=_Alignof…
5135 static const zend_ffi_type zend_ffi_type_bool = {.kind=ZEND_FFI_TYPE_BOOL, .size=1, .align=_Alignof…
5136 static const zend_ffi_type zend_ffi_type_sint8 = {.kind=ZEND_FFI_TYPE_SINT8, .size=1, .align=_Align…
5137 static const zend_ffi_type zend_ffi_type_uint8 = {.kind=ZEND_FFI_TYPE_UINT8, .size=1, .align=_Align…
5138 static const zend_ffi_type zend_ffi_type_sint16 = {.kind=ZEND_FFI_TYPE_SINT16, .size=2, .align=_Ali…
5139 static const zend_ffi_type zend_ffi_type_uint16 = {.kind=ZEND_FFI_TYPE_UINT16, .size=2, .align=_Ali…
5140 static const zend_ffi_type zend_ffi_type_sint32 = {.kind=ZEND_FFI_TYPE_SINT32, .size=4, .align=_Ali…
5141 static const zend_ffi_type zend_ffi_type_uint32 = {.kind=ZEND_FFI_TYPE_UINT32, .size=4, .align=_Ali…
5142 static const zend_ffi_type zend_ffi_type_sint64 = {.kind=ZEND_FFI_TYPE_SINT64, .size=8, .align=_Ali…
5143 static const zend_ffi_type zend_ffi_type_uint64 = {.kind=ZEND_FFI_TYPE_UINT64, .size=8, .align=_Ali…
5144 static const zend_ffi_type zend_ffi_type_float = {.kind=ZEND_FFI_TYPE_FLOAT, .size=sizeof(float), .…
5145 static const zend_ffi_type zend_ffi_type_double = {.kind=ZEND_FFI_TYPE_DOUBLE, .size=sizeof(double)…
5148 static const zend_ffi_type zend_ffi_type_long_double = {.kind=ZEND_FFI_TYPE_LONGDOUBLE, .size=sizeo…
5151 static const zend_ffi_type zend_ffi_type_ptr = {.kind=ZEND_FFI_TYPE_POINTER, .size=sizeof(void*), .…
5372 return (sym->kind == ZEND_FFI_SYM_TYPE);
5390 if (sym && sym->kind == ZEND_FFI_SYM_TYPE) {
5412 val->kind = ZEND_FFI_VAL_NAME;
5418 if (sym && sym->kind == ZEND_FFI_SYM_CONST) {
5420 switch (sym->type->kind) {
5424 val->kind = ZEND_FFI_VAL_INT32;
5427 val->kind = ZEND_FFI_VAL_INT64;
5432 val->kind = ZEND_FFI_VAL_UINT32;
5435 val->kind = ZEND_FFI_VAL_UINT64;
5443 val->kind = ZEND_FFI_VAL_ERROR;
5450 type->kind = ZEND_FFI_TYPE_ENUM;
5456 type->enumeration.kind = ZEND_FFI_TYPE_UINT8;
5460 type->enumeration.kind = ZEND_FFI_TYPE_UINT32;
5475 (enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT8 ||
5476 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT16 ||
5477 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT32 ||
5478 enum_type->enumeration.kind == ZEND_FFI_TYPE_SINT64);
5480 ZEND_ASSERT(enum_type && enum_type->kind == ZEND_FFI_TYPE_ENUM);
5481 if (val->kind == ZEND_FFI_VAL_EMPTY) {
5493 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
5502 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
5511 } else if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
5555 enum_type->enumeration.kind = sym_type->kind;
5569 sym->kind = ZEND_FFI_SYM_CONST;
5580 type->kind = ZEND_FFI_TYPE_STRUCT;
5635 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5680 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5683 if (field_type->kind != ZEND_FFI_TYPE_STRUCT) {
5747 ZEND_ASSERT(struct_type && struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5755 if (field_type->kind < ZEND_FFI_TYPE_UINT8 || field_type->kind > ZEND_FFI_TYPE_BOOL) {
5760 if (bits->kind == ZEND_FFI_VAL_INT32 || bits->kind == ZEND_FFI_VAL_INT64) {
5774 } else if (bits->kind == ZEND_FFI_VAL_UINT32 || bits->kind == ZEND_FFI_VAL_UINT64) {
5847 ZEND_ASSERT(struct_type->kind == ZEND_FFI_TYPE_STRUCT);
5861 type->kind = ZEND_FFI_TYPE_POINTER;
5880 if (type->kind == ZEND_FFI_TYPE_FUNC) {
5883 } else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
5900 if (len->kind == ZEND_FFI_VAL_EMPTY) {
5902 } else if (len->kind == ZEND_FFI_VAL_UINT32 || len->kind == ZEND_FFI_VAL_UINT64) {
5904 } else if (len->kind == ZEND_FFI_VAL_INT32 || len->kind == ZEND_FFI_VAL_INT64) {
5906 } else if (len->kind == ZEND_FFI_VAL_CHAR) {
5925 type->kind = ZEND_FFI_TYPE_ARRAY;
5940 if (type->kind == ZEND_FFI_TYPE_FUNC) {
5943 } else if (type->kind == ZEND_FFI_TYPE_ARRAY) {
5965 if (arg_type->kind == ZEND_FFI_TYPE_VOID) {
5993 …if (i >= 4 && i <= 5 && (arg_type->kind == ZEND_FFI_TYPE_FLOAT || arg_type->kind == ZEND_FFI_TYPE_…
5995 if (i < 6 && (arg_type->kind == ZEND_FFI_TYPE_FLOAT || arg_type->kind == ZEND_FFI_TYPE_DOUBLE)) {
6019 type->kind = ZEND_FFI_TYPE_FUNC;
6099 if (type->kind == ZEND_FFI_TYPE_ARRAY) {
6101 type->kind = ZEND_FFI_TYPE_POINTER;
6105 new_type->kind = ZEND_FFI_TYPE_POINTER;
6112 } else if (type->kind == ZEND_FFI_TYPE_FUNC) {
6114 new_type->kind = ZEND_FFI_TYPE_POINTER;
6144 && sym->kind == ZEND_FFI_SYM_TYPE
6154 if (type->kind == ZEND_FFI_TYPE_FUNC) {
6155 if (sym->kind == ZEND_FFI_SYM_FUNC
6162 if (sym->kind == ZEND_FFI_SYM_VAR
6191 sym->kind = ZEND_FFI_SYM_TYPE;
6207 sym->kind = (type->kind == ZEND_FFI_TYPE_FUNC) ? ZEND_FFI_SYM_FUNC : ZEND_FFI_SYM_VAR;
6235 if (tag->kind != ZEND_FFI_TAG_STRUCT) {
6243 if (tag->kind != ZEND_FFI_TAG_UNION) {
6251 if (tag->kind != ZEND_FFI_TAG_ENUM) {
6271 tag->kind = ZEND_FFI_TAG_STRUCT;
6276 tag->kind = ZEND_FFI_TAG_UNION;
6281 tag->kind = ZEND_FFI_TAG_ENUM;
6449 …&& (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_V…
6458 …&& (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_V…
6467 && (val->kind == ZEND_FFI_VAL_NAME)) {
6534 …if ((val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_…
6549 switch (nested_type->kind) {
6615 switch (align_val->kind) {
6646 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6647 val->kind = ZEND_FFI_VAL_INT32; \
6649 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6650 val->kind = ZEND_FFI_VAL_INT32; \
6652 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6653 val->kind = ZEND_FFI_VAL_INT32; \
6655 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6656 val->kind = ZEND_FFI_VAL_INT32; \
6659 val->kind = ZEND_FFI_VAL_ERROR; \
6664 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6665 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6666 val->kind = MAX(val->kind, op2->kind); \
6668 } else if (op2->kind == ZEND_FFI_VAL_INT32) { \
6670 } else if (op2->kind == ZEND_FFI_VAL_INT64) { \
6672 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6673 val->kind = op2->kind; \
6675 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6678 val->kind = ZEND_FFI_VAL_ERROR; \
6680 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6681 if (op2->kind == ZEND_FFI_VAL_UINT32) { \
6683 } else if (op2->kind == ZEND_FFI_VAL_UINT64) { \
6685 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6686 val->kind = MAX(val->kind, op2->kind); \
6688 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6689 val->kind = op2->kind; \
6691 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6694 val->kind = ZEND_FFI_VAL_ERROR; \
6696 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6697 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6699 } else if (op2->kind == ZEND_FFI_VAL_INT32 ||op2->kind == ZEND_FFI_VAL_INT64) { \
6701 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6702 val->kind = MAX(val->kind, op2->kind); \
6704 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6707 val->kind = ZEND_FFI_VAL_ERROR; \
6709 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6710 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6711 val->kind = op2->kind; \
6713 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6714 val->kind = ZEND_FFI_VAL_INT64; \
6716 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6717 val->kind = op2->kind; \
6719 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6722 val->kind = ZEND_FFI_VAL_ERROR; \
6725 val->kind = ZEND_FFI_VAL_ERROR; \
6730 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6731 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6732 val->kind = MAX(val->kind, op2->kind); \
6734 } else if (op2->kind == ZEND_FFI_VAL_INT32) { \
6736 } else if (op2->kind == ZEND_FFI_VAL_INT64) { \
6738 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6740 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6743 val->kind = ZEND_FFI_VAL_ERROR; \
6745 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6746 if (op2->kind == ZEND_FFI_VAL_UINT32) { \
6748 } else if (op2->kind == ZEND_FFI_VAL_UINT64) { \
6750 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6751 val->kind = MAX(val->kind, op2->kind); \
6753 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6755 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6758 val->kind = ZEND_FFI_VAL_ERROR; \
6760 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6761 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6762 val->kind = op2->kind; \
6764 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6765 val->kind = op2->kind; \
6768 val->kind = ZEND_FFI_VAL_ERROR; \
6770 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6771 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6772 val->kind = op2->kind; \
6774 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6775 val->kind = op2->kind; \
6777 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6780 val->kind = ZEND_FFI_VAL_ERROR; \
6783 val->kind = ZEND_FFI_VAL_ERROR; \
6788 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) { \
6789 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6790 val->kind = ZEND_FFI_VAL_INT32; \
6792 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6793 val->kind = ZEND_FFI_VAL_INT32; \
6795 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6796 val->kind = ZEND_FFI_VAL_INT32; \
6798 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6799 val->kind = ZEND_FFI_VAL_INT32; \
6802 val->kind = ZEND_FFI_VAL_ERROR; \
6804 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) { \
6805 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6806 val->kind = ZEND_FFI_VAL_INT32; \
6808 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6809 val->kind = ZEND_FFI_VAL_INT32; \
6811 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6812 val->kind = ZEND_FFI_VAL_INT32; \
6814 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6815 val->kind = ZEND_FFI_VAL_INT32; \
6818 val->kind = ZEND_FFI_VAL_ERROR; \
6820 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
6821 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6822 val->kind = ZEND_FFI_VAL_INT32; \
6824 } else if (op2->kind == ZEND_FFI_VAL_INT32 ||op2->kind == ZEND_FFI_VAL_INT64) { \
6825 val->kind = ZEND_FFI_VAL_INT32; \
6827 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6828 val->kind = ZEND_FFI_VAL_INT32; \
6830 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6831 val->kind = ZEND_FFI_VAL_INT32; \
6834 val->kind = ZEND_FFI_VAL_ERROR; \
6836 } else if (val->kind == ZEND_FFI_VAL_CHAR) { \
6837 if (op2->kind == ZEND_FFI_VAL_UINT32 || op2->kind == ZEND_FFI_VAL_UINT64) { \
6838 val->kind = ZEND_FFI_VAL_INT32; \
6840 } else if (op2->kind == ZEND_FFI_VAL_INT32 || op2->kind == ZEND_FFI_VAL_INT64) { \
6841 val->kind = ZEND_FFI_VAL_INT32; \
6843 …} else if (op2->kind == ZEND_FFI_VAL_FLOAT || op2->kind == ZEND_FFI_VAL_DOUBLE || op2->kind == ZEN…
6844 val->kind = ZEND_FFI_VAL_INT32; \
6846 } else if (op2->kind == ZEND_FFI_VAL_CHAR) { \
6847 val->kind = ZEND_FFI_VAL_INT32; \
6850 val->kind = ZEND_FFI_VAL_ERROR; \
6853 val->kind = ZEND_FFI_VAL_ERROR; \
6860 if (val->kind == ZEND_FFI_VAL_INT32) {
6874 if (val->kind == ZEND_FFI_VAL_INT32 && op2->kind == ZEND_FFI_VAL_INT32) {
6877 val->kind = ZEND_FFI_VAL_ERROR;
6886 if (val->kind == ZEND_FFI_VAL_INT32 && op2->kind == ZEND_FFI_VAL_INT32) {
6889 val->kind = ZEND_FFI_VAL_ERROR;
6993 switch (ZEND_FFI_TYPE(dcl->type)->kind) {
6995 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
6996 val->kind = ZEND_FFI_VAL_FLOAT;
6998 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
6999 val->kind = ZEND_FFI_VAL_FLOAT;
7001 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7002 val->kind = ZEND_FFI_VAL_FLOAT;
7003 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7004 val->kind = ZEND_FFI_VAL_FLOAT;
7007 val->kind = ZEND_FFI_VAL_ERROR;
7011 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7012 val->kind = ZEND_FFI_VAL_DOUBLE;
7014 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7015 val->kind = ZEND_FFI_VAL_DOUBLE;
7017 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7018 val->kind = ZEND_FFI_VAL_DOUBLE;
7019 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7020 val->kind = ZEND_FFI_VAL_DOUBLE;
7023 val->kind = ZEND_FFI_VAL_ERROR;
7028 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7029 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7031 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7032 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7034 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7035 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7036 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7037 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7040 val->kind = ZEND_FFI_VAL_ERROR;
7048 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7049 val->kind = ZEND_FFI_VAL_UINT32;
7050 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7051 val->kind = ZEND_FFI_VAL_UINT32;
7053 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7054 val->kind = ZEND_FFI_VAL_UINT32;
7057 val->kind = ZEND_FFI_VAL_ERROR;
7063 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7064 val->kind = ZEND_FFI_VAL_INT32;
7065 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7066 val->kind = ZEND_FFI_VAL_INT32;
7068 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7069 val->kind = ZEND_FFI_VAL_INT32;
7072 val->kind = ZEND_FFI_VAL_ERROR;
7076 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7077 val->kind = ZEND_FFI_VAL_UINT64;
7078 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7079 val->kind = ZEND_FFI_VAL_UINT64;
7081 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7082 val->kind = ZEND_FFI_VAL_UINT64;
7085 val->kind = ZEND_FFI_VAL_ERROR;
7089 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7090 val->kind = ZEND_FFI_VAL_CHAR;
7092 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7093 val->kind = ZEND_FFI_VAL_CHAR;
7095 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7096 val->kind = ZEND_FFI_VAL_CHAR;
7098 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7100 val->kind = ZEND_FFI_VAL_ERROR;
7104 …if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_…
7105 val->kind = ZEND_FFI_VAL_UINT32;
7106 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7107 val->kind = ZEND_FFI_VAL_UINT32;
7109 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7110 val->kind = ZEND_FFI_VAL_UINT32;
7113 val->kind = ZEND_FFI_VAL_ERROR;
7117 val->kind = ZEND_FFI_VAL_ERROR;
7126 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7127 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7128 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7129 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7131 val->kind = ZEND_FFI_VAL_ERROR;
7138 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7140 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7142 …} else if (val->kind == ZEND_FFI_VAL_FLOAT || val->kind == ZEND_FFI_VAL_DOUBLE || val->kind == ZEN…
7144 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7147 val->kind = ZEND_FFI_VAL_ERROR;
7154 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_UINT64) {
7156 } else if (val->kind == ZEND_FFI_VAL_INT32 || val->kind == ZEND_FFI_VAL_INT64) {
7158 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7161 val->kind = ZEND_FFI_VAL_ERROR;
7169 if (val->kind == ZEND_FFI_VAL_INT32) {
7177 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_INT32) {
7178 val->kind = ZEND_FFI_VAL_UINT32;
7180 } else if (val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_VAL_INT64) {
7181 val->kind = ZEND_FFI_VAL_UINT32;
7183 } else if (val->kind == ZEND_FFI_VAL_FLOAT) {
7184 val->kind = ZEND_FFI_VAL_UINT32;
7186 } else if (val->kind == ZEND_FFI_VAL_DOUBLE) {
7187 val->kind = ZEND_FFI_VAL_UINT32;
7189 } else if (val->kind == ZEND_FFI_VAL_LONG_DOUBLE) {
7190 val->kind = ZEND_FFI_VAL_UINT32;
7196 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7197 val->kind = ZEND_FFI_VAL_UINT32;
7199 } else if (val->kind == ZEND_FFI_VAL_STRING) {
7202 val->kind = ZEND_FFI_VAL_ERROR;
7204 val->kind = ZEND_FFI_VAL_UINT32;
7208 val->kind = ZEND_FFI_VAL_ERROR;
7219 val->kind = (type->size > 0xffffffff) ? ZEND_FFI_VAL_UINT64 : ZEND_FFI_VAL_UINT32;
7227 if (val->kind == ZEND_FFI_VAL_UINT32 || val->kind == ZEND_FFI_VAL_INT32) {
7228 val->kind = ZEND_FFI_VAL_UINT32;
7230 } else if (val->kind == ZEND_FFI_VAL_UINT64 || val->kind == ZEND_FFI_VAL_INT64) {
7231 val->kind = ZEND_FFI_VAL_UINT32;
7233 } else if (val->kind == ZEND_FFI_VAL_FLOAT) {
7234 val->kind = ZEND_FFI_VAL_UINT32;
7236 } else if (val->kind == ZEND_FFI_VAL_DOUBLE) {
7237 val->kind = ZEND_FFI_VAL_UINT32;
7240 } else if (val->kind == ZEND_FFI_VAL_LONG_DOUBLE) {
7241 val->kind = ZEND_FFI_VAL_UINT32;
7244 } else if (val->kind == ZEND_FFI_VAL_CHAR) {
7245 val->kind = ZEND_FFI_VAL_UINT32;
7247 } else if (val->kind == ZEND_FFI_VAL_STRING) {
7248 val->kind = ZEND_FFI_VAL_UINT32;
7251 val->kind = ZEND_FFI_VAL_ERROR;
7259 val->kind = ZEND_FFI_VAL_UINT32;
7292 val->kind = ZEND_FFI_VAL_UINT32;
7294 val->kind = (sizeof(long) == 4) ? ZEND_FFI_VAL_UINT32 : ZEND_FFI_VAL_UINT64;
7296 val->kind = ZEND_FFI_VAL_UINT64;
7301 val->kind = ZEND_FFI_VAL_INT32;
7303 val->kind = (sizeof(long) == 4) ? ZEND_FFI_VAL_INT32 : ZEND_FFI_VAL_INT64;
7305 val->kind = ZEND_FFI_VAL_INT64;
7315 val->kind = ZEND_FFI_VAL_FLOAT;
7317 val->kind = ZEND_FFI_VAL_LONG_DOUBLE;
7319 val->kind = ZEND_FFI_VAL_DOUBLE;
7327 val->kind = ZEND_FFI_VAL_ERROR;
7329 val->kind = ZEND_FFI_VAL_STRING;
7341 val->kind = ZEND_FFI_VAL_ERROR;
7343 val->kind = ZEND_FFI_VAL_CHAR;
7367 val->kind = ZEND_FFI_VAL_ERROR;
7370 val->kind = ZEND_FFI_VAL_ERROR;
7375 val->kind = ZEND_FFI_VAL_ERROR;
7385 val->kind = ZEND_FFI_VAL_ERROR;
7395 val->kind = ZEND_FFI_VAL_ERROR;
7402 val->kind = ZEND_FFI_VAL_ERROR;
7405 val->kind = ZEND_FFI_VAL_ERROR;