diff --git a/ext/pocketmine/math/axisalignedbb.zep.c b/ext/pocketmine/math/axisalignedbb.zep.c index a3d815e..db7314a 100644 --- a/ext/pocketmine/math/axisalignedbb.zep.c +++ b/ext/pocketmine/math/axisalignedbb.zep.c @@ -162,7 +162,7 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, setBB) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *bb, bb_sub, _0, _1, _2, _3, _4, _5; + zval *bb, bb_sub, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11; zval *this_ptr = getThis(); ZVAL_UNDEF(&bb_sub); @@ -172,19 +172,37 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, setBB) { ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &bb); - zephir_read_property(&_0, bb, SL("minX"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_1, bb, SL("minY"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_2, bb, SL("minZ"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_3, bb, SL("maxX"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_4, bb, SL("maxY"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_5, bb, SL("maxZ"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setbounds", NULL, 0, &_0, &_1, &_2, &_3, &_4, &_5); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, bb, SL("minX"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, bb, SL("minY"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_2); + zephir_read_property(&_2, bb, SL("minZ"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_3); + zephir_read_property(&_3, bb, SL("maxX"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_4); + zephir_read_property(&_4, bb, SL("maxY"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, bb, SL("maxZ"), PH_NOISY_CC); + ZVAL_DOUBLE(&_6, zephir_get_doubleval(&_0)); + ZVAL_DOUBLE(&_7, zephir_get_doubleval(&_1)); + ZVAL_DOUBLE(&_8, zephir_get_doubleval(&_2)); + ZVAL_DOUBLE(&_9, zephir_get_doubleval(&_3)); + ZVAL_DOUBLE(&_10, zephir_get_doubleval(&_4)); + ZVAL_DOUBLE(&_11, zephir_get_doubleval(&_5)); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "setbounds", NULL, 0, &_6, &_7, &_8, &_9, &_10, &_11); zephir_check_call_status(); RETURN_MM(); @@ -1531,12 +1549,12 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, isVectorInXY) { */ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, calculateIntercept) { - zval _21; - zend_bool _6, _9, _11, _14, _16, _19; + zval _22; + zend_bool _7, _10, _12, _15, _17, _20; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_8 = NULL, *_13 = NULL, *_18 = NULL, *_24 = NULL; + zephir_fcall_cache_entry *_9 = NULL, *_14 = NULL, *_19 = NULL, *_25 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pos1, pos1_sub, *pos2, pos2_sub, f, d, distance, vector, v6, v5, v4, v3, v2, v1, _0, _1, _2, _3, _4, _5, _7, _10, _12, _15, _17, _20, v, *_22, _23; + zval *pos1, pos1_sub, *pos2, pos2_sub, f, d, distance, vector, v6, v5, v4, v3, v2, v1, _0, _1, _2, _3, _4, _5, _6, _8, _11, _13, _16, _18, _21, v, *_23, _24; zval *this_ptr = getThis(); ZVAL_UNDEF(&pos1_sub); @@ -1557,96 +1575,109 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, calculateIntercept) { ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_7); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_12); - ZVAL_UNDEF(&_15); - ZVAL_UNDEF(&_17); - ZVAL_UNDEF(&_20); - ZVAL_UNDEF(&v); - ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_18); ZVAL_UNDEF(&_21); + ZVAL_UNDEF(&v); + ZVAL_UNDEF(&_24); + ZVAL_UNDEF(&_22); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &pos1, &pos2); - zephir_read_property(&_0, this_ptr, SL("minX"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&v1, pos1, "getintermediatewithxvalue", NULL, 0, pos2, &_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("minX"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_0)); + ZEPHIR_CALL_METHOD(&v1, pos1, "getintermediatewithxvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - zephir_read_property(&_1, this_ptr, SL("maxX"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_VAR(&_2); + zephir_read_property(&_2, this_ptr, SL("maxX"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_2)); ZEPHIR_CALL_METHOD(&v2, pos1, "getintermediatewithxvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - zephir_read_property(&_2, this_ptr, SL("minY"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&v3, pos1, "getintermediatewithyvalue", NULL, 0, pos2, &_2); + ZEPHIR_OBS_VAR(&_3); + zephir_read_property(&_3, this_ptr, SL("minY"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_3)); + ZEPHIR_CALL_METHOD(&v3, pos1, "getintermediatewithyvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - zephir_read_property(&_3, this_ptr, SL("maxY"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&v4, pos1, "getintermediatewithyvalue", NULL, 0, pos2, &_3); + ZEPHIR_OBS_VAR(&_4); + zephir_read_property(&_4, this_ptr, SL("maxY"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_4)); + ZEPHIR_CALL_METHOD(&v4, pos1, "getintermediatewithyvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - zephir_read_property(&_4, this_ptr, SL("minZ"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&v5, pos1, "getintermediatewithzvalue", NULL, 0, pos2, &_4); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, this_ptr, SL("minZ"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_5)); + ZEPHIR_CALL_METHOD(&v5, pos1, "getintermediatewithzvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - zephir_read_property(&_5, this_ptr, SL("maxZ"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&v6, pos1, "getintermediatewithzvalue", NULL, 0, pos2, &_5); + ZEPHIR_OBS_VAR(&_6); + zephir_read_property(&_6, this_ptr, SL("maxZ"), PH_NOISY_CC); + ZVAL_DOUBLE(&_1, zephir_get_doubleval(&_6)); + ZEPHIR_CALL_METHOD(&v6, pos1, "getintermediatewithzvalue", NULL, 0, pos2, &_1); zephir_check_call_status(); - _6 = Z_TYPE_P(&v1) != IS_NULL; - if (_6) { - ZEPHIR_CALL_METHOD(&_7, this_ptr, "isvectorinyz", &_8, 0, &v1); + _7 = Z_TYPE_P(&v1) != IS_NULL; + if (_7) { + ZEPHIR_CALL_METHOD(&_8, this_ptr, "isvectorinyz", &_9, 0, &v1); zephir_check_call_status(); - _6 = !zephir_is_true(&_7); + _7 = !zephir_is_true(&_8); } - if (_6) { + if (_7) { ZEPHIR_INIT_NVAR(&v1); ZVAL_NULL(&v1); } - _9 = Z_TYPE_P(&v2) != IS_NULL; - if (_9) { - ZEPHIR_CALL_METHOD(&_10, this_ptr, "isvectorinyz", &_8, 0, &v2); + _10 = Z_TYPE_P(&v2) != IS_NULL; + if (_10) { + ZEPHIR_CALL_METHOD(&_11, this_ptr, "isvectorinyz", &_9, 0, &v2); zephir_check_call_status(); - _9 = !zephir_is_true(&_10); + _10 = !zephir_is_true(&_11); } - if (_9) { + if (_10) { ZEPHIR_INIT_NVAR(&v2); ZVAL_NULL(&v2); } - _11 = Z_TYPE_P(&v3) != IS_NULL; - if (_11) { - ZEPHIR_CALL_METHOD(&_12, this_ptr, "isvectorinxz", &_13, 0, &v3); + _12 = Z_TYPE_P(&v3) != IS_NULL; + if (_12) { + ZEPHIR_CALL_METHOD(&_13, this_ptr, "isvectorinxz", &_14, 0, &v3); zephir_check_call_status(); - _11 = !zephir_is_true(&_12); + _12 = !zephir_is_true(&_13); } - if (_11) { + if (_12) { ZEPHIR_INIT_NVAR(&v3); ZVAL_NULL(&v3); } - _14 = Z_TYPE_P(&v4) != IS_NULL; - if (_14) { - ZEPHIR_CALL_METHOD(&_15, this_ptr, "isvectorinxz", &_13, 0, &v4); + _15 = Z_TYPE_P(&v4) != IS_NULL; + if (_15) { + ZEPHIR_CALL_METHOD(&_16, this_ptr, "isvectorinxz", &_14, 0, &v4); zephir_check_call_status(); - _14 = !zephir_is_true(&_15); + _15 = !zephir_is_true(&_16); } - if (_14) { + if (_15) { ZEPHIR_INIT_NVAR(&v4); ZVAL_NULL(&v4); } - _16 = Z_TYPE_P(&v5) != IS_NULL; - if (_16) { - ZEPHIR_CALL_METHOD(&_17, this_ptr, "isvectorinxy", &_18, 0, &v5); + _17 = Z_TYPE_P(&v5) != IS_NULL; + if (_17) { + ZEPHIR_CALL_METHOD(&_18, this_ptr, "isvectorinxy", &_19, 0, &v5); zephir_check_call_status(); - _16 = !zephir_is_true(&_17); + _17 = !zephir_is_true(&_18); } - if (_16) { + if (_17) { ZEPHIR_INIT_NVAR(&v5); ZVAL_NULL(&v5); } - _19 = Z_TYPE_P(&v6) != IS_NULL; - if (_19) { - ZEPHIR_CALL_METHOD(&_20, this_ptr, "isvectorinxy", &_18, 0, &v6); + _20 = Z_TYPE_P(&v6) != IS_NULL; + if (_20) { + ZEPHIR_CALL_METHOD(&_21, this_ptr, "isvectorinxy", &_19, 0, &v6); zephir_check_call_status(); - _19 = !zephir_is_true(&_20); + _20 = !zephir_is_true(&_21); } - if (_19) { + if (_20) { ZEPHIR_INIT_NVAR(&v6); ZVAL_NULL(&v6); } @@ -1654,22 +1685,22 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, calculateIntercept) { ZVAL_NULL(&vector); ZEPHIR_INIT_VAR(&distance); ZEPHIR_MM_GET_CONSTANT(&distance, "PHP_INT_MAX"); - ZEPHIR_INIT_VAR(&_21); - zephir_create_array(&_21, 6, 0 TSRMLS_CC); - zephir_array_fast_append(&_21, &v1); - zephir_array_fast_append(&_21, &v2); - zephir_array_fast_append(&_21, &v3); - zephir_array_fast_append(&_21, &v4); - zephir_array_fast_append(&_21, &v5); - zephir_array_fast_append(&_21, &v6); - zephir_is_iterable(&_21, 0, "pocketmine/math/axisalignedbb.zep", 575); - if (Z_TYPE_P(&_21) == IS_ARRAY) { - ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_21), _22) + ZEPHIR_INIT_VAR(&_22); + zephir_create_array(&_22, 6, 0 TSRMLS_CC); + zephir_array_fast_append(&_22, &v1); + zephir_array_fast_append(&_22, &v2); + zephir_array_fast_append(&_22, &v3); + zephir_array_fast_append(&_22, &v4); + zephir_array_fast_append(&_22, &v5); + zephir_array_fast_append(&_22, &v6); + zephir_is_iterable(&_22, 0, "pocketmine/math/axisalignedbb.zep", 575); + if (Z_TYPE_P(&_22) == IS_ARRAY) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_22), _23) { ZEPHIR_INIT_NVAR(&v); - ZVAL_COPY(&v, _22); + ZVAL_COPY(&v, _23); if (Z_TYPE_P(&v) != IS_NULL) { - ZEPHIR_CALL_METHOD(&d, pos1, "distancesquared", &_24, 0, &v); + ZEPHIR_CALL_METHOD(&d, pos1, "distancesquared", &_25, 0, &v); zephir_check_call_status(); if (ZEPHIR_LT(&d, &distance)) { ZEPHIR_CPY_WRT(&vector, &v); @@ -1678,25 +1709,25 @@ PHP_METHOD(Pocketmine_Math_AxisAlignedBB, calculateIntercept) { } } ZEND_HASH_FOREACH_END(); } else { - ZEPHIR_CALL_METHOD(NULL, &_21, "rewind", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &_22, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_23, &_21, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_24, &_22, "valid", NULL, 0); zephir_check_call_status(); - if (!zend_is_true(&_23)) { + if (!zend_is_true(&_24)) { break; } - ZEPHIR_CALL_METHOD(&v, &_21, "current", NULL, 0); + ZEPHIR_CALL_METHOD(&v, &_22, "current", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(&v) != IS_NULL) { - ZEPHIR_CALL_METHOD(&d, pos1, "distancesquared", &_24, 0, &v); + ZEPHIR_CALL_METHOD(&d, pos1, "distancesquared", &_25, 0, &v); zephir_check_call_status(); if (ZEPHIR_LT(&d, &distance)) { ZEPHIR_CPY_WRT(&vector, &v); ZEPHIR_CPY_WRT(&distance, &d); } } - ZEPHIR_CALL_METHOD(NULL, &_21, "next", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &_22, "next", NULL, 0); zephir_check_call_status(); } } diff --git a/ext/pocketmine/math/vector2.zep.c b/ext/pocketmine/math/vector2.zep.c index 0d17b18..30681f7 100644 --- a/ext/pocketmine/math/vector2.zep.c +++ b/ext/pocketmine/math/vector2.zep.c @@ -139,16 +139,18 @@ PHP_METHOD(Pocketmine_Math_Vector2, add) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; double y; - zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$4, _3$$4, _4$$4, _5$$4; + zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4, _7$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &x, &y_param); @@ -161,18 +163,22 @@ PHP_METHOD(Pocketmine_Math_Vector2, add) { if (zephir_instance_of_ev(x, pocketmine_math_vector2_ce TSRMLS_CC)) { - zephir_read_property(&_0$$3, x, SL("x"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_1$$3, x, SL("y"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 7, &_0$$3, &_1$$3); + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, x, SL("x"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_1$$3); + zephir_read_property(&_1$$3, x, SL("y"), PH_NOISY_CC); + ZVAL_DOUBLE(&_2$$3, zephir_get_doubleval(&_0$$3)); + ZVAL_DOUBLE(&_3$$3, zephir_get_doubleval(&_1$$3)); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 7, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } else { object_init_ex(return_value, pocketmine_math_vector2_ce); - zephir_read_property(&_2$$4, this_ptr, SL("x"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_3$$4, this_ptr, SL("y"), PH_NOISY_CC | PH_READONLY); - ZVAL_DOUBLE(&_4$$4, (zephir_get_numberval(&_2$$4) + zephir_get_doubleval(x))); - ZVAL_DOUBLE(&_5$$4, (zephir_get_numberval(&_3$$4) + (double) (y))); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, &_4$$4, &_5$$4); + zephir_read_property(&_4$$4, this_ptr, SL("x"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_5$$4, this_ptr, SL("y"), PH_NOISY_CC | PH_READONLY); + ZVAL_DOUBLE(&_6$$4, (zephir_get_numberval(&_4$$4) + zephir_get_doubleval(x))); + ZVAL_DOUBLE(&_7$$4, (zephir_get_numberval(&_5$$4) + (double) (y))); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, &_6$$4, &_7$$4); zephir_check_call_status(); RETURN_MM(); } @@ -188,16 +194,18 @@ PHP_METHOD(Pocketmine_Math_Vector2, add) { PHP_METHOD(Pocketmine_Math_Vector2, subtract) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_2 = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; double y; - zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _3$$4; + zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$3, _3$$3, _5$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_5$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &x, &y_param); @@ -216,13 +224,15 @@ PHP_METHOD(Pocketmine_Math_Vector2, subtract) { ZEPHIR_OBS_VAR(&_1$$3); zephir_read_property(&_1$$3, x, SL("y"), PH_NOISY_CC); zephir_negate(&_1$$3 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", &_2, 0, &_0$$3, &_1$$3); + ZVAL_DOUBLE(&_2$$3, zephir_get_doubleval(&_0$$3)); + ZVAL_DOUBLE(&_3$$3, zephir_get_doubleval(&_1$$3)); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", &_4, 0, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } else { zephir_negate(x TSRMLS_CC); - ZVAL_DOUBLE(&_3$$4, -y); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", &_2, 7, x, &_3$$4); + ZVAL_DOUBLE(&_5$$4, -y); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", &_4, 7, x, &_5$$4); zephir_check_call_status(); RETURN_MM(); } @@ -308,7 +318,7 @@ PHP_METHOD(Pocketmine_Math_Vector2, round) { PHP_METHOD(Pocketmine_Math_Vector2, abs) { - zval _0, _1, _3, _4; + zval _0, _1, _3, _4, _5, _6; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL; @@ -318,6 +328,8 @@ PHP_METHOD(Pocketmine_Math_Vector2, abs) { ZVAL_UNDEF(&_1); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); @@ -328,7 +340,9 @@ PHP_METHOD(Pocketmine_Math_Vector2, abs) { zephir_read_property(&_3, this_ptr, SL("y"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_FUNCTION(&_4, "abs", &_2, 9, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, &_1, &_4); + ZVAL_DOUBLE(&_5, zephir_get_doubleval(&_1)); + ZVAL_DOUBLE(&_6, zephir_get_doubleval(&_4)); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, &_5, &_6); zephir_check_call_status(); RETURN_MM(); @@ -403,18 +417,20 @@ PHP_METHOD(Pocketmine_Math_Vector2, divide) { PHP_METHOD(Pocketmine_Math_Vector2, distance) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_3 = NULL; + zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; double y; - zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$3, _4$$4, _5$$4; + zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _6$$4, _7$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); ZVAL_UNDEF(&_2$$3); - ZVAL_UNDEF(&_4$$4); - ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &x, &y_param); @@ -427,16 +443,20 @@ PHP_METHOD(Pocketmine_Math_Vector2, distance) { if (zephir_instance_of_ev(x, pocketmine_math_vector2_ce TSRMLS_CC)) { - zephir_read_property(&_1$$3, x, SL("x"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_2$$3, x, SL("y"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "distancesquared", &_3, 0, &_1$$3, &_2$$3); + ZEPHIR_OBS_VAR(&_1$$3); + zephir_read_property(&_1$$3, x, SL("x"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_2$$3); + zephir_read_property(&_2$$3, x, SL("y"), PH_NOISY_CC); + ZVAL_DOUBLE(&_3$$3, zephir_get_doubleval(&_1$$3)); + ZVAL_DOUBLE(&_4$$3, zephir_get_doubleval(&_2$$3)); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "distancesquared", &_5, 0, &_3$$3, &_4$$3); zephir_check_call_status(); RETURN_MM_DOUBLE(zephir_sqrt(&_0$$3 TSRMLS_CC)); } else { - ZVAL_DOUBLE(&_5$$4, y); - ZEPHIR_CALL_METHOD(&_4$$4, this_ptr, "distancesquared", &_3, 0, x, &_5$$4); + ZVAL_DOUBLE(&_7$$4, y); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "distancesquared", &_5, 0, x, &_7$$4); zephir_check_call_status(); - RETURN_MM_DOUBLE(zephir_sqrt(&_4$$4 TSRMLS_CC)); + RETURN_MM_DOUBLE(zephir_sqrt(&_6$$4 TSRMLS_CC)); } } @@ -452,20 +472,22 @@ PHP_METHOD(Pocketmine_Math_Vector2, distanceSquared) { zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; double y; - zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$4, _3$$4, _4$$4, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4; + zval *x, x_sub, *y_param = NULL, _0$$3, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4, _10$$4, _11$$4; zval *this_ptr = getThis(); ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&_0$$3); ZVAL_UNDEF(&_1$$3); - ZVAL_UNDEF(&_2$$4); - ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_5$$4); ZVAL_UNDEF(&_6$$4); ZVAL_UNDEF(&_7$$4); ZVAL_UNDEF(&_8$$4); ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_10$$4); + ZVAL_UNDEF(&_11$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &x, &y_param); @@ -478,23 +500,27 @@ PHP_METHOD(Pocketmine_Math_Vector2, distanceSquared) { if (zephir_instance_of_ev(x, pocketmine_math_vector2_ce TSRMLS_CC)) { - zephir_read_property(&_0$$3, x, SL("x"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_1$$3, x, SL("y"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "distancesquared", NULL, 10, &_0$$3, &_1$$3); + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, x, SL("x"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_1$$3); + zephir_read_property(&_1$$3, x, SL("y"), PH_NOISY_CC); + ZVAL_DOUBLE(&_2$$3, zephir_get_doubleval(&_0$$3)); + ZVAL_DOUBLE(&_3$$3, zephir_get_doubleval(&_1$$3)); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "distancesquared", NULL, 10, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } else { - ZEPHIR_INIT_VAR(&_2$$4); - zephir_read_property(&_3$$4, this_ptr, SL("x"), PH_NOISY_CC | PH_READONLY); - ZVAL_DOUBLE(&_4$$4, (zephir_get_numberval(&_3$$4) - zephir_get_doubleval(x))); - ZVAL_LONG(&_5$$4, 2); - zephir_pow_function(&_2$$4, &_4$$4, &_5$$4); - ZEPHIR_INIT_VAR(&_6$$4); - zephir_read_property(&_7$$4, this_ptr, SL("y"), PH_NOISY_CC | PH_READONLY); - ZVAL_DOUBLE(&_8$$4, (zephir_get_numberval(&_7$$4) - (double) (y))); - ZVAL_LONG(&_9$$4, 2); - zephir_pow_function(&_6$$4, &_8$$4, &_9$$4); - zephir_add_function(return_value, &_2$$4, &_6$$4); + ZEPHIR_INIT_VAR(&_4$$4); + zephir_read_property(&_5$$4, this_ptr, SL("x"), PH_NOISY_CC | PH_READONLY); + ZVAL_DOUBLE(&_6$$4, (zephir_get_numberval(&_5$$4) - zephir_get_doubleval(x))); + ZVAL_LONG(&_7$$4, 2); + zephir_pow_function(&_4$$4, &_6$$4, &_7$$4); + ZEPHIR_INIT_VAR(&_8$$4); + zephir_read_property(&_9$$4, this_ptr, SL("y"), PH_NOISY_CC | PH_READONLY); + ZVAL_DOUBLE(&_10$$4, (zephir_get_numberval(&_9$$4) - (double) (y))); + ZVAL_LONG(&_11$$4, 2); + zephir_pow_function(&_8$$4, &_10$$4, &_11$$4); + zephir_add_function(return_value, &_4$$4, &_8$$4); RETURN_MM(); } diff --git a/ext/pocketmine/math/vector3.zep.c b/ext/pocketmine/math/vector3.zep.c index f89a367..68d3f45 100644 --- a/ext/pocketmine/math/vector3.zep.c +++ b/ext/pocketmine/math/vector3.zep.c @@ -41,13 +41,13 @@ ZEPHIR_INIT_CLASS(Pocketmine_Math_Vector3) { ZEPHIR_REGISTER_CLASS(Pocketmine\\Math, Vector3, pocketmine, math_vector3, pocketmine_math_vector3_method_entry, 0); /** @var float|int */ - zend_declare_property_null(pocketmine_math_vector3_ce, SL("x"), ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_double(pocketmine_math_vector3_ce, SL("x"), 0.0, ZEND_ACC_PUBLIC TSRMLS_CC); /** @var float|int */ - zend_declare_property_null(pocketmine_math_vector3_ce, SL("y"), ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_double(pocketmine_math_vector3_ce, SL("y"), 0.0, ZEND_ACC_PUBLIC TSRMLS_CC); /** @var float|int */ - zend_declare_property_null(pocketmine_math_vector3_ce, SL("z"), ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_double(pocketmine_math_vector3_ce, SL("z"), 0.0, ZEND_ACC_PUBLIC TSRMLS_CC); return SUCCESS; diff --git a/ext/pocketmine/math/voxelraytrace.zep.c b/ext/pocketmine/math/voxelraytrace.zep.c index d06a198..8d62670 100644 --- a/ext/pocketmine/math/voxelraytrace.zep.c +++ b/ext/pocketmine/math/voxelraytrace.zep.c @@ -125,11 +125,11 @@ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, spaceShip) { */ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, betweenPoints) { - zend_bool _16$$4; + zend_bool _17$$4; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; - zephir_fcall_cache_entry *_6 = NULL; + zephir_fcall_cache_entry *_2 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, counter; - zval *start, start_sub, *end, end_sub, tDeltaZ, tDeltaY, tDeltaX, tMaxZ, tMaxY, tMaxX, stepZ, stepY, stepX, radius, directionVector, currentBlock, _0, _1, _2, _3, _4, _5, _7, _8, _9, _10, _11, _12, _13, _14, _15, temp; + zval *start, start_sub, *end, end_sub, tDeltaZ, tDeltaY, tDeltaX, tMaxZ, tMaxY, tMaxX, stepZ, stepY, stepX, radius, directionVector, currentBlock, _0, _1, _3, _4, _5, _6, _8, _9, _10, _11, _12, _13, _14, _15, _16, temp; zval *this_ptr = getThis(); ZVAL_UNDEF(&start_sub); @@ -148,11 +148,10 @@ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, betweenPoints) { ZVAL_UNDEF(¤tBlock); ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_4); ZVAL_UNDEF(&_5); - ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_6); ZVAL_UNDEF(&_8); ZVAL_UNDEF(&_9); ZVAL_UNDEF(&_10); @@ -161,6 +160,7 @@ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, betweenPoints) { ZVAL_UNDEF(&_13); ZVAL_UNDEF(&_14); ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_16); ZVAL_UNDEF(&temp); ZEPHIR_MM_GROW(); @@ -182,56 +182,56 @@ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, betweenPoints) { } ZEPHIR_CALL_METHOD(&radius, start, "distance", NULL, 0, end); zephir_check_call_status(); - zephir_read_property(&_2, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); - ZVAL_LONG(&_3, 0); - ZEPHIR_CALL_FUNCTION(&stepX, "spaceship", NULL, 0, &_2, &_3); - zephir_check_call_status(); - zephir_read_property(&_3, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_4, 0); - ZEPHIR_CALL_FUNCTION(&stepY, "spaceship", NULL, 0, &_3, &_4); + ZEPHIR_CALL_SELF(&stepX, "spaceship", &_2, 16, &_3, &_4); zephir_check_call_status(); - zephir_read_property(&_4, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_5, 0); - ZEPHIR_CALL_FUNCTION(&stepZ, "spaceship", NULL, 0, &_4, &_5); + ZEPHIR_CALL_SELF(&stepY, "spaceship", &_2, 16, &_4, &_5); zephir_check_call_status(); - zephir_read_property(&_5, start, SL("x"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_7, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_SELF(&tMaxX, "raytracedistancetoboundary", &_6, 16, &_5, &_7); + zephir_read_property(&_5, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_6, 0); + ZEPHIR_CALL_SELF(&stepZ, "spaceship", &_2, 16, &_5, &_6); zephir_check_call_status(); - zephir_read_property(&_8, start, SL("y"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_9, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_SELF(&tMaxY, "raytracedistancetoboundary", &_6, 16, &_8, &_9); + zephir_read_property(&_6, start, SL("x"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_8, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_SELF(&tMaxX, "raytracedistancetoboundary", &_7, 17, &_6, &_8); zephir_check_call_status(); - zephir_read_property(&_10, start, SL("z"), PH_NOISY_CC | PH_READONLY); - zephir_read_property(&_11, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_SELF(&tMaxZ, "raytracedistancetoboundary", &_6, 16, &_10, &_11); + zephir_read_property(&_9, start, SL("y"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_10, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_SELF(&tMaxY, "raytracedistancetoboundary", &_7, 17, &_9, &_10); zephir_check_call_status(); - zephir_read_property(&_12, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); - if (ZEPHIR_IS_LONG(&_12, 0)) { + zephir_read_property(&_11, start, SL("z"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_12, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_SELF(&tMaxZ, "raytracedistancetoboundary", &_7, 17, &_11, &_12); + zephir_check_call_status(); + zephir_read_property(&_13, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_13, 0)) { ZEPHIR_INIT_VAR(&tDeltaX); ZVAL_LONG(&tDeltaX, 0); } else { - zephir_read_property(&_13, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_14, &directionVector, SL("x"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&tDeltaX); - div_function(&tDeltaX, &stepX, &_13 TSRMLS_CC); + div_function(&tDeltaX, &stepX, &_14 TSRMLS_CC); } - zephir_read_property(&_13, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); - if (ZEPHIR_IS_LONG(&_13, 0)) { + zephir_read_property(&_14, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_14, 0)) { ZEPHIR_INIT_VAR(&tDeltaY); ZVAL_LONG(&tDeltaY, 0); } else { - zephir_read_property(&_14, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_15, &directionVector, SL("y"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&tDeltaY); - div_function(&tDeltaY, &stepY, &_14 TSRMLS_CC); + div_function(&tDeltaY, &stepY, &_15 TSRMLS_CC); } - zephir_read_property(&_14, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); - if (ZEPHIR_IS_LONG(&_14, 0)) { + zephir_read_property(&_15, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_15, 0)) { ZEPHIR_INIT_VAR(&tDeltaZ); ZVAL_LONG(&tDeltaZ, 0); } else { - zephir_read_property(&_15, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_16, &directionVector, SL("z"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_NVAR(&tDeltaZ); - div_function(&tDeltaZ, &stepZ, &_15 TSRMLS_CC); + div_function(&tDeltaZ, &stepZ, &_16 TSRMLS_CC); } ZEPHIR_INIT_VAR(&temp); array_init(&temp); @@ -242,11 +242,11 @@ PHP_METHOD(Pocketmine_Math_VoxelRayTrace, betweenPoints) { } counter++; zephir_array_update_long(&temp, counter, ¤tBlock, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - _16$$4 = ZEPHIR_LT(&tMaxX, &tMaxY); - if (_16$$4) { - _16$$4 = ZEPHIR_LT(&tMaxX, &tMaxZ); + _17$$4 = ZEPHIR_LT(&tMaxX, &tMaxY); + if (_17$$4) { + _17$$4 = ZEPHIR_LT(&tMaxX, &tMaxZ); } - if (_16$$4) { + if (_17$$4) { if (ZEPHIR_GT(&tMaxX, &radius)) { break; } diff --git a/ext/pocketmine/utils/binary.zep.c b/ext/pocketmine/utils/binary.zep.c index 1e42c46..3abdd2a 100644 --- a/ext/pocketmine/utils/binary.zep.c +++ b/ext/pocketmine/utils/binary.zep.c @@ -21,6 +21,7 @@ #include "kernel/string.h" #include "kernel/math.h" #include "kernel/exception.h" +#include "ext/spl/spl_exceptions.h" /** @@ -310,7 +311,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readByte) { _0 = ZEPHIR_STRING_OFFSET(&c, 0); ZEPHIR_INIT_VAR(&_1); ZVAL_STRINGL(&_1, &_0, 1); - ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 17, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 18, &_1); zephir_check_call_status(); RETURN_MM(); @@ -345,7 +346,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readSignedByte) { _0 = ZEPHIR_STRING_OFFSET(&c, 0); ZEPHIR_INIT_VAR(&_1); ZVAL_STRINGL(&_1, &_0, 1); - ZEPHIR_CALL_FUNCTION(&_2, "ord", NULL, 17, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "ord", NULL, 18, &_1); zephir_check_call_status(); ZEPHIR_RETURN_CALL_SELF("signbyte", NULL, 0, &_2); zephir_check_call_status(); @@ -376,7 +377,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeByte) { ZVAL_LONG(&_0, c); - ZEPHIR_RETURN_CALL_FUNCTION("chr", NULL, 18, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("chr", NULL, 19, &_0); zephir_check_call_status(); RETURN_MM(); @@ -410,7 +411,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "n"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 146 TSRMLS_CC); RETURN_CTOR(&_2); @@ -445,7 +446,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readSignedShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "n"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 158 TSRMLS_CC); ZEPHIR_RETURN_CALL_SELF("signshort", NULL, 0, &_2); @@ -480,7 +481,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "n"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -514,7 +515,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "v"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 182 TSRMLS_CC); RETURN_CTOR(&_2); @@ -549,7 +550,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readSignedLShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "v"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 194 TSRMLS_CC); ZEPHIR_RETURN_CALL_SELF("signshort", NULL, 0, &_2); @@ -584,7 +585,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "v"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -621,7 +622,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readTriad) { ZEPHIR_CONCAT_SV(&_0, "\\0", &str); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "N"); - ZEPHIR_CALL_FUNCTION(&_2, "unpack", NULL, 19, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "unpack", NULL, 20, &_1, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_3, &_2, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 218 TSRMLS_CC); RETURN_CTOR(&_3); @@ -655,7 +656,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeTriad) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "N"); ZVAL_LONG(&_1, value); - ZEPHIR_CALL_FUNCTION(&_2, "pack", NULL, 20, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "pack", NULL, 21, &_0, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 1); zephir_substr(return_value, &_2, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); @@ -694,7 +695,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLTriad) { ZEPHIR_CONCAT_VS(&_0, &str, "\\0"); ZEPHIR_INIT_VAR(&_1); ZVAL_STRING(&_1, "V"); - ZEPHIR_CALL_FUNCTION(&_2, "unpack", NULL, 19, &_1, &_0); + ZEPHIR_CALL_FUNCTION(&_2, "unpack", NULL, 20, &_1, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_3, &_2, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 242 TSRMLS_CC); RETURN_CTOR(&_3); @@ -729,7 +730,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLTriad) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "V"); ZVAL_LONG(&_1, value); - ZEPHIR_CALL_FUNCTION(&_2, "pack", NULL, 20, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "pack", NULL, 21, &_0, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 0); ZVAL_LONG(&_3, -1); @@ -766,7 +767,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "N"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 266 TSRMLS_CC); ZEPHIR_RETURN_CALL_SELF("signint", NULL, 0, &_2); @@ -801,7 +802,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "N"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -835,7 +836,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "V"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 290 TSRMLS_CC); ZEPHIR_RETURN_CALL_SELF("signint", NULL, 0, &_2); @@ -870,7 +871,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "V"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -904,7 +905,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "G"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 314 TSRMLS_CC); RETURN_CTOR(&_2); @@ -973,7 +974,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "G"); ZVAL_DOUBLE(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1007,7 +1008,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "g"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 351 TSRMLS_CC); RETURN_CTOR(&_2); @@ -1076,7 +1077,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "g"); ZVAL_DOUBLE(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1111,13 +1112,13 @@ PHP_METHOD(Pocketmine_Utils_Binary, printFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "%F"); ZVAL_DOUBLE(&_1, value); - ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 21, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 22, &_0, &_1); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, "/(\\.\\d+?)0+\\$/"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "\\$1"); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 22, &_0, &_3, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 23, &_0, &_3, &_2); zephir_check_call_status(); RETURN_MM(); @@ -1151,7 +1152,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "E"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 400 TSRMLS_CC); RETURN_CTOR(&_2); @@ -1185,7 +1186,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "E"); ZVAL_DOUBLE(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1219,7 +1220,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "e"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 424 TSRMLS_CC); RETURN_CTOR(&_2); @@ -1253,7 +1254,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "e"); ZVAL_DOUBLE(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1287,7 +1288,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLong) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "J"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 448 TSRMLS_CC); RETURN_CTOR(&_2); @@ -1320,7 +1321,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLong) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "J"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1354,7 +1355,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readLLong) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "P"); - ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 19, &_0, &str); + ZEPHIR_CALL_FUNCTION(&_1, "unpack", NULL, 20, &_0, &str); zephir_check_call_status(); zephir_array_fetch_long(&_2, &_1, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 472 TSRMLS_CC); RETURN_CTOR(&_2); @@ -1387,7 +1388,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeLLong) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "P"); ZVAL_LONG(&_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 20, &_0, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("pack", NULL, 21, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1470,7 +1471,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readUnsignedVarInt) { return; } zephir_array_fetch_long(&_0$$3, buffer, offset, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 523 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&b$$3, "ord", &_1, 17, &_0$$3); + ZEPHIR_CALL_FUNCTION(&b$$3, "ord", &_1, 18, &_0$$3); zephir_check_call_status(); offset++; value = (value | (((((int) (zephir_get_numberval(&b$$3)) & 0x7f)) << i))); @@ -1525,18 +1526,15 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeVarInt) { */ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarInt) { - zend_class_entry *_10 = NULL; zend_bool _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_5 = NULL; - zval *value_param = NULL, i, buf, _9, _11, _3$$4, _4$$4, _6$$5, _7$$5, _8$$3; + zval *value_param = NULL, i, buf, _3$$4, _4$$4, _6$$5, _7$$5, _8$$3; zend_long value, ZEPHIR_LAST_CALL_STATUS, _1, _2; zval *this_ptr = getThis(); ZVAL_UNDEF(&i); ZVAL_UNDEF(&buf); - ZVAL_UNDEF(&_9); - ZVAL_UNDEF(&_11); ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_6$$5); @@ -1569,12 +1567,12 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarInt) { ZVAL_LONG(&i, _1); if (((value >> 7)) != 0) { ZVAL_LONG(&_3$$4, (value | 0x80)); - ZEPHIR_CALL_FUNCTION(&_4$$4, "chr", &_5, 18, &_3$$4); + ZEPHIR_CALL_FUNCTION(&_4$$4, "chr", &_5, 19, &_3$$4); zephir_check_call_status(); zephir_concat_self(&buf, &_4$$4 TSRMLS_CC); } else { ZVAL_LONG(&_6$$5, (value & 0x7f)); - ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", &_5, 18, &_6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", &_5, 19, &_6$$5); zephir_check_call_status(); zephir_concat_self(&buf, &_7$$5 TSRMLS_CC); RETURN_CCTOR(&buf); @@ -1584,19 +1582,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarInt) { value = ((value >> (7 & zephir_get_numberval(&_8$$3))) >> 6); } } - ZEPHIR_INIT_VAR(&_9); - if (!_10) { - _10 = zephir_fetch_class_str_ex(SL("Pocketmine\\Utils\\InvalidArgumentException"), ZEND_FETCH_CLASS_AUTO); - } - object_init_ex(&_9, _10); - if (zephir_has_constructor(&_9 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(&_11); - ZVAL_STRING(&_11, "Value too large to be encoded as a VarInt"); - ZEPHIR_CALL_METHOD(NULL, &_9, "__construct", NULL, 0, &_11); - zephir_check_call_status(); - } - zephir_throw_exception_debug(&_9, "pocketmine/utils/binary.zep", 570 TSRMLS_CC); - ZEPHIR_MM_RESTORE(); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Value too large to be encoded as a VarInt", "pocketmine/utils/binary.zep", 570); return; } @@ -1678,7 +1664,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, readUnsignedVarLong) { return; } zephir_array_fetch_long(&_0$$3, buffer, offset, PH_NOISY | PH_READONLY, "pocketmine/utils/binary.zep", 609 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&b$$3, "ord", &_1, 17, &_0$$3); + ZEPHIR_CALL_FUNCTION(&b$$3, "ord", &_1, 18, &_0$$3); zephir_check_call_status(); offset++; value = (value | (((((int) (zephir_get_numberval(&b$$3)) & 0x7f)) << i))); @@ -1729,19 +1715,16 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeVarLong) { */ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarLong) { - zend_class_entry *_11 = NULL; zend_bool _0; zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2, _9$$3; zephir_fcall_cache_entry *_5 = NULL; - zval value, *value_param = NULL, i, buf, _10, _12, _3$$4, _4$$4, _6$$5, _7$$5, _8$$3; + zval value, *value_param = NULL, i, buf, _3$$4, _4$$4, _6$$5, _7$$5, _8$$3; zval *this_ptr = getThis(); ZVAL_UNDEF(&value); ZVAL_UNDEF(&i); ZVAL_UNDEF(&buf); - ZVAL_UNDEF(&_10); - ZVAL_UNDEF(&_12); ZVAL_UNDEF(&_3$$4); ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_6$$5); @@ -1773,12 +1756,12 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarLong) { ZVAL_LONG(&i, _1); if ((((int) (zephir_get_numberval(&value)) >> 7)) != 0) { ZVAL_LONG(&_3$$4, ((int) (zephir_get_numberval(&value)) | 0x80)); - ZEPHIR_CALL_FUNCTION(&_4$$4, "chr", &_5, 18, &_3$$4); + ZEPHIR_CALL_FUNCTION(&_4$$4, "chr", &_5, 19, &_3$$4); zephir_check_call_status(); zephir_concat_self(&buf, &_4$$4 TSRMLS_CC); } else { ZVAL_LONG(&_6$$5, ((int) (zephir_get_numberval(&value)) & 0x7f)); - ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", &_5, 18, &_6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", &_5, 19, &_6$$5); zephir_check_call_status(); zephir_concat_self(&buf, &_7$$5 TSRMLS_CC); RETURN_CCTOR(&buf); @@ -1790,19 +1773,7 @@ PHP_METHOD(Pocketmine_Utils_Binary, writeUnsignedVarLong) { ZVAL_LONG(&value, _9$$3); } } - ZEPHIR_INIT_VAR(&_10); - if (!_11) { - _11 = zephir_fetch_class_str_ex(SL("Pocketmine\\Utils\\InvalidArgumentException"), ZEND_FETCH_CLASS_AUTO); - } - object_init_ex(&_10, _11); - if (zephir_has_constructor(&_10 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(&_12); - ZVAL_STRING(&_12, "Value too large to be encoded as a VarLong"); - ZEPHIR_CALL_METHOD(NULL, &_10, "__construct", NULL, 0, &_12); - zephir_check_call_status(); - } - zephir_throw_exception_debug(&_10, "pocketmine/utils/binary.zep", 655 TSRMLS_CC); - ZEPHIR_MM_RESTORE(); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Value too large to be encoded as a VarLong", "pocketmine/utils/binary.zep", 655); return; } diff --git a/ext/pocketmine/utils/binarystream.zep.c b/ext/pocketmine/utils/binarystream.zep.c index 9f84d0f..0b1edb5 100644 --- a/ext/pocketmine/utils/binarystream.zep.c +++ b/ext/pocketmine/utils/binarystream.zep.c @@ -402,7 +402,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getByte) { ZVAL_LONG(&_1, 1); ZEPHIR_CALL_METHOD(&_0, this_ptr, "get", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 17, &_0); + ZEPHIR_RETURN_CALL_FUNCTION("ord", NULL, 18, &_0); zephir_check_call_status(); RETURN_MM(); @@ -425,7 +425,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putByte) { ZVAL_LONG(&_0, v); - ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 18, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "chr", NULL, 19, &_0); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_1); ZEPHIR_MM_RESTORE(); @@ -452,7 +452,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getShort) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "n"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 136 TSRMLS_CC); RETURN_CTOR(&_4); @@ -479,7 +479,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getSignedShort) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "n"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 141 TSRMLS_CC); RETURN_MM_LONG((((int) (zephir_get_numberval(&_4)) << 48) >> 48)); @@ -506,7 +506,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "n"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -533,7 +533,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getLShort) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "v"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 151 TSRMLS_CC); RETURN_CTOR(&_4); @@ -560,7 +560,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getSignedLShort) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "v"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 156 TSRMLS_CC); RETURN_MM_LONG((((int) (zephir_get_numberval(&_4)) << 48) >> 48)); @@ -587,7 +587,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLShort) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "v"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -617,7 +617,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getTriad) { ZEPHIR_CONCAT_SV(&_2, "\\0", &_0); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "N"); - ZEPHIR_CALL_FUNCTION(&_4, "\unpack", NULL, 23, &_3, &_2); + ZEPHIR_CALL_FUNCTION(&_4, "\unpack", NULL, 24, &_3, &_2); zephir_check_call_status(); zephir_array_fetch_long(&_5, &_4, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 166 TSRMLS_CC); RETURN_CTOR(&_5); @@ -645,10 +645,10 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putTriad) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "N"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 1); - ZEPHIR_CALL_FUNCTION(&_3, "\substr", NULL, 25, &_2, &_1); + ZEPHIR_CALL_FUNCTION(&_3, "\substr", NULL, 26, &_2, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_3); ZEPHIR_MM_RESTORE(); @@ -678,7 +678,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getLTriad) { ZEPHIR_CONCAT_VS(&_2, &_0, "\\0"); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "V"); - ZEPHIR_CALL_FUNCTION(&_4, "\unpack", NULL, 23, &_3, &_2); + ZEPHIR_CALL_FUNCTION(&_4, "\unpack", NULL, 24, &_3, &_2); zephir_check_call_status(); zephir_array_fetch_long(&_5, &_4, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 176 TSRMLS_CC); RETURN_CTOR(&_5); @@ -707,11 +707,11 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLTriad) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "V"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); ZVAL_LONG(&_1, 0); ZVAL_LONG(&_3, -1); - ZEPHIR_CALL_FUNCTION(&_4, "\substr", NULL, 25, &_2, &_1, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "\substr", NULL, 26, &_2, &_1, &_3); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_4); ZEPHIR_MM_RESTORE(); @@ -738,7 +738,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getInt) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "N"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 186 TSRMLS_CC); RETURN_MM_LONG((((int) (zephir_get_numberval(&_4)) << 32) >> 32)); @@ -765,7 +765,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "N"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -792,7 +792,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getLInt) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "V"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 196 TSRMLS_CC); RETURN_MM_LONG((((int) (zephir_get_numberval(&_4)) << 32) >> 32)); @@ -819,7 +819,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLInt) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "V"); ZVAL_LONG(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -846,7 +846,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getFloat) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "G"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 206 TSRMLS_CC); RETURN_CTOR(&_4); @@ -877,11 +877,11 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getRoundedFloat) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "G"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 211 TSRMLS_CC); ZVAL_LONG(&_1, accuracy); - ZEPHIR_RETURN_CALL_FUNCTION("\round", NULL, 26, &_4, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("\round", NULL, 27, &_4, &_1); zephir_check_call_status(); RETURN_MM(); @@ -908,7 +908,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "G"); ZVAL_DOUBLE(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -935,7 +935,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getLFloat) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "g"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 221 TSRMLS_CC); RETURN_CTOR(&_4); @@ -966,11 +966,11 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getRoundedLFloat) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "g"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 226 TSRMLS_CC); ZVAL_LONG(&_1, accuracy); - ZEPHIR_RETURN_CALL_FUNCTION("\round", NULL, 26, &_4, &_1); + ZEPHIR_RETURN_CALL_FUNCTION("\round", NULL, 27, &_4, &_1); zephir_check_call_status(); RETURN_MM(); @@ -997,7 +997,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLFloat) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "g"); ZVAL_DOUBLE(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -1024,7 +1024,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getDouble) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "E"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 236 TSRMLS_CC); RETURN_CTOR(&_4); @@ -1052,7 +1052,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "E"); ZVAL_DOUBLE(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -1079,7 +1079,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, getLDouble) { zephir_check_call_status(); ZEPHIR_INIT_VAR(&_2); ZVAL_STRING(&_2, "e"); - ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 23, &_2, &_0); + ZEPHIR_CALL_FUNCTION(&_3, "\unpack", NULL, 24, &_2, &_0); zephir_check_call_status(); zephir_array_fetch_long(&_4, &_3, 1, PH_NOISY | PH_READONLY, "pocketmine/utils/binarystream.zep", 246 TSRMLS_CC); RETURN_CTOR(&_4); @@ -1107,7 +1107,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLDouble) { ZEPHIR_INIT_VAR(&_0); ZVAL_STRING(&_0, "e"); ZVAL_DOUBLE(&_1, v); - ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 24, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "\pack", NULL, 25, &_0, &_1); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_2); ZEPHIR_MM_RESTORE(); @@ -1164,7 +1164,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLong) { ZVAL_STRING(&_0, "NN"); ZVAL_LONG(&_1, (v >> 32)); ZVAL_LONG(&_2, (v & 0xffffffff)); - ZEPHIR_CALL_FUNCTION(&_3, "\pack", NULL, 24, &_0, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "\pack", NULL, 25, &_0, &_1, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_3); ZEPHIR_MM_RESTORE(); @@ -1221,7 +1221,7 @@ PHP_METHOD(Pocketmine_Utils_BinaryStream, putLLong) { ZVAL_STRING(&_0, "VV"); ZVAL_LONG(&_1, (v & 0xffffffff)); ZVAL_LONG(&_2, (v >> 32)); - ZEPHIR_CALL_FUNCTION(&_3, "\pack", NULL, 24, &_0, &_1, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "\pack", NULL, 25, &_0, &_1, &_2); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("buffer"), &_3); ZEPHIR_MM_RESTORE(); diff --git a/ide/0.0.1/Pocketmine/math/Vector3.zep.php b/ide/0.0.1/Pocketmine/math/Vector3.zep.php index 8ea2a27..9c0a304 100644 --- a/ide/0.0.1/Pocketmine/math/Vector3.zep.php +++ b/ide/0.0.1/Pocketmine/math/Vector3.zep.php @@ -21,17 +21,17 @@ class Vector3 /** * @var float|int */ - public $x; + public $x = 0.0; /** * @var float|int */ - public $y; + public $y = 0.0; /** * @var float|int */ - public $z; + public $z = 0.0; /** diff --git a/pocketmine/math/axisalignedbb.zep b/pocketmine/math/axisalignedbb.zep index 72cc1a7..1481990 100644 --- a/pocketmine/math/axisalignedbb.zep +++ b/pocketmine/math/axisalignedbb.zep @@ -63,7 +63,7 @@ class AxisAlignedBB */ public function setBB( bb) -> { - return this->setBounds(bb->minX, bb->minY, bb->minZ, bb->maxX, bb->maxY, bb->maxZ); + return this->setBounds((float) bb->minX, (float) bb->minY, (float) bb->minZ, (float) bb->maxX, (float) bb->maxY, (float) bb->maxZ); } /** @@ -534,12 +534,12 @@ class AxisAlignedBB var v3; var v2; var v1; - let v1 = pos1->getIntermediateWithXValue(pos2, this->minX); - let v2 = pos1->getIntermediateWithXValue(pos2, this->maxX); - let v3 = pos1->getIntermediateWithYValue(pos2, this->minY); - let v4 = pos1->getIntermediateWithYValue(pos2, this->maxY); - let v5 = pos1->getIntermediateWithZValue(pos2, this->minZ); - let v6 = pos1->getIntermediateWithZValue(pos2, this->maxZ); + let v1 = pos1->getIntermediateWithXValue(pos2, (float) this->minX); + let v2 = pos1->getIntermediateWithXValue(pos2, (float) this->maxX); + let v3 = pos1->getIntermediateWithYValue(pos2, (float) this->minY); + let v4 = pos1->getIntermediateWithYValue(pos2, (float) this->maxY); + let v5 = pos1->getIntermediateWithZValue(pos2, (float) this->minZ); + let v6 = pos1->getIntermediateWithZValue(pos2, (float) this->maxZ); if (v1 !== null && !this->isVectorInYZ(v1)) { let v1 = null; } diff --git a/pocketmine/math/vector2.zep b/pocketmine/math/vector2.zep index 051470a..a59ee7f 100644 --- a/pocketmine/math/vector2.zep +++ b/pocketmine/math/vector2.zep @@ -51,7 +51,7 @@ class Vector2 public function add(var x, float y = 0) -> { if (x instanceof Vector2) { - return this->add(x->x, x->y); + return this->add((float) x->x, (float) x->y); } else { return new Vector2(this->x + (float) x, this->y + (float) y); } @@ -66,7 +66,7 @@ class Vector2 public function subtract(var x, float y = 0) -> { if (x instanceof Vector2) { - return this->add(-x->x, -x->y); + return this->add((float) -(x->x), (float) -(x->y)); } else { return this->add(-x, -y); } @@ -89,7 +89,7 @@ class Vector2 public function abs() -> { - return new Vector2(abs(this->x), abs(this->y)); + return new Vector2((float) abs(this->x), (float) abs(this->y)); } public function multiply(float number) -> @@ -111,7 +111,7 @@ class Vector2 public function distance(var x, float y = 0) -> float { if (x instanceof Vector2) { - return sqrt(this->distanceSquared(x->x, x->y)); + return sqrt(this->distanceSquared((float) x->x, (float) x->y)); } else { return sqrt(this->distanceSquared(x, y)); } @@ -126,7 +126,7 @@ class Vector2 public function distanceSquared(var x, float y = 0) -> float { if (x instanceof Vector2) { - return this->distanceSquared(x->x, x->y); + return this->distanceSquared((float) x->x, (float) x->y); } else { return pow(this->x - (float) x, 2) + pow(this->y - (float) y, 2); } diff --git a/pocketmine/math/vector3.zep b/pocketmine/math/vector3.zep index 8fc7144..db1a0f6 100644 --- a/pocketmine/math/vector3.zep +++ b/pocketmine/math/vector3.zep @@ -19,15 +19,15 @@ namespace Pocketmine\Math; class Vector3 { /** @var float|int */ - public x { + public x = 0.0 { get }; /** @var float|int */ - public y { + public y = 0.0 { get }; /** @var float|int */ - public z { + public z = 0.0 { get }; /** diff --git a/pocketmine/math/voxelraytrace.zep b/pocketmine/math/voxelraytrace.zep index ab70f51..190d593 100644 --- a/pocketmine/math/voxelraytrace.zep +++ b/pocketmine/math/voxelraytrace.zep @@ -74,9 +74,9 @@ abstract class VoxelRayTrace throw new \InvalidArgumentException("Start and end points are the same, giving a zero direction vector"); } let radius = start->distance(end); - let stepX = spaceShip(directionVector->x, 0); - let stepY = spaceShip(directionVector->y, 0); - let stepZ = spaceShip(directionVector->z, 0); + let stepX = self::spaceShip(directionVector->x, 0); + let stepY = self::spaceShip(directionVector->y, 0); + let stepZ = self::spaceShip(directionVector->z, 0); //Initialize the step accumulation variables depending how far into the current block the start position is. If //the start position is on the corner of the block, these will be zero. let tMaxX = self::rayTraceDistanceToBoundary(start->x, directionVector->x); diff --git a/pocketmine/utils/binary.zep b/pocketmine/utils/binary.zep index 6394486..d4890e5 100644 --- a/pocketmine/utils/binary.zep +++ b/pocketmine/utils/binary.zep @@ -567,7 +567,7 @@ class Binary let value = value >> 7 & PHP_INT_MAX >> 6; //PHP really needs a logical right-shift operator } - throw new InvalidArgumentException("Value too large to be encoded as a VarInt"); + throw new \InvalidArgumentException("Value too large to be encoded as a VarInt"); } /** @@ -652,7 +652,7 @@ class Binary let value = value >> 7 & PHP_INT_MAX >> 6; //PHP really needs a logical right-shift operator } - throw new InvalidArgumentException("Value too large to be encoded as a VarLong"); + throw new \InvalidArgumentException("Value too large to be encoded as a VarLong"); } }