case IS_FALSE:
case IS_TRUE:
case IS_LONG:
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
*p = Z_LVAL_P(arg);
break;
void zend_do_declare_stmt(znode *var, znode *val TSRMLS_DC) /* {{{ */
{
if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "ticks", sizeof("ticks")-1)) {
- convert_to_int(&val->u.constant);
+ convert_to_long(&val->u.constant);
CG(declarables).ticks = val->u.constant;
} else if (!zend_binary_strcasecmp(Z_STRVAL(var->u.constant), Z_STRLEN(var->u.constant), "encoding", sizeof("encoding")-1)) {
if (Z_TYPE(val->u.constant) == IS_CONSTANT) {
convert_to_string_ex(&message);
convert_to_string_ex(&file);
- convert_to_int_ex(&line);
+ convert_to_long_ex(&line);
fci.size = sizeof(fci);
fci.function_table = &Z_OBJCE_P(exception)->function_table;
convert_to_string_ex(str);
convert_to_string_ex(file);
- convert_to_int_ex(line);
+ convert_to_long_ex(line);
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
}
break;
case IS_OBJECT:
- convert_to_int_base(op, 10);
+ convert_to_long_base(op, 10);
break;
}
}
break; \
case IS_OBJECT: \
ZVAL_DUP(&(holder), op); \
- convert_to_int_base(&(holder), 10); \
+ convert_to_long_base(&(holder), 10); \
if (Z_TYPE(holder) == IS_LONG) { \
(op) = &(holder); \
} \
/* }}} */
-/* {{{ zendi_convert_to_int */
-#define zendi_convert_to_int(op, holder, result) \
+/* {{{ zendi_convert_to_long */
+#define zendi_convert_to_long(op, holder, result) \
if (op == result) { \
- convert_to_int(op); \
+ convert_to_long(op); \
} else if (Z_TYPE_P(op) != IS_LONG) { \
switch (Z_TYPE_P(op)) { \
case IS_NULL: \
break; \
case IS_OBJECT: \
ZVAL_DUP(&(holder), (op)); \
- convert_to_int_base(&(holder), 10); \
+ convert_to_long_base(&(holder), 10); \
break; \
case IS_RESOURCE: \
ZVAL_LONG(&holder, Z_RES_HANDLE_P(op)); \
/* }}} */
-ZEND_API void convert_to_int(zval *op) /* {{{ */
+ZEND_API void convert_to_long(zval *op) /* {{{ */
{
if (Z_TYPE_P(op) != IS_LONG) {
- convert_to_int_base(op, 10);
+ convert_to_long_base(op, 10);
}
}
/* }}} */
-ZEND_API void convert_to_int_base(zval *op, int base) /* {{{ */
+ZEND_API void convert_to_long_base(zval *op, int base) /* {{{ */
{
zend_long tmp;
zval dst;
TSRMLS_FETCH();
- convert_object_to_type(op, &dst, IS_LONG, convert_to_int);
+ convert_object_to_type(op, &dst, IS_LONG, convert_to_long);
zval_dtor(op);
if (Z_TYPE(dst) == IS_LONG) {
}
/* }}} */
-ZEND_API void multi_convert_to_int_ex(int argc, ...) /* {{{ */
+ZEND_API void multi_convert_to_long_ex(int argc, ...) /* {{{ */
{
zval *arg;
va_list ap;
while (argc--) {
arg = va_arg(ap, zval *);
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
}
va_end(ap);
case IS_OBJECT:
{
zval dst;
- convert_object_to_type(op, &dst, IS_LONG, convert_to_int);
+ convert_object_to_type(op, &dst, IS_LONG, convert_to_long);
if (Z_TYPE(dst) == IS_LONG) {
return Z_LVAL(dst);
} else {
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MOD);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_OR);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_AND);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_BW_XOR);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SL);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
if (Z_TYPE_P(op1) != IS_LONG || Z_TYPE_P(op2) != IS_LONG) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SR);
- zendi_convert_to_int(op1, op1_copy, result);
+ zendi_convert_to_long(op1, op1_copy, result);
op1_lval = Z_LVAL_P(op1);
- zendi_convert_to_int(op2, op2_copy, result);
+ zendi_convert_to_long(op2, op2_copy, result);
} else {
op1_lval = Z_LVAL_P(op1);
}
ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
-ZEND_API void convert_to_int(zval *op);
+ZEND_API void convert_to_long(zval *op);
ZEND_API void convert_to_double(zval *op);
-ZEND_API void convert_to_int_base(zval *op, int base);
+ZEND_API void convert_to_long_base(zval *op, int base);
ZEND_API void convert_to_null(zval *op);
ZEND_API void convert_to_boolean(zval *op);
ZEND_API void convert_to_array(zval *op);
ZEND_API void convert_to_object(zval *op);
-ZEND_API void multi_convert_to_int_ex(int argc, ...);
+ZEND_API void multi_convert_to_long_ex(int argc, ...);
ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
convert_to_null(pzv); \
break; \
case IS_LONG: \
- convert_to_int(pzv); \
+ convert_to_long(pzv); \
break; \
case IS_DOUBLE: \
convert_to_double(pzv); \
}
#define convert_to_boolean_ex(pzv) convert_to_ex_master(pzv, boolean, _IS_BOOL)
-#define convert_to_int_ex(pzv) convert_to_ex_master(pzv, int, IS_LONG)
+#define convert_to_long_ex(pzv) convert_to_ex_master(pzv, int, IS_LONG)
#define convert_to_double_ex(pzv) convert_to_ex_master(pzv, double, IS_DOUBLE)
#define convert_to_string_ex(pzv) convert_to_ex_master(pzv, string, IS_STRING)
#define convert_to_array_ex(pzv) convert_to_ex_master(pzv, array, IS_ARRAY)
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
|| (Z_TYPE_P(offset) == IS_STRING /* or numeric string */
&& IS_LONG == is_numeric_string(Z_STRVAL_P(offset), Z_STRLEN_P(offset), NULL, NULL, 0))) {
ZVAL_DUP(&tmp, offset);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
offset = &tmp;
}
}
zval tmp;
ZVAL_DUP(&tmp, tmpzval);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
} else {
zval tmp;
ZVAL_DUP(&tmp, tmpzval);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
if (NULL != (tmp = zend_hash_str_find(HASH_OF(server_params),
"Flags", sizeof("Flags")-1))) {
- convert_to_int_ex(tmp);
+ convert_to_long_ex(tmp);
ctx = (CLSCTX)Z_LVAL_P(tmp);
}
}
VariantClear(&v);
}
} else if (V_ISARRAY(&obj->v)) {
- convert_to_int(offset);
+ convert_to_long(offset);
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) {
vt = V_VT(&obj->v) & ~VT_ARRAY;
}
- convert_to_int(offset);
+ convert_to_long(offset);
indices = Z_LVAL_P(offset);
VariantInit(&v);
/* the SafeArray case */
/* offset/index must be an integer */
- convert_to_int(offset);
+ convert_to_long(offset);
sa = V_ARRAY(&proxy->obj->v);
dims = SafeArrayGetDim(sa);
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
- convert_to_int(&proxy->indices[i]);
+ convert_to_long(&proxy->indices[i]);
indices[i] = Z_LVAL(proxy->indices[i]);
}
indices = safe_emalloc(dims, sizeof(LONG), 0);
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
- convert_to_int(&proxy->indices[i]);
+ convert_to_long(&proxy->indices[i]);
indices[i] = Z_LVAL(proxy->indices[i]);
}
/* add user-supplied index */
- convert_to_int(offset);
+ convert_to_long(offset);
indices[dims-1] = Z_LVAL_P(offset);
if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) {
I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0);
for (i = 0; i < proxy->dimensions; i++) {
- convert_to_int(&proxy->indices[i]);
+ convert_to_long(&proxy->indices[i]);
I->indices[i] = Z_LVAL(proxy->indices[i]);
}
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
- convert_to_int_ex(&retval);
+ convert_to_long_ex(&retval);
}
length = Z_LVAL(retval);
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_FNMATCH_FUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
- convert_to_int_ex(&retval);
+ convert_to_long_ex(&retval);
}
rval = Z_LVAL(retval);
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot call the CURLOPT_PROGRESSFUNCTION");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
- convert_to_int_ex(&retval);
+ convert_to_long_ex(&retval);
}
if (0 != Z_LVAL(retval)) {
rval = 1;
length = -1;
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
- convert_to_int_ex(&retval);
+ convert_to_long_ex(&retval);
}
length = Z_LVAL(retval);
}
switch (option) {
/* Long options */
case CURLOPT_SSL_VERIFYHOST:
- convert_to_int(zvalue);
+ convert_to_long(zvalue);
if (Z_LVAL_P(zvalue) == 1) {
#if LIBCURL_VERSION_NUM <= 0x071c00 /* 7.28.0 */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "CURLOPT_SSL_VERIFYHOST with value 1 is deprecated and will be removed as of libcurl 7.28.1. It is recommended to use value 2 instead");
#if CURLOPT_MUTE != 0
case CURLOPT_MUTE:
#endif
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
#if LIBCURL_VERSION_NUM >= 0x71304
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
(PG(open_basedir) && *PG(open_basedir)) && (Z_LVAL_P(zvalue) & CURLPROTO_FILE)) {
error = curl_easy_setopt(ch->cp, option, Z_LVAL_P(zvalue));
break;
case CURLOPT_SAFE_UPLOAD:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
ch->safe_upload = (Z_LVAL_P(zvalue) != 0);
break;
break;
case CURLOPT_FOLLOWLOCATION:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
#if LIBCURL_VERSION_NUM < 0x071304
if (PG(open_basedir) && *PG(open_basedir)) {
if (Z_LVAL_P(zvalue) != 0) {
break;
case CURLOPT_RETURNTRANSFER:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
if (Z_LVAL_P(zvalue)) {
ch->handlers->write->method = PHP_CURL_RETURN;
} else {
#if LIBCURL_VERSION_NUM >= 0x070f05 /* Available since 7.15.5 */
case CURLOPT_MAX_RECV_SPEED_LARGE:
case CURLOPT_MAX_SEND_SPEED_LARGE:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, option, (curl_off_t)Z_LVAL_P(zvalue));
break;
#endif
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
case CURLOPT_POSTREDIR:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch->cp, CURLOPT_POSTREDIR, Z_LVAL_P(zvalue) & CURL_REDIR_POST_ALL);
break;
#endif
}
case CURLINFO_HEADER_OUT:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
if (Z_LVAL_P(zvalue) == 1) {
curl_easy_setopt(ch->cp, CURLOPT_DEBUGFUNCTION, curl_debug);
curl_easy_setopt(ch->cp, CURLOPT_DEBUGDATA, (void *)ch);
}
}
- convert_to_int_ex(z_still_running);
+ convert_to_long_ex(z_still_running);
still_running = Z_LVAL_P(z_still_running);
result = curl_multi_perform(mh->multi, &still_running);
ZVAL_LONG(z_still_running, still_running);
#if LIBCURL_VERSION_NUM >= 0x071003 /* 7.16.3 */
case CURLMOPT_MAXCONNECTS:
#endif
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
error = curl_multi_setopt(mh->multi, option, Z_LVAL_P(zvalue));
break;
switch (option) {
case CURLSHOPT_SHARE:
case CURLSHOPT_UNSHARE:
- convert_to_int_ex(zvalue);
+ convert_to_long_ex(zvalue);
error = curl_share_setopt(sh->share, option, Z_LVAL_P(zvalue));
break;
convert_to_string(z_date);
z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1);
if (z_timezone_type) {
- convert_to_int(z_timezone_type);
+ convert_to_long(z_timezone_type);
z_timezone = zend_hash_str_find(myht, "timezone", sizeof("timezone")-1);
if (z_timezone) {
convert_to_string(z_timezone);
if ((z_timezone_type = zend_hash_str_find(myht, "timezone_type", sizeof("timezone_type")-1)) != NULL) {
if ((z_timezone = zend_hash_str_find(myht, "timezone", sizeof("timezone")-1)) != NULL) {
- convert_to_int(z_timezone_type);
+ convert_to_long(z_timezone_type);
if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone) TSRMLS_CC)) {
return SUCCESS;
}
int filemode = 0644;
if (info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
}
if (info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
}
if (info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
}
if (info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
int filemode = 0644;
if(info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
return FAILURE; /* not possible */
if(info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
}
if(info->argc > 0) {
- convert_to_int_ex(&info->argv[0]);
+ convert_to_long_ex(&info->argv[0]);
filemode = Z_LVAL(info->argv[0]);
}
} else {
/* we convert numbers to integers and treat them as a string */
if (Z_TYPE_P(regex) == IS_DOUBLE) {
- convert_to_int_ex(regex); /* get rid of decimal places */
+ convert_to_long_ex(regex); /* get rid of decimal places */
}
convert_to_string_ex(regex);
/* don't bother doing an extended regex with just a number */
pattern = STR_EMPTY_ALLOC();
}
} else {
- convert_to_int_ex(arg_pattern);
+ convert_to_long_ex(arg_pattern);
pattern = zend_string_alloc(1, 0);
pattern->val[0] = (char) Z_LVAL_P(arg_pattern);
pattern->val[1] = '\0';
replace = STR_EMPTY_ALLOC();
}
} else {
- convert_to_int_ex(arg_replace);
+ convert_to_long_ex(arg_replace);
replace = zend_string_alloc(1, 0);
replace->val[0] = (char) Z_LVAL_P(arg_replace);
replace->val[1] = '\0';
continue;
}
ZVAL_DUP(&offsetcopy, offset);
- convert_to_int(&offsetcopy);
+ convert_to_long(&offsetcopy);
pattern_offset = &offsetcopy;
} ZEND_HASH_FOREACH_END();
if (Z_TYPE_P(zv) != IS_LONG) { \
zval ___tmp; \
ZVAL_DUP(&___tmp, zv); \
- convert_to_int(&___tmp); \
+ convert_to_long(&___tmp); \
opt = Z_LVAL(___tmp); \
} else { \
opt = Z_LVAL_P(zv); \
if (Z_TYPE_P(item) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, item);
- convert_to_int(&lval);
+ convert_to_long(&lval);
stylearr[index++] = Z_LVAL(lval);
} else {
stylearr[index++] = Z_LVAL_P(item);
if (Z_TYPE_P(var) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, var);
- convert_to_int(&lval);
+ convert_to_long(&lval);
points[i].x = Z_LVAL(lval);
} else {
points[i].x = Z_LVAL_P(var);
if (Z_TYPE_P(var) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, var);
- convert_to_int(&lval);
+ convert_to_long(&lval);
points[i].y = Z_LVAL(lval);
} else {
points[i].y = Z_LVAL_P(var);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.x = Z_LVAL(lval);
} else {
rect.x = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.y = Z_LVAL(lval);
} else {
rect.y = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.width = Z_LVAL(lval);
} else {
rect.width = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.height = Z_LVAL(lval);
} else {
rect.height = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.x = Z_LVAL(lval);
} else {
rect.x = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.y = Z_LVAL(lval);
} else {
rect.y = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.width = Z_LVAL(lval);
} else {
rect.width = Z_LVAL_P(tmp);
if (Z_TYPE_P(tmp) != IS_LONG) {
zval lval;
ZVAL_COPY(&lval, tmp);
- convert_to_int(&lval);
+ convert_to_long(&lval);
rect.height = Z_LVAL(lval);
} else {
rect.height = Z_LVAL_P(tmp);
}
SEPARATE_ZVAL(z_algorithm);
- convert_to_int_ex(z_algorithm);
+ convert_to_long_ex(z_algorithm);
algorithm = Z_LVAL_P(z_algorithm);
/* need to convert the first parameter from int constant to string algorithm name */
if (Z_TYPE_P(pzval) != IS_LONG) {
ZVAL_DUP(&val, pzval);
- convert_to_int(&val);
+ convert_to_long(&val);
pzval = &val;
}
topbod = bod;
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->type = (short) Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->encoding = (short) Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
bod->contents.text.size = 0;
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->size.lines = Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "bytes", sizeof("bytes") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->size.bytes = Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) {
} else if (Z_TYPE_P(data) == IS_ARRAY) {
short type = -1;
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "type", sizeof("type") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
type = (short) Z_LVAL_P(pvalue);
}
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "encoding", sizeof("encoding") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->encoding = (short) Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "charset", sizeof("charset") - 1)) != NULL) {
bod->contents.text.size = 0;
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "lines", sizeof("lines") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->size.lines = Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "bytes", sizeof("bytes") - 1)) != NULL) {
- convert_to_int_ex(pvalue);
+ convert_to_long_ex(pvalue);
bod->size.bytes = Z_LVAL_P(pvalue);
}
if ((pvalue = zend_hash_str_find(Z_ARRVAL_P(data), "md5", sizeof("md5") - 1)) != NULL) {
RETURN_FALSE;
}
- convert_to_int_ex(len_arg);
+ convert_to_long_ex(len_arg);
if (_php_ibase_blob_get(return_value, ib_blob, Z_LVAL_P(len_arg) TSRMLS_CC) != SUCCESS) {
RETURN_FALSE;
RETURN_FALSE;
}
- convert_to_int_ex(&args[0]);
+ convert_to_long_ex(&args[0]);
link_res_id = Z_LVAL(args[0]);
} else {
ISC_INT64 l;
case SQL_SHORT:
- convert_to_int(val);
+ convert_to_long(val);
if (Z_LVAL_P(val) > SHRT_MAX || Z_LVAL_P(val) < SHRT_MIN) {
_php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
return FAILURE;
*(short *) buf = (short) Z_LVAL_P(val);
break;
case SQL_LONG:
- convert_to_int(val);
+ convert_to_long(val);
#if (SIZEOF_LONG > 4)
if (Z_LVAL_P(val) > ISC_LONG_MAX || Z_LVAL_P(val) < ISC_LONG_MIN) {
_php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC);
break;
case SQL_INT64:
#if (SIZEOF_LONG >= 8)
- convert_to_int(val);
+ convert_to_long(val);
*(long *) buf = Z_LVAL_P(val);
#else
convert_to_string(val);
tpb_len = 0;
- convert_to_int_ex(&args[i]);
+ convert_to_long_ex(&args[i]);
trans_argl = Z_LVAL(args[i]);
if (trans_argl != PHP_IBASE_DEFAULT) {
return 0;
}
- convert_to_int(&result);
+ convert_to_long(&result);
if( Z_LVAL(result) < 0 )
return -1;
if (z_parse_pos) {
ZVAL_DEREF(z_parse_pos);
- convert_to_int(z_parse_pos);
+ convert_to_long(z_parse_pos);
parse_pos = (int32_t)Z_LVAL_P(z_parse_pos);
if(parse_pos > text_len) {
RETURN_FALSE;
if (z_parse_pos) {
ZVAL_DEREF(z_parse_pos);
- convert_to_int(z_parse_pos);
+ convert_to_long(z_parse_pos);
parse_pos = (int32_t)Z_LVAL_P(z_parse_pos);
if(parse_pos > text_len) {
RETURN_FALSE;
case UNUM_MIN_SIGNIFICANT_DIGITS:
case UNUM_MAX_SIGNIFICANT_DIGITS:
case UNUM_LENIENT_PARSE:
- convert_to_int_ex(value);
+ convert_to_long_ex(value);
unum_setAttribute(FORMATTER_OBJECT(nfo), attribute, Z_LVAL_P(value));
break;
case UNUM_ROUNDING_INCREMENT:
switch(type) {
case FORMAT_TYPE_INT32:
- convert_to_int_ex(number);
+ convert_to_long_ex(number);
formatted_len = unum_format(FORMATTER_OBJECT(nfo), (int32_t)Z_LVAL_P(number),
formatted, formatted_len, NULL, &INTL_DATA_ERROR_CODE(nfo));
if (INTL_DATA_ERROR_CODE(nfo) == U_BUFFER_OVERFLOW_ERROR) {
if(zposition) {
ZVAL_DEREF(zposition);
- convert_to_int(zposition);
+ convert_to_long(zposition);
position = (int32_t)Z_LVAL_P( zposition );
position_p = &position;
}
if(zposition) {
ZVAL_DEREF(zposition);
- convert_to_int(zposition);
+ convert_to_long(zposition);
position = (int32_t)Z_LVAL_P( zposition );
position_p = &position;
}
break;
case IS_TRUE:
case IS_FALSE:
- convert_to_int_ex(elem);
+ convert_to_long_ex(elem);
/* Intentional fallthrough */
case IS_LONG:
formattable.setInt64((int64_t)Z_LVAL_P(elem));
}
} else if (Z_TYPE_P(arg) == IS_DOUBLE) {
double_offset:
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
goto int_offset;
} else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) {
zend_long lval;
{
int val;
- convert_to_int_ex(newval);
+ convert_to_long_ex(newval);
val = Z_LVAL_P(newval);
if (ldap_set_option(ldap, option, &val)) {
RETURN_FALSE;
{
struct timeval timeout;
- convert_to_int_ex(newval);
+ convert_to_long_ex(newval);
timeout.tv_sec = Z_LVAL_P(newval);
timeout.tv_usec = 0;
if (ldap_set_option(ldap, LDAP_OPT_NETWORK_TIMEOUT, (void *) &timeout)) {
{
int timeout;
- convert_to_int_ex(newval);
+ convert_to_long_ex(newval);
timeout = 1000 * Z_LVAL_P(newval); /* Convert to milliseconds */
if (ldap_set_option(ldap, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) {
RETURN_FALSE;
ZVAL_COPY_VALUE(&cb_args[0], cb_link);
ZVAL_STRING(&cb_args[1], url);
if (call_user_function_ex(EG(function_table), NULL, &ld->rebindproc, &cb_retval, 2, cb_args, 0, NULL TSRMLS_CC) == SUCCESS && !Z_ISUNDEF(cb_retval)) {
- convert_to_int_ex(&cb_retval);
+ convert_to_long_ex(&cb_retval);
retval = Z_LVAL(cb_retval);
zval_ptr_dtor(&cb_retval);
} else {
} else if (strncasecmp("entity", Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)) == 0) {
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_ENTITY;
} else {
- convert_to_int_ex(arg1);
+ convert_to_long_ex(arg1);
if (Z_LVAL_P(arg1) < 0xffff && Z_LVAL_P(arg1) > 0x0) {
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
}
break;
default:
- convert_to_int_ex(arg1);
+ convert_to_long_ex(arg1);
if (Z_LVAL_P(arg1) < 0xffff && Z_LVAL_P(arg1) > 0x0) {
MBSTRG(current_filter_illegal_mode) = MBFL_OUTPUTFILTER_ILLEGAL_MODE_CHAR;
MBSTRG(current_filter_illegal_substchar) = Z_LVAL_P(arg1);
}
if (str_flg) {
- convert_to_int_ex(zoffset);
+ convert_to_long_ex(zoffset);
offset = Z_LVAL_P(zoffset);
} else {
enc_name = enc_name2;
enc_name_len = enc_name_len2;
}
} else {
- convert_to_int_ex(zoffset);
+ convert_to_long_ex(zoffset);
offset = Z_LVAL_P(zoffset);
}
}
if (argc < 3 || Z_TYPE_P(z_len) == IS_NULL) {
len = str_len;
} else {
- convert_to_int_ex(z_len);
+ convert_to_long_ex(z_len);
len = Z_LVAL_P(z_len);
}
if (argc < 3 || Z_TYPE_P(z_len) == IS_NULL) {
len = string.len;
} else {
- convert_to_int_ex(z_len);
+ convert_to_long_ex(z_len);
len = Z_LVAL_P(z_len);
}
mapelm = convmap;
mapsize = 0;
ZEND_HASH_FOREACH_VAL(target_hash, hash_entry) {
- convert_to_int_ex(hash_entry);
+ convert_to_long_ex(hash_entry);
*mapelm++ = Z_LVAL_P(hash_entry);
mapsize++;
} ZEND_HASH_FOREACH_END();
if (Z_TYPE_P(arg_pattern) != IS_STRING) {
/* we convert numbers to integers and treat them as a string */
if (Z_TYPE_P(arg_pattern) == IS_DOUBLE) {
- convert_to_int_ex(arg_pattern); /* get rid of decimal places */
+ convert_to_long_ex(arg_pattern); /* get rid of decimal places */
}
convert_to_string_ex(arg_pattern);
/* don't bother doing an extended regex with just a number */
arg_pattern_len = Z_STRLEN_P(arg_pattern_zval);
} else {
/* FIXME: this code is not multibyte aware! */
- convert_to_int_ex(arg_pattern_zval);
+ convert_to_long_ex(arg_pattern_zval);
pat_buf[0] = (char)Z_LVAL_P(arg_pattern_zval);
pat_buf[1] = '\0';
MCRYPT_GET_CRYPT_ARGS
- convert_to_int_ex(mode);
+ convert_to_long_ex(mode);
php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ecb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
}
MCRYPT_GET_CRYPT_ARGS
- convert_to_int_ex(mode);
+ convert_to_long_ex(mode);
php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cbc", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
}
MCRYPT_GET_CRYPT_ARGS
- convert_to_int_ex(mode);
+ convert_to_long_ex(mode);
php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "cfb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
}
MCRYPT_GET_CRYPT_ARGS
- convert_to_int_ex(mode);
+ convert_to_long_ex(mode);
php_mcrypt_do_crypt(cipher, key, key_len, data, data_len, "ofb", iv, iv_len, Z_LVAL_P(mode), return_value TSRMLS_CC);
}
case SQLINT1:
case SQLINT2:
case SQLINT4:
- convert_to_int_ex(&bind->zval);
+ convert_to_long_ex(&bind->zval);
/* FIXME this works only on little endian machine !!! */
Z_LVAL_P(bind->zval) = *((int *)(dbretdata(mssql_ptr->link,i)));
break;
if (statement->binds != NULL) { /* Maybe a non-parameter sp */
if (zend_hash_find(statement->binds, "RETVAL", 6, (void**)&bind)==SUCCESS) {
if (dbhasretstat(mssql_ptr->link)) {
- convert_to_int_ex(&bind->zval);
+ convert_to_long_ex(&bind->zval);
Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link);
}
else {
break;
}
default:
- convert_to_int_ex(field);
+ convert_to_long_ex(field);
field_offset = Z_LVAL_PP(field);
if (field_offset<0 || field_offset>=result->num_fields) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
case SQLINT1:
case SQLINT2:
case SQLINT4:
- convert_to_int_ex(var);
+ convert_to_long_ex(var);
value=(LPBYTE)(&Z_LVAL_PP(var));
break;
}
break;
default:
- convert_to_int_ex(field);
+ convert_to_long_ex(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= (int)mysql_num_fields(mysql_result)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
break;
case MYSQL_TYPE_LONGLONG:
case MYSQL_TYPE_LONG:
- convert_to_int_ex(param);
+ convert_to_long_ex(param);
stmt->stmt->params[i].buffer = &Z_LVAL_P(param);
break;
default:
convert_to_string_ex(mysql_value);
break;
case IS_LONG:
- convert_to_int_ex(mysql_value);
+ convert_to_long_ex(mysql_value);
break;
default:
break;
/* 1. Here comes the error no */
entry = zend_hash_get_current_data(Z_ARRVAL(row));
- convert_to_int_ex(entry);
+ convert_to_long_ex(entry);
errno = Z_LVAL_P(entry);
zend_hash_move_forward(Z_ARRVAL(row));
stmt->send_types_to_server = *resend_types_next_time = 1;
convert_to_string_ex(tmp_data);
} else {
- convert_to_int_ex(tmp_data);
+ convert_to_long_ex(tmp_data);
}
zval_ptr_dtor(&tmp_data_copy);
current_type = MYSQL_TYPE_VAR_STRING;
/*
don't change stmt->param_bind[i].type to MYSQL_TYPE_VAR_STRING
- we force convert_to_int_ex in all cases, thus the type will be right in the next switch.
+ we force convert_to_long_ex in all cases, thus the type will be right in the next switch.
if the type is however not long, then we will do a goto in the next switch.
We want to preserve the original bind type given by the user. Thus, we do these hacks.
*/
if (Z_TYPE_P(tmp_data) == IS_STRING) {
goto use_string;
}
- convert_to_int_ex(tmp_data);
+ convert_to_long_ex(tmp_data);
}
*data_size += 4 + is_longlong;
break;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind");
return 1;
}
- convert_to_int(var);
+ convert_to_long(var);
bind_data = (ub4 *)&Z_LVAL_P(var);
value_sz = sizeof(ub4);
mode = OCI_DEFAULT;
/* NB: for PHP4 compat only, it should be using 'Z' instead */
tmp = *column_index;
zval_copy_ctor(&tmp);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
column = php_oci_statement_get_column(statement, Z_LVAL(tmp), NULL, 0 TSRMLS_CC);
if (!column) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL(tmp));
bind->array.element_lengths[i] = sizeof(ub4);
}
if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- convert_to_int_ex(entry);
+ convert_to_long_ex(entry);
((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_PP(entry);
zend_hash_move_forward(hash);
} else {
if ( Z_TYPE_PP(col) == IS_STRING ) {
field = Z_STRVAL_PP(col);
} else {
- convert_to_int_ex(col);
+ convert_to_long_ex(col);
indx = Z_LVAL_PP(col);
}
if ( field ) {
if (Z_TYPE_P(pv_field) == IS_STRING) {
field = Z_STRVAL_P(pv_field);
} else {
- convert_to_int_ex(pv_field);
+ convert_to_long_ex(pv_field);
field_ind = Z_LVAL_P(pv_field) - 1;
}
convert_to_boolean(&res);
break;
case IS_LONG:
- convert_to_int(&res);
+ convert_to_long(&res);
break;
case IS_DOUBLE:
convert_to_double(&res);
case ZEND_SR:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP1_LITERAL(opline)) != IS_LONG) {
- convert_to_int(&ZEND_OP1_LITERAL(opline));
+ convert_to_long(&ZEND_OP1_LITERAL(opline));
}
}
/* break missing *intentionally - the assign_op's may only optimize op2 */
}
if (ZEND_OP2_TYPE(opline) == IS_CONST) {
if (Z_TYPE(ZEND_OP2_LITERAL(opline)) != IS_LONG) {
- convert_to_int(&ZEND_OP2_LITERAL(opline));
+ convert_to_long(&ZEND_OP2_LITERAL(opline));
}
}
break;
if (ZEND_OP2_TYPE(opline) != IS_CONST) {
break;
}
- convert_to_int(&ZEND_OP2_LITERAL(opline));
+ convert_to_long(&ZEND_OP2_LITERAL(opline));
nest_levels = ZEND_OP2_LITERAL(opline).value.lval;
array_offset = ZEND_OP1(opline).opline_num;
/* Simplify ssl context option retrieval */
#define GET_VER_OPT(name) (PHP_STREAM_CONTEXT(stream) && (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "ssl", name)) != NULL)
#define GET_VER_OPT_STRING(name, str) if (GET_VER_OPT(name)) { convert_to_string_ex(val); str = Z_STRVAL_P(val); }
-#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_int_ex(val); num = Z_LVAL_P(val); }
+#define GET_VER_OPT_LONG(name, num) if (GET_VER_OPT(name)) { convert_to_long_ex(val); num = Z_LVAL_P(val); }
/* Used for peer verification in windows */
#define PHP_X509_NAME_ENTRY_TO_UTF8(ne, i, out) ASN1_STRING_to_UTF8(&out, X509_NAME_ENTRY_get_data(X509_NAME_get_entry(ne, i)))
NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "reneg_limit"))
) {
- convert_to_int(val);
+ convert_to_long(val);
limit = Z_LVAL_P(val);
}
NULL != (val = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream),
"ssl", "reneg_window"))
) {
- convert_to_int(val);
+ convert_to_long(val);
window = Z_LVAL_P(val);
}
zval *val;
if (ctx && (val = php_stream_context_get_option(ctx, "ssl", "crypto_method")) != NULL) {
- convert_to_int_ex(val);
+ convert_to_long_ex(val);
crypto_method = (zend_long)Z_LVAL_P(val);
crypto_method |= STREAM_CRYPTO_IS_CLIENT;
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz/|l", &pid, &z_status, &options) == FAILURE)
return;
- convert_to_int_ex(z_status);
+ convert_to_long_ex(z_status);
status = Z_LVAL_P(z_status);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/|l", &z_status, &options) == FAILURE)
return;
- convert_to_int_ex(z_status);
+ convert_to_long_ex(z_status);
status = Z_LVAL_P(z_status);
#ifdef HAVE_WAIT3
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(user_set), user_signo) {
if (Z_TYPE_P(user_signo) != IS_LONG) {
SEPARATE_ZVAL(user_signo);
- convert_to_int_ex(user_signo);
+ convert_to_long_ex(user_signo);
}
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(user_set), user_signo) {
if (Z_TYPE_P(user_signo) != IS_LONG) {
SEPARATE_ZVAL(user_signo);
- convert_to_int_ex(user_signo);
+ convert_to_long_ex(user_signo);
}
signo = Z_LVAL_P(user_signo);
if (sigaddset(&set, signo) != 0) {
Z_STRVAL_P(v));
is_persistent = 1;
} else {
- convert_to_int_ex(v);
+ convert_to_long_ex(v);
is_persistent = Z_LVAL_P(v) ? 1 : 0;
plen = spprintf(&hashkey, 0, "PDO:DBH:DSN=%s:%s:%s", data_source,
username ? username : "",
switch (attr) {
case PDO_ATTR_ERRMODE:
PDO_LONG_PARAM_CHECK;
- convert_to_int(value);
+ convert_to_long(value);
switch (Z_LVAL_P(value)) {
case PDO_ERRMODE_SILENT:
case PDO_ERRMODE_WARNING:
case PDO_ATTR_CASE:
PDO_LONG_PARAM_CHECK;
- convert_to_int(value);
+ convert_to_long(value);
switch (Z_LVAL_P(value)) {
case PDO_CASE_NATURAL:
case PDO_CASE_UPPER:
case PDO_ATTR_ORACLE_NULLS:
PDO_LONG_PARAM_CHECK;
- convert_to_int(value);
+ convert_to_long(value);
dbh->oracle_nulls = Z_LVAL_P(value);
return SUCCESS;
} else {
PDO_LONG_PARAM_CHECK;
}
- convert_to_int(value);
+ convert_to_long(value);
if (Z_LVAL_P(value) == PDO_FETCH_USE_DEFAULT) {
pdo_raise_impl_error(dbh, NULL, "HY000", "invalid fetch mode type" TSRMLS_CC);
return FAILURE;
case PDO_ATTR_STRINGIFY_FETCHES:
PDO_LONG_PARAM_CHECK;
- convert_to_int(value);
+ convert_to_long(value);
dbh->stringify = Z_LVAL_P(value) ? 1 : 0;
return SUCCESS;
case IS_FALSE:
case IS_TRUE:
- convert_to_int(&tmp_param);
+ convert_to_long(&tmp_param);
/* fall through */
case IS_LONG:
case IS_DOUBLE:
case IS_FALSE:
case IS_TRUE:
- convert_to_int(&tmp_param);
+ convert_to_long(&tmp_param);
/* fall through */
case IS_LONG:
case IS_DOUBLE:
convert_to_string(parameter);
}
} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_INT && (Z_TYPE_P(parameter) == IS_FALSE || Z_TYPE_P(parameter) == IS_TRUE)) {
- convert_to_int(parameter);
+ convert_to_long(parameter);
} else if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL && Z_TYPE_P(parameter) == IS_LONG) {
convert_to_boolean(parameter);
}
if (type != new_type) {
switch (new_type) {
case PDO_PARAM_INT:
- convert_to_int_ex(dest);
+ convert_to_long_ex(dest);
break;
case PDO_PARAM_BOOL:
convert_to_boolean_ex(dest);
stmt->fetch.column = how & PDO_FETCH_GROUP ? -1 : 0;
break;
case 2:
- convert_to_int(arg2);
+ convert_to_long(arg2);
stmt->fetch.column = Z_LVAL_P(arg2);
break;
case 3:
zval *v;
if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) {
- convert_to_int_ex(v);
+ convert_to_long_ex(v);
return Z_LVAL_P(v);
}
return defval;
PDO_DBG_RETURN(1);
#ifndef PDO_USE_MYSQLND
case PDO_MYSQL_ATTR_MAX_BUFFER_SIZE:
- convert_to_int(val);
+ convert_to_long(val);
if (Z_LVAL_P(val) < 0) {
/* TODO: Johannes, can we throw a warning here? */
((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = 1024*1024;
dbh->in_txn = 0;
}
- convert_to_int(val);
+ convert_to_long(val);
dbh->auto_commit = Z_LVAL_P(val);
return 1;
switch (attr) {
case PDO_ATTR_EMULATE_PREPARES:
- convert_to_int(val);
+ convert_to_long(val);
H->emulate_prepares = Z_LVAL_P(val);
return 1;
case PDO_PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT:
- convert_to_int(val);
+ convert_to_long(val);
php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead");
H->disable_native_prepares = Z_LVAL_P(val);
return 1;
case PDO_PGSQL_ATTR_DISABLE_PREPARES:
- convert_to_int(val);
+ convert_to_long(val);
H->disable_prepares = Z_LVAL_P(val);
return 1;
default:
switch (attr) {
case PDO_ATTR_TIMEOUT:
- convert_to_int(val);
+ convert_to_long(val);
sqlite3_busy_timeout(H->db, Z_LVAL_P(val) * 1000);
return 1;
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the callback");
} else if (!Z_ISUNDEF(retval)) {
if (Z_TYPE(retval) != IS_LONG) {
- convert_to_int_ex(&retval);
+ convert_to_long_ex(&retval);
}
ret = 0;
if (Z_LVAL(retval) > 0) {
return 1;
}
} else {
- convert_to_int(parameter);
+ convert_to_long(parameter);
#if ZEND_LONG_MAX > 2147483647
if (SQLITE_OK == sqlite3_bind_int64(S->stmt, param->paramno + 1, Z_LVAL_P(parameter))) {
return 1;
connstring = Z_STRVAL(args[0]);
} else if (ZEND_NUM_ARGS() == 2 ) { /* Safe to add conntype_option, since 2 args was illegal */
connstring = Z_STRVAL(args[0]);
- convert_to_int_ex(&args[1]);
+ convert_to_long_ex(&args[1]);
connect_type = Z_LVAL(args[1]);
} else {
host = Z_STRVAL(args[0]);
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
break;
default:
- convert_to_int_ex(field);
+ convert_to_long_ex(field);
field_offset = Z_LVAL_P(field);
break;
}
if (zrow == NULL) {
row = -1;
} else {
- convert_to_int(zrow);
+ convert_to_long(zrow);
row = Z_LVAL_P(zrow);
if (row < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The row parameter must be greater or equal to zero");
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
break;
default:
- convert_to_int_ex(field);
+ convert_to_long_ex(field);
field_offset = Z_LVAL_P(field);
break;
}
case IS_DOUBLE:
ZVAL_DOUBLE(&new_val, Z_DVAL_P(val));
- convert_to_int_ex(&new_val);
+ convert_to_long_ex(&new_val);
break;
case IS_LONG:
}
else {
ZVAL_STRINGL(&new_val, Z_STRVAL_P(val), Z_STRLEN_P(val));
- convert_to_int_ex(&new_val);
+ convert_to_long_ex(&new_val);
}
}
break;
case IS_DOUBLE:
ZVAL_DOUBLE(&new_val, Z_DVAL_P(val));
- convert_to_int_ex(&new_val);
+ convert_to_long_ex(&new_val);
break;
case IS_LONG:
}
break;
default:
- convert_to_int_ex(z_fd);
+ convert_to_long_ex(z_fd);
fd = Z_LVAL_P(z_fd);
}
#if defined(ZTS) && defined(HAVE_TTYNAME_R) && defined(_SC_TTY_NAME_MAX)
}
break;
default:
- convert_to_int_ex(z_fd);
+ convert_to_long_ex(z_fd);
fd = Z_LVAL_P(z_fd);
}
} else if (!strcasecmp(what, "done")) {
oldval = rl_done;
if (value) {
- convert_to_int_ex(value);
+ convert_to_long_ex(value);
rl_done = Z_LVAL_P(value);
}
RETVAL_LONG(oldval);
} else if (!strcasecmp(what, "erase_empty_line")) {
oldval = rl_erase_empty_line;
if (value) {
- convert_to_int_ex(value);
+ convert_to_long_ex(value);
rl_erase_empty_line = Z_LVAL_PP(value);
}
RETVAL_LONG(oldval);
} else if (!strcasecmp(what, "attempted_completion_over")) {
oldval = rl_attempted_completion_over;
if (value) {
- convert_to_int_ex(value);
+ convert_to_long_ex(value);
rl_attempted_completion_over = Z_LVAL_P(value);
}
RETVAL_LONG(oldval);
convert_to_boolean(object);
break;
case IS_LONG:
- convert_to_int(object);
+ convert_to_long(object);
break;
case IS_DOUBLE:
convert_to_double(object);
zval_ptr_dtor(&intern->tmp);
}
ZVAL_ZVAL(&intern->tmp, &rv, 0, 0);
- convert_to_int(&intern->tmp);
+ convert_to_long(&intern->tmp);
*count = (zend_long)Z_LVAL(intern->tmp);
return SUCCESS;
}
if (Z_TYPE_P(newval) != IS_LONG) {
ztmp = *newval;
zval_copy_ctor(&ztmp);
- convert_to_int(&ztmp);
+ convert_to_long(&ztmp);
newval = &ztmp;
}
if (Z_TYPE_P(newval) != IS_LONG) {
ztmp = *newval;
zval_copy_ctor(&ztmp);
- convert_to_int(&ztmp);
+ convert_to_long(&ztmp);
newval = &ztmp;
}
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ZVAL_COPY(&ztmp, newval);
- convert_to_int(&ztmp);
+ convert_to_long(&ztmp);
newval = &ztmp;
}
int ret = SUCCESS;
if (Z_TYPE_P(newval) != IS_LONG) {
ZVAL_COPY(&ztmp, newval);
- convert_to_int(&ztmp);
+ convert_to_long(&ztmp);
newval = &ztmp;
}
zval_copy_ctor(&tmp);
if (Z_TYPE(tmp) != IS_LONG) {
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
}
convert_to_string(&tmp);
xmlNodeSetContentLen(ret, BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp));
/* if not long we're operating on lzval */
case IS_DOUBLE:
double_case:
- convert_to_int(&lzval);
+ convert_to_long(&lzval);
goto long_case;
case IS_OBJECT:
goto ipv4_loop_ttl;
case IP_MULTICAST_TTL:
- convert_to_int_ex(arg4);
+ convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < 0L || Z_LVAL_P(arg4) > 255L) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Expected a value between 0 and 255");
ov = (int) Z_TYPE_P(arg4) == IS_TRUE;
goto ipv6_loop_hops;
case IPV6_MULTICAST_HOPS:
- convert_to_int_ex(arg4);
+ convert_to_long_ex(arg4);
if (Z_LVAL_P(arg4) < -1L || Z_LVAL_P(arg4) > 255L) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Expected a value between -1 and 255");
if (Z_TYPE_P(sec) != IS_LONG) {
tmp = *sec;
zval_copy_ctor(&tmp);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
sec = &tmp;
}
RETURN_FALSE;
}
- convert_to_int_ex(l_onoff);
- convert_to_int_ex(l_linger);
+ convert_to_long_ex(l_onoff);
+ convert_to_long_ex(l_linger);
lv.l_onoff = (unsigned short)Z_LVAL_P(l_onoff);
lv.l_linger = (unsigned short)Z_LVAL_P(l_linger);
RETURN_FALSE;
}
- convert_to_int_ex(sec);
- convert_to_int_ex(usec);
+ convert_to_long_ex(sec);
+ convert_to_long_ex(usec);
#ifndef PHP_WIN32
tv.tv_sec = Z_LVAL_P(sec);
tv.tv_usec = Z_LVAL_P(usec);
default:
default_case:
- convert_to_int_ex(arg4);
+ convert_to_long_ex(arg4);
ov = Z_LVAL_P(arg4);
optlen = sizeof(ov);
if (Z_TYPE(rv) != IS_UNDEF) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- convert_to_int(&intern->retval);
+ convert_to_long(&intern->retval);
*count = (zend_long)Z_LVAL(intern->retval);
return SUCCESS;
}
if (!Z_ISUNDEF(rv)) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- convert_to_int(&intern->retval);
+ convert_to_long(&intern->retval);
*count = (zend_long) Z_LVAL(intern->retval);
return SUCCESS;
}
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_int(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex TSRMLS_CC);
RETURN_BOOL(index >= 0 && index < intern->llist->count);
} /* }}} */
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_int(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex TSRMLS_CC);
if (index < 0 || index >= intern->llist->count) {
zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
zend_long index;
spl_ptr_llist_element *element;
- index = spl_offset_convert_to_int(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex TSRMLS_CC);
if (index < 0 || index >= intern->llist->count) {
zval_ptr_dtor(value);
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_int(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex TSRMLS_CC);
llist = intern->llist;
if (index < 0 || index >= intern->llist->count) {
}
intern = Z_SPLDLLIST_P(getThis());
- index = spl_offset_convert_to_int(zindex TSRMLS_CC);
+ index = spl_offset_convert_to_long(zindex TSRMLS_CC);
if (index < 0 || index > intern->llist->count) {
zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0 TSRMLS_CC);
}
/* }}} */
-PHPAPI zend_long spl_offset_convert_to_int(zval *offset TSRMLS_DC) /* {{{ */
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
{
zend_ulong idx;
PHPAPI void spl_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC);
-PHPAPI zend_long spl_offset_convert_to_int(zval *offset TSRMLS_DC);
+PHPAPI zend_long spl_offset_convert_to_long(zval *offset TSRMLS_DC);
/* {{{ spl_instantiate_arg_ex1 */
static inline int spl_instantiate_arg_ex1(zend_class_entry *pce, zval *retval, zval *arg1 TSRMLS_DC)
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_int(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset TSRMLS_CC);
} else {
index = Z_LVAL_P(offset);
}
}
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_int(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset TSRMLS_CC);
} else {
index = Z_LVAL_P(offset);
}
zend_long index;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_int(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset TSRMLS_CC);
} else {
index = Z_LVAL_P(offset);
}
int retval;
if (Z_TYPE_P(offset) != IS_LONG) {
- index = spl_offset_convert_to_int(offset TSRMLS_CC);
+ index = spl_offset_convert_to_long(offset TSRMLS_CC);
} else {
index = Z_LVAL_P(offset);
}
if (!Z_ISUNDEF(rv)) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- convert_to_int(&intern->retval);
+ convert_to_long(&intern->retval);
*count = (zend_long) Z_LVAL(intern->retval);
return SUCCESS;
}
return FAILURE;
}
- convert_to_int(&zresult);
+ convert_to_long(&zresult);
*result = Z_LVAL(zresult);
zval_ptr_dtor(&zresult);
if (!Z_ISUNDEF(rv)) {
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
- convert_to_int(&intern->retval);
+ convert_to_long(&intern->retval);
*count = (zend_long) Z_LVAL(intern->retval);
return SUCCESS;
}
switch (param->type) {
case SQLITE_INTEGER:
- convert_to_int(parameter);
+ convert_to_long(parameter);
#if ZEND_LONG_MAX > 2147483647
sqlite3_bind_int64(stmt_obj->stmt, param->param_number, Z_LVAL_P(parameter));
#else
const char *name TSRMLS_DC) {
switch (Z_TYPE_P(param)) {
case IS_DOUBLE:
- convert_to_int_ex(param);
+ convert_to_long_ex(param);
/* fallthrough */
case IS_LONG:
return 1;
return ZEND_NORMALIZE_BOOL(Z_DVAL(result));
}
- convert_to_int(&result);
+ convert_to_long(&result);
return ZEND_NORMALIZE_BOOL(Z_LVAL(result));
}
/* }}} */
if (Z_TYPE_PP(tmpval) != IS_LONG) {
tmp = *ztval;
zval_copy_ctor(&tmp);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
ztval = &tmp;
}
*pretval = Z_LVAL_P(ztval);
if (Z_TYPE_P(tmpval) != IS_LONG) {
ZVAL_DUP(&tmp, tmpval);;
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
tmpval = &tmp;
}
if (Z_LVAL_P(tmpval) < 0) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
return;
}
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
result = _php_math_longtobase(arg, 2 TSRMLS_CC);
RETURN_STR(result);
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
return;
}
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
result = _php_math_longtobase(arg, 8 TSRMLS_CC);
RETURN_STR(result);
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) {
return;
}
- convert_to_int_ex(arg);
+ convert_to_long_ex(arg);
result = _php_math_longtobase(arg, 16 TSRMLS_CC);
RETURN_STR(result);
}
int i;
char *v;
- convert_to_int_ex(val);
+ convert_to_long_ex(val);
v = (char *) &Z_LVAL_P(val);
for (i = 0; i < size; i++) {
if (Z_TYPE_P(option_buffer) != IS_LONG) {
zval cast_option_buffer;
ZVAL_DUP(&cast_option_buffer, option_buffer);
- convert_to_int(&cast_option_buffer);
+ convert_to_long(&cast_option_buffer);
new_cost = Z_LVAL(cast_option_buffer);
zval_dtor(&cast_option_buffer);
} else {
if (Z_TYPE_P(option_buffer) != IS_LONG) {
zval cast_option_buffer;
ZVAL_DUP(&cast_option_buffer, option_buffer);
- convert_to_int(&cast_option_buffer);
+ convert_to_long(&cast_option_buffer);
cost = Z_LVAL(cast_option_buffer);
zval_dtor(&cast_option_buffer);
} else {
scan_set_error_return( numVars, return_value );
result = SCAN_ERROR_EOF;
} else if (numVars) {
- convert_to_int(return_value );
+ convert_to_long(return_value );
Z_LVAL_P(return_value) = nconversions;
} else if (nconversions < totalVars) {
/* TODO: not all elements converted. we need to prune the list - cc */
/* If seconds is not set to null, build the timeval, else we wait indefinitely */
if (sec != NULL) {
- convert_to_int_ex(sec);
+ convert_to_long_ex(sec);
if (Z_LVAL_P(sec) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0");
{
zval holder = *needle;
zval_copy_ctor(&(holder));
- convert_to_int(&(holder));
+ convert_to_long(&(holder));
if(Z_TYPE(holder) != IS_LONG) {
return FAILURE;
}
convert_to_string_ex(repl);
}
if (Z_TYPE_P(from) != IS_ARRAY) {
- convert_to_int_ex(from);
+ convert_to_long_ex(from);
}
if (argc > 3) {
ZVAL_DEREF(var);
SEPARATE_ZVAL_NOREF(var);
if (!strcasecmp(type, "integer")) {
- convert_to_int(var);
+ convert_to_long(var);
} else if (!strcasecmp(type, "int")) {
- convert_to_int(var);
+ convert_to_long(var);
} else if (!strcasecmp(type, "float")) {
convert_to_double(var);
} else if (!strcasecmp(type, "double")) { /* deprecated */
#endif
RETVAL_ZVAL(num, 1, 0);
- convert_to_int_base(return_value, base);
+ convert_to_long_base(return_value, base);
}
/* }}} */
zval_ptr_dtor(&func_name);
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
- convert_to_int(&retval);
+ convert_to_long(&retval);
ret = Z_LVAL(retval);
} else if (call_result == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function");
break;
}
default:
- convert_to_int(field);
+ convert_to_long(field);
field_offset = Z_LVAL_P(field);
if (field_offset < 0 || field_offset >= result->num_fields) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad column offset specified");
/* now pull out members of data and set them in the stat buffer */
if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.uid", sizeof("msg_perm.uid") - 1)) != NULL) {
- convert_to_int_ex(item);
+ convert_to_long_ex(item);
stat.msg_perm.uid = Z_LVAL_P(item);
}
if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.gid", sizeof("msg_perm.gid") - 1)) != NULL) {
- convert_to_int_ex(item);
+ convert_to_long_ex(item);
stat.msg_perm.gid = Z_LVAL_P(item);
}
if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_perm.mode", sizeof("msg_perm.mode") - 1)) != NULL) {
- convert_to_int_ex(item);
+ convert_to_long_ex(item);
stat.msg_perm.mode = Z_LVAL_P(item);
}
if ((item = zend_hash_str_find(Z_ARRVAL_P(data), "msg_qbytes", sizeof("msg_qbytes") - 1)) != NULL) {
- convert_to_int_ex(item);
+ convert_to_long_ex(item);
stat.msg_qbytes = Z_LVAL_P(item);
}
if (msgctl(mq->id, IPC_SET, &stat) == 0) {
case TidyInteger:
if (Z_TYPE(conv) != IS_LONG) {
zval_copy_ctor(&conv);
- convert_to_int(&conv);
+ convert_to_long(&conv);
}
if (tidyOptSetInt(doc, tidyOptGetId(opt), Z_LVAL(conv))) {
return SUCCESS;
case TidyBoolean:
if (Z_TYPE(conv) != IS_LONG) {
zval_copy_ctor(&conv);
- convert_to_int(&conv);
+ convert_to_long(&conv);
}
if (tidyOptSetBool(doc, tidyOptGetId(opt), Z_LVAL(conv))) {
return SUCCESS;
_xml_xmlchar_zval(publicId, 0, parser->target_encoding, &args[4]);
xml_call_handler(parser, &parser->externalEntityRefHandler, parser->externalEntityRefPtr, 5, args, &retval);
if (!Z_ISUNDEF(retval)) {
- convert_to_int(&retval);
+ convert_to_long(&retval);
ret = Z_LVAL(retval);
} else {
ret = 0;
switch (opt) {
case PHP_XML_OPTION_CASE_FOLDING:
- convert_to_int_ex(val);
+ convert_to_long_ex(val);
parser->case_folding = Z_LVAL_P(val);
break;
case PHP_XML_OPTION_SKIP_TAGSTART:
- convert_to_int_ex(val);
+ convert_to_long_ex(val);
parser->toffset = Z_LVAL_P(val);
break;
case PHP_XML_OPTION_SKIP_WHITE:
- convert_to_int_ex(val);
+ convert_to_long_ex(val);
parser->skipwhite = Z_LVAL_P(val);
break;
case PHP_XML_OPTION_TARGET_ENCODING: {
xReturn = XMLRPC_CreateValueBoolean(key, Z_TYPE(val) == IS_TRUE);
break;
case xmlrpc_int:
- convert_to_int(&val);
+ convert_to_long(&val);
xReturn = XMLRPC_CreateValueInt(key, Z_LVAL(val));
break;
case xmlrpc_double:
ZVAL_STRING(&member, "cloneDocument");
cloneDocu = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
if (Z_TYPE_P(cloneDocu) != IS_NULL) {
- convert_to_int(cloneDocu);
+ convert_to_long(cloneDocu);
clone_docu = Z_LVAL_P(cloneDocu);
}
zval_ptr_dtor(&member);
ZVAL_STRING(&member, "doXInclude");
doXInclude = std_hnd->read_property(id, &member, BP_VAR_IS, NULL, &rv TSRMLS_CC);
if (Z_TYPE_P(doXInclude) != IS_NULL) {
- convert_to_int(doXInclude);
+ convert_to_long(doXInclude);
ctxt->xinclude = Z_LVAL_P(doXInclude);
}
zval_ptr_dtor(&member);
if (Z_TYPE_P(option) != IS_LONG) {
zval tmp;
ZVAL_DUP(&tmp, option);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
opt = Z_LVAL(tmp);
} else {
opt = Z_LVAL_P(option);
/* log-2 base of history window (9 - 15) */
ZVAL_DUP(&tmp, tmpzval);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 32) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter give for window size. (%pd)", Z_LVAL(tmp));
} else {
case IS_OBJECT:
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "memory", sizeof("memory") -1))) {
ZVAL_DUP(&tmp, tmpzval);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
/* Memory Level (1 - 9) */
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > MAX_MEM_LEVEL) {
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), "window", sizeof("window") - 1))) {
ZVAL_DUP(&tmp, tmpzval);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
/* log-2 base of history window (9 - 15) */
if (Z_LVAL(tmp) < -MAX_WBITS || Z_LVAL(tmp) > MAX_WBITS + 16) {
ZVAL_COPY_VALUE(&tmp, filterparams);
factory_setlevel:
zval_copy_ctor(&tmp);
- convert_to_int(&tmp);
+ convert_to_long(&tmp);
/* Set compression level within reason (-1 == default, 0 == none, 1-9 == least to most compression */
if (Z_LVAL(tmp) < -1 || Z_LVAL(tmp) > 9) {
return FAILURE;
}
ZVAL_DUP(&var, tmp);
- convert_to_int(&var);
+ convert_to_long(&var);
*result = Z_LVAL(var);
return SUCCESS;
}
if (PHP_STREAM_CONTEXT(stream) && (zbacklog = php_stream_context_get_option(PHP_STREAM_CONTEXT(stream), "socket", "backlog")) != NULL) {
zval *ztmp = zbacklog;
- convert_to_int_ex(ztmp);
+ convert_to_long_ex(ztmp);
backlog = Z_LVAL_P(ztmp);
if (ztmp != zbacklog) {
zval_ptr_dtor(ztmp);
didwrite = 0;
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
- convert_to_int(&retval);
+ convert_to_long(&retval);
didwrite = Z_LVAL(retval);
} else if (call_result == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " is not implemented!",
#define STAT_PROP_ENTRY_EX(name, name2) \
if (NULL != (elem = zend_hash_str_find(Z_ARRVAL_P(array), #name, sizeof(#name)-1))) { \
SEPARATE_ZVAL(elem); \
- convert_to_int(elem); \
+ convert_to_long(elem); \
ssb->sb.st_##name2 = Z_LVAL_P(elem); \
}