initialize optional vars

This commit is contained in:
Arnaud Le Blanc 2008-10-21 23:36:17 +00:00
parent 5ef7ecafc1
commit 51f7cc3925
10 changed files with 41 additions and 41 deletions

View File

@ -1092,8 +1092,8 @@ PHP_FUNCTION(curl_init)
php_curl *ch;
CURL *cp;
zstr src = NULL_ZSTR;
int src_len;
zend_uchar src_type;
int src_len = 0;
zend_uchar src_type = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|t", &src, &src_len, &src_type) == FAILURE) {
RETURN_FALSE;
@ -1783,7 +1783,7 @@ PHP_FUNCTION(curl_getinfo)
{
zval *zid;
php_curl *ch;
long option;
long option = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|l", &zid, &option) == FAILURE) {
RETURN_FALSE;

View File

@ -1511,7 +1511,7 @@ PHP_FUNCTION(idate)
{
char *format;
int format_len;
long ts;
long ts = 0;
int ret;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) {
@ -1574,7 +1574,7 @@ PHP_FUNCTION(strtotime)
char *times, *initial_ts;
int time_len, error1, error2;
struct timelib_error_container *error;
long preset_ts, ts;
long preset_ts = 0, ts;
timelib_time *t, *now;
timelib_tzinfo *tzi;
@ -1631,7 +1631,7 @@ PHP_FUNCTION(strtotime)
/* {{{ php_mktime - (gm)mktime helper */
PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
{
long hou, min, sec, mon, day, yea, dst = -1;
long hou = 0, min = 0, sec = 0, mon = 0, day = 0, yea = 0, dst = -1;
timelib_time *now;
timelib_tzinfo *tzi = NULL;
long ts, adjust_seconds = 0;
@ -1760,7 +1760,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
{
char *format, *buf;
int format_len;
long timestamp;
long timestamp = 0;
struct tm ta;
int max_reallocs = 5;
size_t buf_len = 64, real_len;
@ -3962,7 +3962,7 @@ PHP_FUNCTION(timezone_identifiers_list)
const timelib_tzdb_index_entry *table;
int i, item_count;
long what = PHP_DATE_TIMEZONE_GROUP_ALL;
char *option;
char *option = NULL;
int option_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ls", &what, &option, &option_len) == FAILURE) {
@ -4068,10 +4068,10 @@ PHP_FUNCTION(date_default_timezone_get)
*/
static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_sunset)
{
double latitude, longitude, zenith, gmt_offset = 0, altitude;
double latitude = 0.0, longitude = 0.0, zenith = 0.0, gmt_offset = 0, altitude;
double h_rise, h_set, N;
timelib_sll rise, set, transit;
long time, retformat;
long time, retformat = 0;
int rs;
timelib_time *t;
timelib_tzinfo *tzi;

View File

@ -98,7 +98,7 @@ PHP_METHOD(domimplementation, createDocumentType)
zval *rv = NULL;
xmlDtd *doctype;
int ret, name_len = 0, publicid_len = 0, systemid_len = 0;
char *name, *publicid, *systemid;
char *name = NULL, *publicid = NULL, *systemid = NULL;
xmlChar *pch1 = NULL, *pch2 = NULL, *localname = NULL;
xmlURIPtr uri;
@ -161,7 +161,7 @@ PHP_METHOD(domimplementation, createDocument)
xmlDtdPtr doctype = NULL;
xmlNsPtr nsptr = NULL;
int ret, uri_len = 0, name_len = 0, errorcode = 0;
char *uri, *name;
char *uri = NULL, *name = NULL;
char *prefix = NULL, *localname = NULL;
dom_object *doctobj;

View File

@ -3892,7 +3892,7 @@ PHP_FUNCTION(exif_read_data)
image_info_type ImageInfo;
char tmp[64], *sections_str=0, *s;
char *filename;
int filename_len, sections_str_len;
int filename_len, sections_str_len = 0;
memset(&ImageInfo, 0, sizeof(ImageInfo));

View File

@ -4144,7 +4144,7 @@ PHP_FUNCTION(imagepstext)
PHP_FUNCTION(imagepsbbox)
{
zval *fnt;
long sz = 0, sp, wd;
long sz = 0, sp = 0, wd = 0;
char *str;
int i, space = 0, add_width = 0, char_width, amount_kern;
int cur_x, cur_y, dx, dy;
@ -4152,7 +4152,7 @@ PHP_FUNCTION(imagepsbbox)
int *f_ind;
int str_len, per_char = 0;
int argc = ZEND_NUM_ARGS();
double angle, sin_a = 0, cos_a = 0;
double angle = 0, sin_a = 0, cos_a = 0;
BBox char_bbox, str_bbox = {0, 0, 0, 0};
if (argc != 3 && argc != 6) {

View File

@ -1550,7 +1550,7 @@ PHP_FUNCTION(openssl_x509_checkpurpose)
long purpose;
zval **ppuntrusted=NULL;
char * untrusted = NULL;
int untrusted_len;
int untrusted_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zl|a!Z", &zcert, &purpose, &zcainfo, &ppuntrusted) == FAILURE) {
return;
@ -3279,7 +3279,7 @@ PHP_FUNCTION(openssl_pkey_get_private)
zval **cert;
EVP_PKEY *pkey;
char *passphrase = "";
int passphrase_len;
int passphrase_len = sizeof("")-1;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s&", &cert, &passphrase, &passphrase_len, UG(ascii_conv)) == FAILURE) {
return;
@ -3413,11 +3413,11 @@ PHP_FUNCTION(openssl_pkcs7_verify)
zval **ppfilename;
char * filename; int filename_len;
zval **ppextracerts=NULL;
char * extracerts = NULL; int extracerts_len;
char * extracerts = NULL; int extracerts_len = 0;
zval **ppsignersfilename;
char * signersfilename = NULL; int signersfilename_len;
char * signersfilename = NULL; int signersfilename_len = 0;
zval **ppdatafilename=NULL;
char * datafilename = NULL; int datafilename_len;
char * datafilename = NULL; int datafilename_len = 0;
RETVAL_LONG(-1);
@ -4339,7 +4339,7 @@ PHP_FUNCTION(openssl_seal)
unsigned char *buf = NULL, **eks;
char *data; int data_len;
char *method =NULL;
int method_len;
int method_len = 0;
const EVP_CIPHER *cipher;
EVP_CIPHER_CTX ctx;
@ -4465,7 +4465,7 @@ PHP_FUNCTION(openssl_open)
char * data; int data_len;
char * ekey; int ekey_len;
char *method =NULL;
int method_len;
int method_len = 0;
const EVP_CIPHER *cipher;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SzSZ|s&", &data, &data_len, &opendata, &ekey, &ekey_len, &privkey, &method, &method_len, UG(ascii_conv)) == FAILURE) {

View File

@ -1546,7 +1546,7 @@ SXE_METHOD(children)
{
php_sxe_object *sxe;
char *nsprefix = NULL;
int nsprefix_len;
int nsprefix_len = 0;
xmlNodePtr node;
zend_bool isprefix = 0;
@ -1595,7 +1595,7 @@ SXE_METHOD(attributes)
{
php_sxe_object *sxe;
char *nsprefix = NULL;
int nsprefix_len;
int nsprefix_len = 0;
xmlNodePtr node;
zend_bool isprefix = 0;

View File

@ -1211,9 +1211,9 @@ PHP_METHOD(SoapFault, SoapFault)
zstr fault_actor = NULL_ZSTR;
zstr name = NULL_ZSTR;
char *fault_code = NULL, *fault_code_ns = NULL;
int fault_string_len, fault_actor_len, name_len;
int fault_string_len = 0, fault_actor_len = 0, name_len = 0;
zval *code = NULL, *details = NULL, *headerfault = NULL;
zend_uchar name_type, fault_string_type, fault_actor_type;
zend_uchar name_type = 0, fault_string_type = 0, fault_actor_type = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zt|t!z!t!z",
&code,
@ -1342,8 +1342,8 @@ PHP_METHOD(SoapVar, SoapVar)
{
zval *data, *type;
zstr stype = NULL_ZSTR, ns = NULL_ZSTR, name = NULL_ZSTR, namens = NULL_ZSTR;
int stype_len, ns_len, name_len, namens_len;
zend_uchar stype_type, ns_type, name_type, namens_type;
int stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
zend_uchar stype_type = 0, ns_type = 0, name_type = 0, namens_type = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!z|tttt",
&data, &type,
@ -1940,7 +1940,7 @@ PHP_METHOD(SoapServer, handle)
soapHeader *soap_headers = NULL;
sdlFunctionPtr function;
zstr arg = NULL_ZSTR;
int arg_len;
int arg_len = 0;
xmlCharEncodingHandlerPtr old_encoding;
HashTable *old_class_map, *old_typemap;
int old_features;
@ -2478,8 +2478,8 @@ PHP_METHOD(SoapServer, fault)
zstr code, string;
zstr actor=NULL_ZSTR;
zstr name=NULL_ZSTR;
int code_len, string_len, actor_len, name_len;
zend_uchar code_type, string_type, actor_type, name_type;
int code_len, string_len, actor_len = 0, name_len = 0;
zend_uchar code_type, string_type, actor_type = 0, name_type = 0;
zval* details = NULL;
SOAP_SERVER_BEGIN_CODE();
@ -3695,8 +3695,8 @@ PHP_METHOD(SoapClient, __setCookie)
{
zstr name;
zstr val = NULL_ZSTR;
int name_len, val_len;
zend_uchar name_type, val_type;
int name_len, val_len = 0;
zend_uchar name_type, val_type = 0;
soap_client_object *client;
client = (soap_client_object*)zend_object_store_get_object(this_ptr TSRMLS_CC);
@ -3796,8 +3796,8 @@ PHP_METHOD(SoapClient, __setSoapHeaders)
PHP_METHOD(SoapClient, __setLocation)
{
void* location = NULL;
int location_len;
zend_uchar location_type;
int location_len = 0;
zend_uchar location_type = 0;
soap_client_object *client;
client = (soap_client_object*)zend_object_store_get_object(this_ptr TSRMLS_CC);

View File

@ -976,7 +976,7 @@ PHP_FUNCTION(socket_write)
zval *arg1;
php_socket *php_sock;
int retval, str_len;
long length;
long length = 0;
char *str;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &str, &str_len, &length) == FAILURE) {
@ -1270,7 +1270,7 @@ PHP_FUNCTION(socket_connect)
struct sockaddr_un s_un;
char *addr;
int retval, addr_len;
long port;
long port = 0;
int argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "rs|l", &arg1, &addr, &addr_len, &port) == FAILURE) {

View File

@ -1143,8 +1143,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
{
zval * zip;
zval * zip_entry;
char *mode;
int mode_len;
char *mode = NULL;
int mode_len = 0;
zip_read_rsrc * zr_rsrc;
zip_rsrc *z_rsrc;
@ -1486,10 +1486,10 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
struct zip *intern;
zval *this = getThis();
char *pattern;
char *path;
char *path = NULL;
char *remove_path = NULL;
char *add_path = NULL;
int pattern_len, add_path_len, remove_path_len, path_len;
int pattern_len, add_path_len, remove_path_len, path_len = 0;
long remove_all_path = 0;
long flags = 0;
zval *options = NULL;