diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:40:40 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:40:40 +0400 |
commit | 050d7e38ad4163e7fa65e26724d3516ce7b33601 (patch) | |
tree | 2bb49b1b73c37b35fc778e83d9353f0eb9cc12a3 /ext/standard | |
parent | 93d3a613d82d32dd6f5499e211bfe194d60898b0 (diff) | |
download | php-git-050d7e38ad4163e7fa65e26724d3516ce7b33601.tar.gz |
Cleanup (1-st round)
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/array.c | 6 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 24 | ||||
-rw-r--r-- | ext/standard/datetime.c | 2 | ||||
-rw-r--r-- | ext/standard/dir.c | 4 | ||||
-rw-r--r-- | ext/standard/dns.c | 68 | ||||
-rw-r--r-- | ext/standard/dns_win32.c | 54 | ||||
-rw-r--r-- | ext/standard/exec.c | 4 | ||||
-rw-r--r-- | ext/standard/file.c | 10 | ||||
-rw-r--r-- | ext/standard/filestat.c | 2 | ||||
-rw-r--r-- | ext/standard/head.c | 2 | ||||
-rw-r--r-- | ext/standard/html.c | 6 | ||||
-rw-r--r-- | ext/standard/image.c | 6 | ||||
-rw-r--r-- | ext/standard/iptc.c | 2 | ||||
-rw-r--r-- | ext/standard/pack.c | 8 | ||||
-rw-r--r-- | ext/standard/password.c | 2 | ||||
-rw-r--r-- | ext/standard/proc_open.c | 4 | ||||
-rw-r--r-- | ext/standard/scanf.c | 8 | ||||
-rw-r--r-- | ext/standard/streamsfuncs.c | 10 | ||||
-rw-r--r-- | ext/standard/string.c | 97 | ||||
-rw-r--r-- | ext/standard/type.c | 2 | ||||
-rw-r--r-- | ext/standard/url.c | 18 | ||||
-rw-r--r-- | ext/standard/user_filters.c | 6 |
22 files changed, 173 insertions, 172 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index bef42feaac..9ddb234186 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1688,7 +1688,7 @@ PHP_FUNCTION(range) goto err; } for (; ch >= *high; ch -= (unsigned int)lstep) { - add_next_index_stringl(return_value, (const char *)&ch, 1, 1); + add_next_index_stringl(return_value, (const char *)&ch, 1); if (((signed int)ch - lstep) < 0) { break; } @@ -1701,13 +1701,13 @@ PHP_FUNCTION(range) goto err; } for (; ch <= *high; ch += (unsigned int)lstep) { - add_next_index_stringl(return_value, (const char *)&ch, 1, 1); + add_next_index_stringl(return_value, (const char *)&ch, 1); if (((signed int)ch + lstep) > 255) { break; } } } else { - add_next_index_stringl(return_value, (const char *)low, 1, 1); + add_next_index_stringl(return_value, (const char *)low, 1); } } else if (Z_TYPE_P(zlow) == IS_DOUBLE || Z_TYPE_P(zhigh) == IS_DOUBLE || is_step_double) { diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0f212a5785..6632e99328 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4766,8 +4766,8 @@ PHP_FUNCTION(error_get_last) if (PG(last_error_message)) { array_init(return_value); add_assoc_long_ex(return_value, "type", sizeof("type")-1, PG(last_error_type)); - add_assoc_string_ex(return_value, "message", sizeof("message")-1, PG(last_error_message), 1); - add_assoc_string_ex(return_value, "file", sizeof("file")-1, PG(last_error_file)?PG(last_error_file):"-", 1 ); + add_assoc_string_ex(return_value, "message", sizeof("message")-1, PG(last_error_message)); + add_assoc_string_ex(return_value, "file", sizeof("file")-1, PG(last_error_file)?PG(last_error_file):"-"); add_assoc_long_ex(return_value, "line", sizeof("line")-1, PG(last_error_lineno)); } } @@ -4788,7 +4788,7 @@ PHP_FUNCTION(call_user_func) fci.retval = &retval; if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } } /* }}} */ @@ -4809,7 +4809,7 @@ PHP_FUNCTION(call_user_func_array) fci.retval = &retval; if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } zend_fcall_info_args_clear(&fci, 1); @@ -4842,7 +4842,7 @@ PHP_FUNCTION(call_user_method) if (call_user_function_ex(EG(function_table), object, callback, &retval, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) { if (Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback)); @@ -4888,7 +4888,7 @@ PHP_FUNCTION(call_user_method_array) if (call_user_function_ex(EG(function_table), object, callback, &retval, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) { if (Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback)); @@ -4922,7 +4922,7 @@ PHP_FUNCTION(forward_static_call) } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } } /* }}} */ @@ -4948,7 +4948,7 @@ PHP_FUNCTION(forward_static_call_array) } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { - COPY_PZVAL_TO_ZVAL(*return_value, &retval); + ZVAL_COPY_VALUE(return_value, &retval); } zend_fcall_info_args_clear(&fci, 1); @@ -5359,15 +5359,15 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze array_init(&option); if (ini_entry->orig_value) { - add_assoc_stringl(&option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1); + add_assoc_stringl(&option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length); } else if (ini_entry->value) { - add_assoc_stringl(&option, "global_value", ini_entry->value, ini_entry->value_length, 1); + add_assoc_stringl(&option, "global_value", ini_entry->value, ini_entry->value_length); } else { add_assoc_null(&option, "global_value"); } if (ini_entry->value) { - add_assoc_stringl(&option, "local_value", ini_entry->value, ini_entry->value_length, 1); + add_assoc_stringl(&option, "local_value", ini_entry->value, ini_entry->value_length); } else { add_assoc_null(&option, "local_value"); } @@ -5377,7 +5377,7 @@ static int php_ini_get_option(zval *zv TSRMLS_DC, int num_args, va_list args, ze add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, &option); } else { if (ini_entry->value) { - add_assoc_stringl(ini_array, ini_entry->name, ini_entry->value, ini_entry->value_length, 1); + add_assoc_stringl(ini_array, ini_entry->name, ini_entry->value, ini_entry->value_length); } else { add_assoc_null(ini_array, ini_entry->name); } diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 69e17240a7..80a34a4548 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -112,7 +112,7 @@ PHP_FUNCTION(strptime) add_assoc_long(return_value, "tm_year", parsed_time.tm_year); add_assoc_long(return_value, "tm_wday", parsed_time.tm_wday); add_assoc_long(return_value, "tm_yday", parsed_time.tm_yday); - add_assoc_string(return_value, "unparsed", unparsed_part, 1); + add_assoc_string(return_value, "unparsed", unparsed_part); } /* }}} */ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 377d3123ea..16cc8db054 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -237,7 +237,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) if (createobject) { object_init_ex(return_value, dir_class_entry_ptr); - add_property_stringl(return_value, "path", dirname, dir_len, 1); + add_property_stringl(return_value, "path", dirname, dir_len); add_property_resource(return_value, "handle", dirp->res); php_stream_auto_cleanup(dirp); /* so we don't get warnings under debug */ } else { @@ -534,7 +534,7 @@ no_results: continue; } } - add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip, 1); + add_next_index_string(return_value, globbuf.gl_pathv[n]+cwd_skip); } globfree(&globbuf); diff --git a/ext/standard/dns.c b/ext/standard/dns.c index d0209fed5e..2501a03170 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -248,7 +248,7 @@ PHP_FUNCTION(gethostbynamel) for (i = 0 ; hp->h_addr_list[i] != 0 ; i++) { in = *(struct in_addr *) hp->h_addr_list[i]; - add_next_index_string(return_value, inet_ntoa(in), 1); + add_next_index_string(return_value, inet_ntoa(in)); } } /* }}} */ @@ -446,60 +446,60 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int array_init(subarray); - add_assoc_string(subarray, "host", name, 1); - add_assoc_string(subarray, "class", "IN", 1); + add_assoc_string(subarray, "host", name); + add_assoc_string(subarray, "class", "IN"); add_assoc_long(subarray, "ttl", ttl); if (raw) { add_assoc_long(subarray, "type", type); - add_assoc_stringl(subarray, "data", (char*) cp, (uint) dlen, 1); + add_assoc_stringl(subarray, "data", (char*) cp, (uint) dlen); cp += dlen; return cp; } switch (type) { case DNS_T_A: - add_assoc_string(subarray, "type", "A", 1); + add_assoc_string(subarray, "type", "A"); snprintf(name, sizeof(name), "%d.%d.%d.%d", cp[0], cp[1], cp[2], cp[3]); - add_assoc_string(subarray, "ip", name, 1); + add_assoc_string(subarray, "ip", name); cp += dlen; break; case DNS_T_MX: - add_assoc_string(subarray, "type", "MX", 1); + add_assoc_string(subarray, "type", "MX"); GETSHORT(n, cp); add_assoc_long(subarray, "pri", n); /* no break; */ case DNS_T_CNAME: if (type == DNS_T_CNAME) { - add_assoc_string(subarray, "type", "CNAME", 1); + add_assoc_string(subarray, "type", "CNAME"); } /* no break; */ case DNS_T_NS: if (type == DNS_T_NS) { - add_assoc_string(subarray, "type", "NS", 1); + add_assoc_string(subarray, "type", "NS"); } /* no break; */ case DNS_T_PTR: if (type == DNS_T_PTR) { - add_assoc_string(subarray, "type", "PTR", 1); + add_assoc_string(subarray, "type", "PTR"); } n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(subarray, "target", name, 1); + add_assoc_string(subarray, "target", name); break; case DNS_T_HINFO: /* See RFC 1010 for values */ - add_assoc_string(subarray, "type", "HINFO", 1); + add_assoc_string(subarray, "type", "HINFO"); n = *cp & 0xFF; cp++; - add_assoc_stringl(subarray, "cpu", (char*)cp, n, 1); + add_assoc_stringl(subarray, "cpu", (char*)cp, n); cp += n; n = *cp & 0xFF; cp++; - add_assoc_stringl(subarray, "os", (char*)cp, n, 1); + add_assoc_stringl(subarray, "os", (char*)cp, n); cp += n; break; case DNS_T_TXT: @@ -507,7 +507,7 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int int ll = 0; zval entries; - add_assoc_string(subarray, "type", "TXT", 1); + add_assoc_string(subarray, "type", "TXT"); tp = emalloc(dlen + 1); array_init(&entries); @@ -515,30 +515,32 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int while (ll < dlen) { n = cp[ll]; memcpy(tp + ll , cp + ll + 1, n); - add_next_index_stringl(&entries, (char*)cp + ll + 1, n, 1); + add_next_index_stringl(&entries, (char*)cp + ll + 1, n); ll = ll + n + 1; } tp[dlen] = '\0'; cp += dlen; - add_assoc_stringl(subarray, "txt", (char*)tp, (dlen>0)?dlen - 1:0, 0); + // TODO: avoid reallocation ??? + add_assoc_stringl(subarray, "txt", (char*)tp, (dlen>0)?dlen - 1:0); + efree(tp); add_assoc_zval(subarray, "entries", &entries); } break; case DNS_T_SOA: - add_assoc_string(subarray, "type", "SOA", 1); + add_assoc_string(subarray, "type", "SOA"); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(subarray, "mname", name, 1); + add_assoc_string(subarray, "mname", name); n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) -2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(subarray, "rname", name, 1); + add_assoc_string(subarray, "rname", name); GETLONG(n, cp); add_assoc_long(subarray, "serial", n); GETLONG(n, cp); @@ -580,12 +582,12 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int tp++; } tp[0] = '\0'; - add_assoc_string(subarray, "type", "AAAA", 1); - add_assoc_string(subarray, "ipv6", name, 1); + add_assoc_string(subarray, "type", "AAAA"); + add_assoc_string(subarray, "ipv6", name); break; case DNS_T_A6: p = cp; - add_assoc_string(subarray, "type", "A6", 1); + add_assoc_string(subarray, "type", "A6"); n = ((int)cp[0]) & 0xFF; cp++; add_assoc_long(subarray, "masklen", n); @@ -648,18 +650,18 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int tp++; } tp[0] = '\0'; - add_assoc_string(subarray, "ipv6", name, 1); + add_assoc_string(subarray, "ipv6", name); if (cp < p + dlen) { n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(subarray, "chain", name, 1); + add_assoc_string(subarray, "chain", name); } break; case DNS_T_SRV: - add_assoc_string(subarray, "type", "SRV", 1); + add_assoc_string(subarray, "type", "SRV"); GETSHORT(n, cp); add_assoc_long(subarray, "pri", n); GETSHORT(n, cp); @@ -671,29 +673,29 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int return NULL; } cp += n; - add_assoc_string(subarray, "target", name, 1); + add_assoc_string(subarray, "target", name); break; case DNS_T_NAPTR: - add_assoc_string(subarray, "type", "NAPTR", 1); + add_assoc_string(subarray, "type", "NAPTR"); GETSHORT(n, cp); add_assoc_long(subarray, "order", n); GETSHORT(n, cp); add_assoc_long(subarray, "pref", n); n = (cp[0] & 0xFF); - add_assoc_stringl(subarray, "flags", (char*)++cp, n, 1); + add_assoc_stringl(subarray, "flags", (char*)++cp, n); cp += n; n = (cp[0] & 0xFF); - add_assoc_stringl(subarray, "services", (char*)++cp, n, 1); + add_assoc_stringl(subarray, "services", (char*)++cp, n); cp += n; n = (cp[0] & 0xFF); - add_assoc_stringl(subarray, "regex", (char*)++cp, n, 1); + add_assoc_stringl(subarray, "regex", (char*)++cp, n); cp += n; n = dn_expand(answer->qb2, answer->qb2+65536, cp, name, (sizeof name) - 2); if (n < 0) { return NULL; } cp += n; - add_assoc_string(subarray, "replacement", name, 1); + add_assoc_string(subarray, "replacement", name); break; default: zval_ptr_dtor(subarray); @@ -1005,7 +1007,7 @@ PHP_FUNCTION(dns_get_mx) RETURN_FALSE; } cp += i; - add_next_index_string(mx_list, buf, 1); + add_next_index_string(mx_list, buf); if (weight_list) { add_next_index_long(weight_list, weight); } diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 2dbf3e2e1d..5fd0da0dea 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -75,7 +75,7 @@ PHP_FUNCTION(dns_get_mx) /* {{{ */ continue; } - add_next_index_string(mx_list, pRec->Data.MX.pNameExchange, 1); + add_next_index_string(mx_list, pRec->Data.MX.pNameExchange); if (weight_list) { add_next_index_long(weight_list, srv->wPriority); } @@ -157,13 +157,13 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, ALLOC_INIT_ZVAL(*subarray); array_init(*subarray); - add_assoc_string(*subarray, "host", pRec->pName, 1); - add_assoc_string(*subarray, "class", "IN", 1); + add_assoc_string(*subarray, "host", pRec->pName); + add_assoc_string(*subarray, "class", "IN"); add_assoc_long(*subarray, "ttl", ttl); if (raw) { add_assoc_long(*subarray, "type", type); - add_assoc_stringl(*subarray, "data", (char*) &pRec->Data, (uint) pRec->wDataLength, 1); + add_assoc_stringl(*subarray, "data", (char*) &pRec->Data, (uint) pRec->wDataLength); return; } @@ -171,33 +171,33 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, case DNS_TYPE_A: { IN_ADDR ipaddr; ipaddr.S_un.S_addr = (pRec->Data.A.IpAddress); - add_assoc_string(*subarray, "type", "A", 1); - add_assoc_string(*subarray, "ip", inet_ntoa(ipaddr), 1); + add_assoc_string(*subarray, "type", "A"); + add_assoc_string(*subarray, "ip", inet_ntoa(ipaddr)); break; } case DNS_TYPE_MX: - add_assoc_string(*subarray, "type", "MX", 1); + add_assoc_string(*subarray, "type", "MX"); add_assoc_long(*subarray, "pri", pRec->Data.Srv.wPriority); /* no break; */ case DNS_TYPE_CNAME: if (type == DNS_TYPE_CNAME) { - add_assoc_string(*subarray, "type", "CNAME", 1); + add_assoc_string(*subarray, "type", "CNAME"); } /* no break; */ case DNS_TYPE_NS: if (type == DNS_TYPE_NS) { - add_assoc_string(*subarray, "type", "NS", 1); + add_assoc_string(*subarray, "type", "NS"); } /* no break; */ case DNS_TYPE_PTR: if (type == DNS_TYPE_PTR) { - add_assoc_string(*subarray, "type", "PTR", 1); + add_assoc_string(*subarray, "type", "PTR"); } - add_assoc_string(*subarray, "target", pRec->Data.MX.pNameExchange, 1); + add_assoc_string(*subarray, "target", pRec->Data.MX.pNameExchange); break; /* Not available on windows, the query is possible but there is no DNS_HINFO_DATA structure */ @@ -211,7 +211,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, long txt_len = 0; zval *entries; - add_assoc_string(*subarray, "type", "TXT", 1); + add_assoc_string(*subarray, "type", "TXT"); ALLOC_INIT_ZVAL(entries); array_init(entries); @@ -225,11 +225,13 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, for (i = 0; i < count; i++) { int len = strlen(data_txt->pStringArray[i]); memcpy(txt_dst, data_txt->pStringArray[i], len); - add_next_index_stringl(entries, data_txt->pStringArray[i], len, 1); + add_next_index_stringl(entries, data_txt->pStringArray[i], len); txt_dst += len; } - add_assoc_string(*subarray, "txt", txt, 0); + // TODO: avoid reallocation ??? + add_assoc_string(*subarray, "txt", txt); + efree(txt); add_assoc_zval(*subarray, "entries", entries); } break; @@ -238,10 +240,10 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, { DNS_SOA_DATA *data_soa = &pRec->Data.Soa; - add_assoc_string(*subarray, "type", "SOA", 1); + add_assoc_string(*subarray, "type", "SOA"); - add_assoc_string(*subarray, "mname", data_soa->pNamePrimaryServer, 1); - add_assoc_string(*subarray, "rname", data_soa->pNameAdministrator, 1); + add_assoc_string(*subarray, "mname", data_soa->pNamePrimaryServer); + add_assoc_string(*subarray, "rname", data_soa->pNameAdministrator); add_assoc_long(*subarray, "serial", data_soa->dwSerialNo); add_assoc_long(*subarray, "refresh", data_soa->dwRefresh); add_assoc_long(*subarray, "retry", data_soa->dwRetry); @@ -294,8 +296,8 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, } tp[0] = '\0'; - add_assoc_string(*subarray, "type", "AAAA", 1); - add_assoc_string(*subarray, "ipv6", buf, 1); + add_assoc_string(*subarray, "type", "AAAA"); + add_assoc_string(*subarray, "ipv6", buf); } break; @@ -309,11 +311,11 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, { DNS_SRV_DATA *data_srv = &pRec->Data.Srv; - add_assoc_string(*subarray, "type", "SRV", 1); + add_assoc_string(*subarray, "type", "SRV"); add_assoc_long(*subarray, "pri", data_srv->wPriority); add_assoc_long(*subarray, "weight", data_srv->wWeight); add_assoc_long(*subarray, "port", data_srv->wPort); - add_assoc_string(*subarray, "target", data_srv->pNameTarget, 1); + add_assoc_string(*subarray, "target", data_srv->pNameTarget); } break; @@ -322,13 +324,13 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, { DNS_NAPTR_DATA * data_naptr = &pRec->Data.Naptr; - add_assoc_string(*subarray, "type", "NAPTR", 1); + add_assoc_string(*subarray, "type", "NAPTR"); add_assoc_long(*subarray, "order", data_naptr->wOrder); add_assoc_long(*subarray, "pref", data_naptr->wPreference); - add_assoc_string(*subarray, "flags", data_naptr->pFlags, 1); - add_assoc_string(*subarray, "services", data_naptr->pService, 1); - add_assoc_string(*subarray, "regex", data_naptr->pRegularExpression, 1); - add_assoc_string(*subarray, "replacement", data_naptr->pReplacement, 1); + add_assoc_string(*subarray, "flags", data_naptr->pFlags); + add_assoc_string(*subarray, "services", data_naptr->pService); + add_assoc_string(*subarray, "regex", data_naptr->pRegularExpression); + add_assoc_string(*subarray, "replacement", data_naptr->pReplacement); } break; #endif diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 70d0d82dda..3b07e00443 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -120,7 +120,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ bufl = l + 1; buf[bufl] = '\0'; } - add_next_index_stringl(array, buf, bufl, 1); + add_next_index_stringl(array, buf, bufl); } b = buf; } @@ -134,7 +134,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ buf[bufl] = '\0'; } if (type == 2) { - add_next_index_stringl(array, buf, bufl, 1); + add_next_index_stringl(array, buf, bufl); } } diff --git a/ext/standard/file.c b/ext/standard/file.c index 020860873f..b802e2c4e7 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -480,9 +480,9 @@ PHP_FUNCTION(get_meta_tags) /* For BC */ php_strtolower(name, strlen(name)); if (have_content) { - add_assoc_string(return_value, name, value, 1); + add_assoc_string(return_value, name, value); } else { - add_assoc_string(return_value, name, "", 1); + add_assoc_string(return_value, name, ""); } efree(name); @@ -763,7 +763,7 @@ PHP_FUNCTION(file) do { p++; parse_eol: - add_index_stringl(return_value, i++, s, p-s, 1); + add_index_stringl(return_value, i++, s, p-s); s = p; } while ((p = memchr(p, eol_marker, (e-p)))); } else { @@ -776,7 +776,7 @@ parse_eol: s = ++p; continue; } - add_index_stringl(return_value, i++, s, p-s-windows_eol, 1); + add_index_stringl(return_value, i++, s, p-s-windows_eol); s = ++p; } while ((p = memchr(p, eol_marker, (e-p)))); } @@ -2277,7 +2277,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char /* 3. Now pass our field back to php */ *comp_end = '\0'; - add_next_index_stringl(return_value, temp, comp_end - temp, 1); + add_next_index_stringl(return_value, temp, comp_end - temp); } while (inc_len > 0); out: diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 311ca48f1c..4232af4d1c 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -1215,7 +1215,7 @@ PHP_FUNCTION(realpath_cache_get) add_assoc_double(&entry, "key", (double)bucket->key); } add_assoc_bool(&entry, "is_dir", bucket->is_dir); - add_assoc_stringl(&entry, "realpath", bucket->realpath, bucket->realpath_len, 1); + add_assoc_stringl(&entry, "realpath", bucket->realpath, bucket->realpath_len); add_assoc_long(&entry, "expires", bucket->expires); #ifdef PHP_WIN32 add_assoc_bool(&entry, "is_rvalid", bucket->is_rvalid); diff --git a/ext/standard/head.c b/ext/standard/head.c index 120a0615e8..30846215f8 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -265,7 +265,7 @@ static void php_head_apply_header_list_to_hash(void *data, void *arg TSRMLS_DC) sapi_header_struct *sapi_header = (sapi_header_struct *)data; if (arg && sapi_header) { - add_next_index_string((zval *)arg, (char *)(sapi_header->header), 1); + add_next_index_string((zval *)arg, (char *)(sapi_header->header)); } } diff --git a/ext/standard/html.c b/ext/standard/html.c index 57fb9ea899..cc772859a5 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1546,7 +1546,7 @@ static inline void write_s3row_data( size_t l = r->data.ent.entity_len; memcpy(&entity[1], r->data.ent.entity, l); entity[l + 1] = ';'; - add_assoc_stringl_ex(arr, key, written_k1, entity, l + 2, 1); + add_assoc_stringl_ex(arr, key, written_k1, entity, l + 2); } else { unsigned i, num_entries; @@ -1556,7 +1556,7 @@ static inline void write_s3row_data( size_t l = mcpr[0].leading_entry.default_entity_len; memcpy(&entity[1], mcpr[0].leading_entry.default_entity, l); entity[l + 1] = ';'; - add_assoc_stringl_ex(arr, key, written_k1, entity, l + 2, 1); + add_assoc_stringl_ex(arr, key, written_k1, entity, l + 2); } num_entries = mcpr[0].leading_entry.size; for (i = 1; i <= num_entries; i++) { @@ -1579,7 +1579,7 @@ static inline void write_s3row_data( memcpy(&entity[1], mcpr[i].normal_entry.entity, l); entity[l + 1] = ';'; entity[l + 1] = '\0'; - add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 1, 1); + add_assoc_stringl_ex(arr, key, written_k1 + written_k2, entity, l + 1); } } } diff --git a/ext/standard/image.c b/ext/standard/image.c index 137f91b79f..caaac77495 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -457,7 +457,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info TSR if ((tmp = zend_hash_str_find(Z_ARRVAL_P(info), markername, strlen(markername))) == NULL) { /* XXX we onyl catch the 1st tag of it's kind! */ - add_assoc_stringl(info, markername, buffer, length, 1); + add_assoc_stringl(info, markername, buffer, length); } efree(buffer); @@ -1365,7 +1365,7 @@ static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNA add_index_long(return_value, 1, result->height); add_index_long(return_value, 2, itype); snprintf(temp, sizeof(temp), "width=\"%d\" height=\"%d\"", result->width, result->height); - add_index_string(return_value, 3, temp, 0); + add_index_string(return_value, 3, temp); if (result->bits != 0) { add_assoc_long(return_value, "bits", result->bits); @@ -1373,7 +1373,7 @@ static void php_getimagesize_from_stream(php_stream *stream, zval *info, INTERNA if (result->channels != 0) { add_assoc_long(return_value, "channels", result->channels); } - add_assoc_string(return_value, "mime", (char*)php_image_type_to_mime_type(itype), 1); + add_assoc_string(return_value, "mime", (char*)php_image_type_to_mime_type(itype)); efree(result); } else { RETURN_FALSE; diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index e5a17456d4..fa17c95f3c 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -354,7 +354,7 @@ PHP_FUNCTION(iptcparse) element = zend_hash_str_update(Z_ARRVAL_P(return_value), key, strlen(key), &values); } - add_next_index_stringl(element, buffer+inx, len, 1); + add_next_index_stringl(element, buffer+inx, len); inx += len; tagsfound++; } diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 3fffb046d6..53a18c8fec 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -681,7 +681,7 @@ PHP_FUNCTION(unpack) size = len; - add_assoc_stringl(return_value, n, &input[inputpos], len, 1); + add_assoc_stringl(return_value, n, &input[inputpos], len); break; } case 'A': { @@ -707,7 +707,7 @@ PHP_FUNCTION(unpack) break; } - add_assoc_stringl(return_value, n, &input[inputpos], len + 1, 1); + add_assoc_stringl(return_value, n, &input[inputpos], len + 1); break; } /* New option added for Z to remain in-line with the Perl implementation */ @@ -731,7 +731,7 @@ PHP_FUNCTION(unpack) } len = s; - add_assoc_stringl(return_value, n, &input[inputpos], len, 1); + add_assoc_stringl(return_value, n, &input[inputpos], len); break; } @@ -774,7 +774,7 @@ PHP_FUNCTION(unpack) } buf[len] = '\0'; - add_assoc_stringl(return_value, n, buf, len, 1); + add_assoc_stringl(return_value, n, buf, len); efree(buf); break; } diff --git a/ext/standard/password.c b/ext/standard/password.c index de0de3d80d..738bdcc7ac 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -208,7 +208,7 @@ PHP_FUNCTION(password_get_info) array_init(return_value); add_assoc_long(return_value, "algo", algo); - add_assoc_string(return_value, "algoName", algo_name, 1); + add_assoc_string(return_value, "algoName", algo_name); add_assoc_zval(return_value, "options", &options); } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index fd3e0c2937..c18077a2d5 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -343,7 +343,7 @@ PHP_FUNCTION(proc_get_status) array_init(return_value); - add_assoc_string(return_value, "command", proc->command, 1); + add_assoc_string(return_value, "command", proc->command); add_assoc_long(return_value, "pid", (long) proc->child); #ifdef PHP_WIN32 @@ -899,7 +899,7 @@ PHP_FUNCTION(proc_open) proc->env = env; if (pipes != NULL) { - ZVAL_DEREF_REF(pipes); + ZVAL_DEREF(pipes); zval_dtor(pipes); } diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 4210f11d6b..77f781c49b 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -869,7 +869,7 @@ literal: // Z_SET_REFCOUNT_P(current, refcount); //??? Z_SET_ISREF_PP(current); } else { - add_index_stringl(return_value, objIndex++, string, end-string, 1); + add_index_stringl(return_value, objIndex++, string, end-string); } } string = end; @@ -910,7 +910,7 @@ literal: zval_dtor(Z_REFVAL_P(current)); ZVAL_STRINGL(Z_REFVAL_P(current), string, end-string); } else { - add_index_stringl(return_value, objIndex++, string, end-string, 1); + add_index_stringl(return_value, objIndex++, string, end-string); } } string = end; @@ -931,7 +931,7 @@ literal: zval_dtor(*current); ZVAL_STRINGL( *current, __buf, 1, 1); } else { - add_index_stringl(return_value, objIndex++, &sch, 1, 1); + add_index_stringl(return_value, objIndex++, &sch, 1); } } break; @@ -1064,7 +1064,7 @@ addToInt: zval_dtor(Z_REFVAL_P(current)); ZVAL_STRING(Z_REFVAL_P(current), buf); } else { - add_index_string(return_value, objIndex++, buf, 1); + add_index_string(return_value, objIndex++, buf); } } else { if (numVars && objIndex >= argCount) { diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 4b1411c7b7..360c436be7 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -501,11 +501,11 @@ PHP_FUNCTION(stream_get_meta_data) add_assoc_zval(return_value, "wrapper_data", &stream->wrapperdata); } if (stream->wrapper) { - add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label, 1); + add_assoc_string(return_value, "wrapper_type", (char *)stream->wrapper->wops->label); } - add_assoc_string(return_value, "stream_type", (char *)stream->ops->label, 1); + add_assoc_string(return_value, "stream_type", (char *)stream->ops->label); - add_assoc_string(return_value, "mode", stream->mode, 1); + add_assoc_string(return_value, "mode", stream->mode); #if 0 /* TODO: needs updating for new filter API */ if (stream->filterhead) { @@ -515,7 +515,7 @@ PHP_FUNCTION(stream_get_meta_data) array_init(newval); for (filter = stream->filterhead; filter != NULL; filter = filter->next) { - add_next_index_string(newval, (char *)filter->fops->label, 1); + add_next_index_string(newval, (char *)filter->fops->label); } add_assoc_zval(return_value, "filters", newval); @@ -526,7 +526,7 @@ PHP_FUNCTION(stream_get_meta_data) add_assoc_bool(return_value, "seekable", (stream->ops->seek) && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0); if (stream->orig_path) { - add_assoc_string(return_value, "uri", stream->orig_path, 1); + add_assoc_string(return_value, "uri", stream->orig_path); } if (!php_stream_populate_meta_data(stream, return_value)) { diff --git a/ext/standard/string.c b/ext/standard/string.c index 463d2b2a73..19a3fda93b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1017,16 +1017,16 @@ PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, long limit) p2 = (char*)php_memnstr(Z_STRVAL_P(str), Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp); if (p2 == NULL) { - add_next_index_stringl(return_value, p1, Z_STRLEN_P(str), 1); + add_next_index_stringl(return_value, p1, Z_STRLEN_P(str)); } else { do { - add_next_index_stringl(return_value, p1, p2 - p1, 1); + add_next_index_stringl(return_value, p1, p2 - p1); p1 = p2 + Z_STRLEN_P(delim); } while ((p2 = (char*)php_memnstr(p1, Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp)) != NULL && --limit > 1); if (p1 <= endp) - add_next_index_stringl(return_value, p1, endp-p1, 1); + add_next_index_stringl(return_value, p1, endp-p1); } } /* }}} */ @@ -1066,9 +1066,7 @@ PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_valu /* limit is at least -1 therefore no need of bounds checking : i will be always less than found */ for (i = 0;i < to_return;i++) { /* this checks also for to_return > 0 */ add_next_index_stringl(return_value, positions[i], - (positions[i+1] - Z_STRLEN_P(delim)) - positions[i], - 1 - ); + (positions[i+1] - Z_STRLEN_P(delim)) - positions[i]); } efree(positions); } @@ -1097,7 +1095,7 @@ PHP_FUNCTION(explode) if (str->len == 0) { if (limit >= 0) { - add_next_index_stringl(return_value, "", sizeof("") - 1, 1); + add_next_index_stringl(return_value, "", sizeof("") - 1); } return; } @@ -1109,7 +1107,7 @@ PHP_FUNCTION(explode) } else if (limit < 0) { php_explode_negative_limit(&zdelim, &zstr, return_value, limit); } else { - add_index_stringl(return_value, 0, str->val, str->len, 1); + add_index_stringl(return_value, 0, str->val, str->len); } } /* }}} */ @@ -1539,7 +1537,7 @@ PHP_FUNCTION(pathinfo) dirname = estrndup(path, path_len); php_dirname(dirname, path_len); if (*dirname) { - add_assoc_string(&tmp, "dirname", dirname, 1); + add_assoc_string(&tmp, "dirname", dirname); } efree(dirname); } @@ -1561,7 +1559,7 @@ PHP_FUNCTION(pathinfo) if (p) { idx = p - ret->val; - add_assoc_stringl(&tmp, "extension", ret->val + idx + 1, ret->len - idx - 1, 1); + add_assoc_stringl(&tmp, "extension", ret->val + idx + 1, ret->len - idx - 1); } } @@ -1577,7 +1575,7 @@ PHP_FUNCTION(pathinfo) p = zend_memrchr(ret->val, '.', ret->len); idx = p ? (p - ret->val) : ret->len; - add_assoc_stringl(&tmp, "filename", ret->val, idx, 1); + add_assoc_stringl(&tmp, "filename", ret->val, idx); } if (ret) { @@ -3953,8 +3951,7 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit if (Z_TYPE_P(subject_entry) != IS_ARRAY && Z_TYPE_P(subject_entry) != IS_OBJECT) { php_str_replace_in_subject(search, replace, subject_entry, &result, case_sensitivity, (argc > 3) ? &count : NULL TSRMLS_CC); } else { - Z_ADDREF_P(subject_entry); - COPY_PZVAL_TO_ZVAL(result, subject_entry); + ZVAL_COPY(&result, subject_entry); } /* Add to return array */ switch (zend_hash_get_current_key(Z_ARRVAL_P(subject), &string_key, @@ -5055,22 +5052,22 @@ PHP_FUNCTION(localeconv) add_index_long(&mon_grouping, i, currlocdata.mon_grouping[i]); } - add_assoc_string(return_value, "decimal_point", currlocdata.decimal_point, 1); - add_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep, 1); - add_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol, 1); - add_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol, 1); - add_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point, 1); - add_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep, 1); - add_assoc_string(return_value, "positive_sign", currlocdata.positive_sign, 1); - add_assoc_string(return_value, "negative_sign", currlocdata.negative_sign, 1); - add_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits ); - add_assoc_long( return_value, "frac_digits", currlocdata.frac_digits ); - add_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes ); - add_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space ); - add_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes ); - add_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space ); - add_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn ); - add_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn ); + add_assoc_string(return_value, "decimal_point", currlocdata.decimal_point); + add_assoc_string(return_value, "thousands_sep", currlocdata.thousands_sep); + add_assoc_string(return_value, "int_curr_symbol", currlocdata.int_curr_symbol); + add_assoc_string(return_value, "currency_symbol", currlocdata.currency_symbol); + add_assoc_string(return_value, "mon_decimal_point", currlocdata.mon_decimal_point); + add_assoc_string(return_value, "mon_thousands_sep", currlocdata.mon_thousands_sep); + add_assoc_string(return_value, "positive_sign", currlocdata.positive_sign); + add_assoc_string(return_value, "negative_sign", currlocdata.negative_sign); + add_assoc_long( return_value, "int_frac_digits", currlocdata.int_frac_digits); + add_assoc_long( return_value, "frac_digits", currlocdata.frac_digits); + add_assoc_long( return_value, "p_cs_precedes", currlocdata.p_cs_precedes); + add_assoc_long( return_value, "p_sep_by_space", currlocdata.p_sep_by_space); + add_assoc_long( return_value, "n_cs_precedes", currlocdata.n_cs_precedes); + add_assoc_long( return_value, "n_sep_by_space", currlocdata.n_sep_by_space); + add_assoc_long( return_value, "p_sign_posn", currlocdata.p_sign_posn); + add_assoc_long( return_value, "n_sign_posn", currlocdata.n_sign_posn); } #else /* Ok, it doesn't look like we have locale info floating around, so I guess it @@ -5079,22 +5076,22 @@ PHP_FUNCTION(localeconv) add_index_long(&grouping, 0, -1); add_index_long(&mon_grouping, 0, -1); - add_assoc_string(return_value, "decimal_point", "\x2E", 1); - add_assoc_string(return_value, "thousands_sep", "", 1); - add_assoc_string(return_value, "int_curr_symbol", "", 1); - add_assoc_string(return_value, "currency_symbol", "", 1); - add_assoc_string(return_value, "mon_decimal_point", "\x2E", 1); - add_assoc_string(return_value, "mon_thousands_sep", "", 1); - add_assoc_string(return_value, "positive_sign", "", 1); - add_assoc_string(return_value, "negative_sign", "", 1); - add_assoc_long( return_value, "int_frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "frac_digits", CHAR_MAX ); - add_assoc_long( return_value, "p_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "p_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "n_cs_precedes", CHAR_MAX ); - add_assoc_long( return_value, "n_sep_by_space", CHAR_MAX ); - add_assoc_long( return_value, "p_sign_posn", CHAR_MAX ); - add_assoc_long( return_value, "n_sign_posn", CHAR_MAX ); + add_assoc_string(return_value, "decimal_point", "\x2E"); + add_assoc_string(return_value, "thousands_sep", ""); + add_assoc_string(return_value, "int_curr_symbol", ""); + add_assoc_string(return_value, "currency_symbol", ""); + add_assoc_string(return_value, "mon_decimal_point", "\x2E"); + add_assoc_string(return_value, "mon_thousands_sep", ""); + add_assoc_string(return_value, "positive_sign", ""); + add_assoc_string(return_value, "negative_sign", ""); + add_assoc_long( return_value, "int_frac_digits", CHAR_MAX); + add_assoc_long( return_value, "frac_digits", CHAR_MAX); + add_assoc_long( return_value, "p_cs_precedes", CHAR_MAX); + add_assoc_long( return_value, "p_sep_by_space", CHAR_MAX); + add_assoc_long( return_value, "n_cs_precedes", CHAR_MAX); + add_assoc_long( return_value, "n_sep_by_space", CHAR_MAX); + add_assoc_long( return_value, "p_sign_posn", CHAR_MAX); + add_assoc_long( return_value, "n_sign_posn", CHAR_MAX); #endif zend_hash_str_update(Z_ARRVAL_P(return_value), "grouping", sizeof("grouping")-1, &grouping); @@ -5408,10 +5405,10 @@ PHP_FUNCTION(str_word_count) switch (type) { case 1: - add_next_index_stringl(return_value, s, p - s, 1); + add_next_index_stringl(return_value, s, p - s); break; case 2: - add_index_stringl(return_value, (s - str), s, p - s, 1); + add_index_stringl(return_value, (s - str), s, p - s); break; default: word_count++; @@ -5491,7 +5488,7 @@ PHP_FUNCTION(str_split) array_init_size(return_value, ((str_len - 1) / split_length) + 1); if (split_length >= str_len) { - add_next_index_stringl(return_value, str, str_len, 1); + add_next_index_stringl(return_value, str, str_len); return; } @@ -5499,12 +5496,12 @@ PHP_FUNCTION(str_split) p = str; while (n_reg_segments-- > 0) { - add_next_index_stringl(return_value, p, split_length, 1); + add_next_index_stringl(return_value, p, split_length); p += split_length; } if (p != (str + str_len)) { - add_next_index_stringl(return_value, p, (str + str_len - p), 1); + add_next_index_stringl(return_value, p, (str + str_len - p)); } } /* }}} */ diff --git a/ext/standard/type.c b/ext/standard/type.c index 6ad6d33ab0..69e3305ea9 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -98,7 +98,7 @@ PHP_FUNCTION(settype) return; } - ZVAL_DEREF_REF(var); + ZVAL_DEREF(var); if (!strcasecmp(type, "integer")) { convert_to_long(var); } else if (!strcasecmp(type, "int")) { diff --git a/ext/standard/url.c b/ext/standard/url.c index 3ce1c568ed..fc49dc3264 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -427,21 +427,21 @@ PHP_FUNCTION(parse_url) /* add the various elements to the array */ if (resource->scheme != NULL) - add_assoc_string(return_value, "scheme", resource->scheme, 1); + add_assoc_string(return_value, "scheme", resource->scheme); if (resource->host != NULL) - add_assoc_string(return_value, "host", resource->host, 1); + add_assoc_string(return_value, "host", resource->host); if (resource->port != 0) add_assoc_long(return_value, "port", resource->port); if (resource->user != NULL) - add_assoc_string(return_value, "user", resource->user, 1); + add_assoc_string(return_value, "user", resource->user); if (resource->pass != NULL) - add_assoc_string(return_value, "pass", resource->pass, 1); + add_assoc_string(return_value, "pass", resource->pass); if (resource->path != NULL) - add_assoc_string(return_value, "path", resource->path, 1); + add_assoc_string(return_value, "path", resource->path); if (resource->query != NULL) - add_assoc_string(return_value, "query", resource->query, 1); + add_assoc_string(return_value, "query", resource->query); if (resource->fragment != NULL) - add_assoc_string(return_value, "fragment", resource->fragment, 1); + add_assoc_string(return_value, "fragment", resource->fragment); done: php_url_free(resource); } @@ -748,10 +748,10 @@ no_name_header: } if ((prev_val = zend_hash_str_find(HASH_OF(return_value), Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr)))) == NULL) { - add_assoc_stringl_ex(return_value, Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr) + 1), s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))), 1); + add_assoc_stringl_ex(return_value, Z_STRVAL_P(hdr), (p - Z_STRVAL_P(hdr) + 1), s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr)))); } else { /* some headers may occur more then once, therefor we need to remake the string into an array */ convert_to_array(prev_val); - add_next_index_stringl(prev_val, s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr))), 1); + add_next_index_stringl(prev_val, s, (Z_STRLEN_P(hdr) - (s - Z_STRVAL_P(hdr)))); } *p = c; diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 00702f0fb9..44b96e3bdd 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -338,7 +338,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, //??? Z_SET_ISREF_P(obj); /* filtername */ - add_property_string(&obj, "filtername", (char*)filtername, 1); + add_property_string(&obj, "filtername", (char*)filtername); /* and the parameters, if any */ if (filterparams) { @@ -419,7 +419,7 @@ PHP_FUNCTION(stream_bucket_make_writeable) add_property_zval(return_value, "bucket", &zbucket); /* add_property_zval increments the refcount which is unwanted here */ zval_ptr_dtor(&zbucket); - add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1); + add_property_stringl(return_value, "data", bucket->buf, bucket->buflen); add_property_long(return_value, "datalen", bucket->buflen); } } @@ -520,7 +520,7 @@ PHP_FUNCTION(stream_bucket_new) add_property_zval(return_value, "bucket", &zbucket); /* add_property_zval increments the refcount which is unwanted here */ zval_ptr_dtor(&zbucket); - add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1); + add_property_stringl(return_value, "data", bucket->buf, bucket->buflen); add_property_long(return_value, "datalen", bucket->buflen); } /* }}} */ |