X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fmarshal.c;h=d48cb8bd28bd5144ea728bbc769292340c22a47a;hp=55feb3c254127ade7ad584110000dc88989ca36c;hb=10e51aad0515e80adeb96a47776a2d80e62a98bc;hpb=6ec1a060415f860bc3eb4c74fbce1c43f5aa7e55 diff --git a/src/marshal.c b/src/marshal.c index 55feb3c..d48cb8b 100644 --- a/src/marshal.c +++ b/src/marshal.c @@ -226,6 +226,7 @@ impl_val *psi_let_boolval(impl_val *tmp, struct psi_decl_arg *spec, token_t impl return psi_val_boolval(tmp, real_type, boolval); } +#if HAVE_INT128 static inline char *psi_u128_to_buf(char *buf, unsigned __int128 u128) { for (*buf = 0; u128 > 0; u128 /= 10) { @@ -245,7 +246,6 @@ static inline char *psi_i128_to_buf(char *buf, __int128 i128) return psi_u128_to_buf(buf, i128); } -#if HAVE_INT128 # define RETVAL_LONG_STR(V, s) do {\ char buf[0x30] = {0}; \ if (s && V >= ZEND_LONG_MIN && V <= ZEND_LONG_MAX) { \ @@ -423,8 +423,8 @@ stop: */ impl_val *psi_let_intval(impl_val *tmp, struct psi_decl_arg *spec, token_t impl_type, impl_val *ival, zval *zvalue, void **to_free) { - zend_long intval; - token_t real_type = spec ? psi_decl_type_get_real(spec->type)->type : PSI_T_LONG; + int64_t intval; + token_t real_type = spec ? psi_decl_type_get_real(spec->type)->type : PSI_T_INT64; if (ival && impl_type == PSI_T_INT) { @@ -551,7 +551,7 @@ void psi_set_to_stringl(zval *return_value, struct psi_set_exp *set, impl_val *r struct psi_set_exp *sub_exp; psi_plist_get(set->inner, 0, &sub_exp); - RETVAL_STRINGL(str, psi_long_num_exp(sub_exp->data.num, frame, NULL)); + RETVAL_STRINGL(str, psi_num_exp_get_long(sub_exp->data.num, frame, NULL)); } else { RETVAL_EMPTY_STRING(); } @@ -686,7 +686,7 @@ void psi_set_to_array_counted(zval *return_value, struct psi_set_exp *set, impl_ } psi_plist_get(set->inner, 0, &sub_exp); - count = psi_long_num_exp(sub_exp->data.num, frame, NULL); + count = psi_num_exp_get_long(sub_exp->data.num, frame, NULL); psi_plist_get(set->inner, 1, &sub_exp); for (ptr = (char *) ret_val; 0 < count--; ptr += size) {