本文整理汇总了C++中RETURN_MM_LONG函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_MM_LONG函数的具体用法?C++ RETURN_MM_LONG怎么用?C++ RETURN_MM_LONG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_MM_LONG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Length filter. If an array/object is passed a count is performed otherwise a strlen/mb_strlen
*/
PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) {
zend_bool _0;
int ZEPHIR_LAST_CALL_STATUS;
zval *item;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &item);
_0 = Z_TYPE_P(item) == IS_OBJECT;
if (!(_0)) {
_0 = Z_TYPE_P(item) == IS_ARRAY;
}
if (_0) {
RETURN_MM_LONG(zephir_fast_count_int(item TSRMLS_CC));
}
if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) {
ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 380, item);
zephir_check_call_status();
RETURN_MM();
}
RETURN_MM_LONG(zephir_fast_strlen_ev(item));
}
示例2: PHP_METHOD
PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) {
zval *n_param = NULL, *_0, _1 = zval_used_for_init, *_2;
int n;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &n_param);
n = zephir_get_intval(n_param);
if ((n == 0)) {
RETURN_MM_LONG(0);
} else {
if ((n == 1)) {
RETURN_MM_LONG(1);
} else {
ZEPHIR_INIT_VAR(_0);
ZEPHIR_SINIT_VAR(_1);
ZVAL_LONG(&_1, (n - 1));
zephir_call_internal_method_p1(_0, this_ptr, "fibonaccifinalrecursive", ZEND_MN(Test_Fibonnaci_fibonacciFinalRecursive), &_1);
ZEPHIR_INIT_VAR(_2);
ZEPHIR_SINIT_NVAR(_1);
ZVAL_LONG(&_1, (n - 2));
zephir_call_internal_method_p1(_2, this_ptr, "fibonaccifinalrecursive", ZEND_MN(Test_Fibonnaci_fibonacciFinalRecursive), &_1);
zephir_add_function(return_value, _0, _2 TSRMLS_CC);
RETURN_MM();
}
}
ZEPHIR_MM_RESTORE();
}
示例3: PHP_METHOD
PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) {
zephir_fcall_cache_entry *_2 = NULL;
zval *n_param = NULL, *_0 = NULL, _1 = zval_used_for_init, *_3 = NULL;
int n, ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &n_param);
n = zephir_get_intval(n_param);
if (n == 0) {
RETURN_MM_LONG(0);
} else {
if (n == 1) {
RETURN_MM_LONG(1);
} else {
ZEPHIR_SINIT_VAR(_1);
ZVAL_LONG(&_1, (n - 1));
ZEPHIR_CALL_METHOD(&_0, this_ptr, "fibonaccirecursive", &_2, 33, &_1);
zephir_check_call_status();
ZEPHIR_SINIT_NVAR(_1);
ZVAL_LONG(&_1, (n - 2));
ZEPHIR_CALL_METHOD(&_3, this_ptr, "fibonaccirecursive", &_2, 33, &_1);
zephir_check_call_status();
zephir_add_function_ex(return_value, _0, _3 TSRMLS_CC);
RETURN_MM();
}
}
}
示例4: PHP_METHOD
PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) {
zephir_fcall_cache_entry *_2 = NULL;
zval *n_param = NULL, *_0$$6 = NULL, *_1$$6 = NULL, *_3$$6 = NULL;
int n, ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &n_param);
n = zephir_get_intval(n_param);
if (n == 0) {
RETURN_MM_LONG(0);
} else {
if (n == 1) {
RETURN_MM_LONG(1);
} else {
ZEPHIR_INIT_VAR(_1$$6);
ZVAL_LONG(_1$$6, (n - 1));
ZEPHIR_CALL_METHOD(&_0$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, _1$$6);
zephir_check_call_status();
ZEPHIR_INIT_NVAR(_1$$6);
ZVAL_LONG(_1$$6, (n - 2));
ZEPHIR_CALL_METHOD(&_3$$6, this_ptr, "fibonaccifinalrecursive", &_2, 36, _1$$6);
zephir_check_call_status();
zephir_add_function(return_value, _0$$6, _3$$6);
RETURN_MM();
}
}
}
示例5: PHP_METHOD
/**
* The kick command applies only to the currently used tube.
*/
PHP_METHOD(Phalcon_Queue_Beanstalk, kick) {
zval *_1;
zval *bound_param = NULL, *response = NULL, _0, *_2, *_3;
int bound, ZEPHIR_LAST_CALL_STATUS;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &bound_param);
bound = zephir_get_intval(bound_param);
ZEPHIR_SINIT_VAR(_0);
ZVAL_LONG(&_0, bound);
ZEPHIR_INIT_VAR(_1);
ZEPHIR_CONCAT_SV(_1, "kick ", &_0);
ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _1);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 409);
zephir_check_call_status();
zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 306 TSRMLS_CC);
if (!ZEPHIR_IS_STRING(_2, "KICKED")) {
RETURN_MM_BOOL(0);
}
ZEPHIR_OBS_VAR(_3);
zephir_array_fetch_long(&_3, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 310 TSRMLS_CC);
RETURN_MM_LONG(zephir_get_intval(_3));
}
示例6: PHP_METHOD
PHP_METHOD(Test_Ternary, testTernaryComplex2) {
int ZEPHIR_LAST_CALL_STATUS;
zval *a, *y, *_0 = NULL, *_1 = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &a, &y);
ZEPHIR_INIT_VAR(_0);
if (100) {
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, (1 + 100));
} else {
ZEPHIR_CALL_METHOD(&_1, a, "y", NULL);
zephir_check_call_status();
if (zephir_is_true(_1)) {
ZEPHIR_CALL_METHOD(&_0, a, "x", NULL);
zephir_check_call_status();
} else {
ZEPHIR_INIT_BNVAR(_0);
ZVAL_BOOL(_0, zephir_array_isset(a, y));
}
}
RETURN_MM_LONG((5 + zephir_get_numberval(_0)));
}
示例7: PHP_METHOD
PHP_METHOD(Test_McallInternal, d) {
zval _3$$3;
zend_bool _0;
zend_long ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2;
zval *this_ptr = getThis();
ZVAL_UNDEF(&_3$$3);
ZEPHIR_MM_GROW();
a = 0;
_2 = 1000000;
_1 = 0;
_0 = 0;
if (_1 <= _2) {
while (1) {
if (_0) {
_1++;
if (!(_1 <= _2)) {
break;
}
} else {
_0 = 1;
}
i = _1;
ZEPHIR_CALL_INTERNAL_METHOD_P0(&_3$$3, this_ptr, zep_Test_McallInternal_a);
zephir_check_call_status();
a += zephir_get_intval(&_3$$3);
}
}
RETURN_MM_LONG(a);
}
示例8: PHP_METHOD
PHP_METHOD(Test_Flow, testFor1) {
HashTable *_2;
HashPosition _1;
int c;
zval *v = NULL, *b, *_0, **_3;
ZEPHIR_MM_GROW();
c = 0;
ZEPHIR_INIT_VAR(b);
array_init_size(b, 5);
ZEPHIR_INIT_VAR(_0);
ZVAL_LONG(_0, 1);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 2);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 3);
zephir_array_fast_append(b, _0);
ZEPHIR_INIT_BNVAR(_0);
ZVAL_LONG(_0, 4);
zephir_array_fast_append(b, _0);
zephir_is_iterable(b, &_2, &_1, 0, 0);
for (
; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS
; zend_hash_move_forward_ex(_2, &_1)
) {
ZEPHIR_GET_HVALUE(v, _3);
c += zephir_get_numberval(v);
}
RETURN_MM_LONG(c);
}
示例9: PHP_METHOD
PHP_METHOD(Test_McallInternal, f) {
zval _3$$3;
zend_bool _0;
zephir_fcall_cache_entry *_4 = NULL;
int ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2;
ZEPHIR_INIT_THIS();
ZVAL_UNDEF(&_3$$3);
ZEPHIR_MM_GROW();
a = 0;
_2 = 1000000;
_1 = 0;
_0 = 0;
if (_1 <= _2) {
while (1) {
if (_0) {
_1++;
if (!(_1 <= _2)) {
break;
}
} else {
_0 = 1;
}
i = _1;
ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "e", &_4, 0);
zephir_check_call_status();
a += zephir_get_intval(&_3$$3);
}
}
RETURN_MM_LONG(a);
}
示例10: PHP_METHOD
PHP_METHOD(Test_BuiltIn_StringMethods, getLength5) {
zval *a_param = NULL;
zval a, _0;
zval this_zv;
zval *this_ptr = getThis();
if (EXPECTED(this_ptr)) {
ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
this_ptr = &this_zv;
} else this_ptr = NULL;
ZVAL_UNDEF(&a);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &a_param);
zephir_get_strval(&a, a_param);
ZEPHIR_INIT_VAR(&_0);
ZEPHIR_CONCAT_SV(&_0, "hello", &a);
RETURN_MM_LONG(zephir_fast_strlen_ev(&_0));
}
示例11: PHP_METHOD
PHP_METHOD(Test_Flow, testFor38) {
zend_bool _1;
long _0;
zval *v = NULL;
int i = 0, _2, _3;
ZEPHIR_MM_GROW();
_3 = 10;
_2 = 1;
_0 = 0;
_1 = 0;
if (_2 <= _3) {
while (1) {
if (_1) {
_0++;
_2++;
if (!(_2 <= _3)) {
break;
}
} else {
_1 = 1;
}
_0 = _0;
ZEPHIR_INIT_NVAR(v);
ZVAL_LONG(v, _2);
i++;
}
}
RETURN_MM_LONG(i);
}
示例12: PHP_METHOD
PHP_METHOD(Test_Exceptions, issue1325) {
zval e, status, _0;
zend_long ZEPHIR_LAST_CALL_STATUS;
zval *this_ptr = getThis();
ZVAL_UNDEF(&e);
ZVAL_UNDEF(&status);
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
/* try_start_1: */
ZEPHIR_CALL_METHOD(&status, this_ptr, "donoopexception", NULL, 27);
zephir_check_call_status_or_jump(try_end_1);
try_end_1:
if (EG(exception)) {
ZEPHIR_INIT_VAR(&_0);
ZVAL_OBJ(&_0, EG(exception));
Z_ADDREF_P(&_0);
if (zephir_instance_of_ev(&_0, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) {
zend_clear_exception(TSRMLS_C);
ZEPHIR_CPY_WRT(&e, &_0);
ZEPHIR_INIT_NVAR(&status);
ZVAL_STRING(&status, "woop");
}
}
RETURN_MM_LONG(1);
}
示例13: PHP_METHOD
PHP_METHOD(PocketMine_Math_Vector2, getFloorX) {
zval *_0;
ZEPHIR_MM_GROW();
ZEPHIR_OBS_VAR(_0);
zephir_read_property_this(&_0, this_ptr, SL("x"), PH_NOISY_CC);
RETURN_MM_LONG(zephir_get_intval(_0));
}
示例14: PHP_METHOD
PHP_METHOD(Test_BuiltIn_StringMethods, getLength3) {
zval *_0;
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(_0);
ZEPHIR_CONCAT_SS(_0, "hello", "hello");
RETURN_MM_LONG(zephir_fast_strlen_ev(_0));
}
示例15: zep_Test_McallInternal_a
void zep_Test_McallInternal_a(int ht, zval *return_value, zval *this_ptr, int return_value_used) {
zval _0;
ZVAL_UNDEF(&_0);
ZEPHIR_MM_GROW();
ZEPHIR_INIT_VAR(&_0);
ZVAL_STRING(&_0, "hello");
RETURN_MM_LONG(zephir_fast_strlen_ev(&_0));
}