From d87147911acf81e859d06b71e397ff26b2bc7efb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 12:53:30 +0100 Subject: [PATCH 1/8] Missing files, fix #82 --- check-package.sh | 6 ++++++ package2.xml => package.xml | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 check-package.sh rename package2.xml => package.xml (96%) diff --git a/check-package.sh b/check-package.sh new file mode 100755 index 00000000..62e86e75 --- /dev/null +++ b/check-package.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +for src in *.c */*.c *.h */*.h tests/*phpt tests/*ini +do + grep -q $(basename $src) package.xml || echo "Missing $src" +done diff --git a/package2.xml b/package.xml similarity index 96% rename from package2.xml rename to package.xml index be5e068a..7fabf344 100644 --- a/package2.xml +++ b/package.xml @@ -66,7 +66,9 @@ + + @@ -74,24 +76,37 @@ + + + + + + + + + + + + + @@ -177,8 +192,10 @@ + + From 90f523be497bb26a1a35bccf09e656c22d89d568 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 12:56:58 +0100 Subject: [PATCH 2/8] Fix: [-Wunused-but-set-variable] (comment as usage if commented) --- yaf_dispatcher.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yaf_dispatcher.c b/yaf_dispatcher.c index 23f83f22..dfe671dd 100644 --- a/yaf_dispatcher.c +++ b/yaf_dispatcher.c @@ -535,7 +535,7 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request, } else { int is_def_module = 0; /* int is_def_ctr = 0; */ - zval *module, *controller, *dmodule, *dcontroller, *instantly_flush; + zval *module, *controller, *dmodule, /* *dcontroller,*/ *instantly_flush; zend_class_entry *ce; yaf_controller_t *executor; zend_function *fptr; @@ -544,7 +544,9 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request, controller = zend_read_property(request_ce, request, ZEND_STRL(YAF_REQUEST_PROPERTY_NAME_CONTROLLER), 1 TSRMLS_CC); dmodule = zend_read_property(yaf_dispatcher_ce, dispatcher, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_MODULE), 1 TSRMLS_CC); + /* dcontroller = zend_read_property(yaf_dispatcher_ce, dispatcher, ZEND_STRL(YAF_DISPATCHER_PROPERTY_NAME_CONTROLLER), 1 TSRMLS_CC); + */ if (Z_TYPE_P(module) != IS_STRING || !Z_STRLEN_P(module)) { From a13a9dc6d38f6ac906135ae4b6f27ec36028ebf7 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 12:58:50 +0100 Subject: [PATCH 3/8] Fix [-Wunused-but-set-variable] --- configs/yaf_config_ini.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configs/yaf_config_ini.c b/configs/yaf_config_ini.c index 339dfc1a..3a75e81b 100644 --- a/configs/yaf_config_ini.c +++ b/configs/yaf_config_ini.c @@ -125,8 +125,7 @@ static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) { /** {{{ zval * yaf_config_ini_format(yaf_config_t *instance, zval **ppzval TSRMLS_DC) */ zval * yaf_config_ini_format(yaf_config_t *instance, zval **ppzval TSRMLS_DC) { - zval *readonly, *ret; - readonly = zend_read_property(yaf_config_ini_ce, instance, ZEND_STRL(YAF_CONFIG_PROPERT_NAME_READONLY), 1 TSRMLS_CC); + zval *ret; ret = yaf_config_ini_instance(NULL, *ppzval, NULL TSRMLS_CC); return ret; } From 45b844b60ac524f785f04371553b31bf55fa7c25 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 12:59:28 +0100 Subject: [PATCH 4/8] Fix: [-Wreturn-type] --- configs/yaf_config_ini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/yaf_config_ini.c b/configs/yaf_config_ini.c index 3a75e81b..64d3f117 100644 --- a/configs/yaf_config_ini.c +++ b/configs/yaf_config_ini.c @@ -71,7 +71,7 @@ ZEND_END_ARG_INFO() /** {{{ static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) */ -static inline yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) { +static inline void yaf_deep_copy_section(zval *dst, zval *src TSRMLS_DC) { zval **ppzval, **dstppzval, *value; HashTable *ht; ulong idx; From 4b59480de8b42c6709d39661f8a5154ae3386e4d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 13:01:36 +0100 Subject: [PATCH 5/8] [-Wformat=] --- responses/yaf_response_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/responses/yaf_response_http.c b/responses/yaf_response_http.c index 91f940b7..3e116560 100644 --- a/responses/yaf_response_http.c +++ b/responses/yaf_response_http.c @@ -165,7 +165,7 @@ int yaf_response_http_send(yaf_response_t *response TSRMLS_DC) { if (zend_hash_get_current_key_ex(Z_ARRVAL_P(zheader), &header_name, &header_name_len, &num_key, 0, &pos) == HASH_KEY_IS_STRING) { ctr.line_len = spprintf(&(ctr.line), 0, "%s: %s", header_name, Z_STRVAL_PP(entry)); } else { - ctr.line_len = spprintf(&(ctr.line), 0, "%s: %s", num_key, Z_STRVAL_PP(entry)); + ctr.line_len = spprintf(&(ctr.line), 0, "%lu: %s", num_key, Z_STRVAL_PP(entry)); } ctr.response_code = 0; From 23257fd544d96f8aa7576f4aae395d12fca26619 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 13:05:07 +0100 Subject: [PATCH 6/8] Fix [-Wunused-variable] [-Wparentheses] --- routes/yaf_route_static.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/yaf_route_static.c b/routes/yaf_route_static.c index 6fb09b97..5bd7d3f5 100644 --- a/routes/yaf_route_static.c +++ b/routes/yaf_route_static.c @@ -212,7 +212,7 @@ zval * yaf_route_static_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query T smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type, key_len; + uint key_len; char *key; ulong key_idx; int start = 0, end = 0; @@ -281,7 +281,7 @@ PHP_METHOD(yaf_route_static, assemble) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) { return; } else { - if (return_uri = yaf_route_static_assemble(getThis(), mvc, query TSRMLS_CC)) { + if ((return_uri = yaf_route_static_assemble(getThis(), mvc, query TSRMLS_CC))) { RETURN_ZVAL(return_uri, 0, 1); } } From 75cb392fd53364bb18fa47929159ba71312740bd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 13:06:02 +0100 Subject: [PATCH 7/8] Fix [-Wunused-variable] [-Wparentheses] --- routes/yaf_route_simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/yaf_route_simple.c b/routes/yaf_route_simple.c index 91967583..87cdb685 100644 --- a/routes/yaf_route_simple.c +++ b/routes/yaf_route_simple.c @@ -151,7 +151,7 @@ zval * yaf_route_simple_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query T smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type, key_len; + uint key_len; char *key; ulong key_idx; @@ -212,7 +212,7 @@ PHP_METHOD(yaf_route_simple, assemble) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) { return; } else { - if (return_uri = yaf_route_simple_assemble(getThis(), mvc, query TSRMLS_CC)) { + if ((return_uri = yaf_route_simple_assemble(getThis(), mvc, query TSRMLS_CC))) { RETURN_ZVAL(return_uri, 0, 1); } } From 3a1f02ee40c3aedc15a39686efcdc3495a95e70a Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 8 Jan 2014 13:08:50 +0100 Subject: [PATCH 8/8] Fix [-Wunused-variable] [-Wparentheses] --- routes/yaf_route_map.c | 4 ++-- routes/yaf_route_regex.c | 4 ++-- routes/yaf_route_rewrite.c | 3 +-- routes/yaf_route_supervar.c | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/routes/yaf_route_map.c b/routes/yaf_route_map.c index 05abb41a..d643a901 100644 --- a/routes/yaf_route_map.c +++ b/routes/yaf_route_map.c @@ -201,7 +201,7 @@ zval * yaf_route_map_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query TSRM efree(pname); if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type, key_len, i = 0; + uint key_len, i = 0; char *key; ulong key_idx; zval **tmp_data; @@ -277,7 +277,7 @@ PHP_METHOD(yaf_route_map, assemble) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) { return; } else { - if (return_uri = yaf_route_map_assemble(getThis(), mvc, query TSRMLS_CC)) { + if ((return_uri = yaf_route_map_assemble(getThis(), mvc, query TSRMLS_CC))) { RETURN_ZVAL(return_uri, 0, 1); } } diff --git a/routes/yaf_route_regex.c b/routes/yaf_route_regex.c index e336108f..412c7d16 100644 --- a/routes/yaf_route_regex.c +++ b/routes/yaf_route_regex.c @@ -193,7 +193,7 @@ zval * yaf_route_regex_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query TS } if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type, key_len; + uint key_len; char *key; ulong key_idx; HashTable *ht = Z_ARRVAL_P(query); @@ -364,7 +364,7 @@ PHP_METHOD(yaf_route_regex, assemble) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) { return; } else { - if (return_uri = yaf_route_regex_assemble(getThis(), mvc, query TSRMLS_CC)) { + if ((return_uri = yaf_route_regex_assemble(getThis(), mvc, query TSRMLS_CC))) { RETURN_ZVAL(return_uri, 0, 1); } } diff --git a/routes/yaf_route_rewrite.c b/routes/yaf_route_rewrite.c index 51f34bbd..279dd54e 100644 --- a/routes/yaf_route_rewrite.c +++ b/routes/yaf_route_rewrite.c @@ -270,7 +270,7 @@ PHP_METHOD(yaf_route_rewrite, route) { /** {{{ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *query TSRMLS_DC) */ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *query TSRMLS_DC) { - zval *reverse, *uri, *match, *pidents; + zval *uri, *match, *pidents; zval **tmp; char *tstr, *inter, *seg, *pmatch, *ptrptr, *key; int tlen; @@ -331,7 +331,6 @@ zval * yaf_route_rewrite_assemble(yaf_route_t *this_ptr, zval *idents, zval *que zval_ptr_dtor(&pidents); if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type; HashTable *ht = Z_ARRVAL_P(query); smart_str_appendc(&squery, '?'); diff --git a/routes/yaf_route_supervar.c b/routes/yaf_route_supervar.c index 8cbfd89f..9f9198d9 100644 --- a/routes/yaf_route_supervar.c +++ b/routes/yaf_route_supervar.c @@ -138,7 +138,7 @@ zval * yaf_route_supervar_assemble(yaf_route_t *this_ptr, zval *mvc, zval *query smart_str_appendl(&tvalue, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); if (IS_ARRAY == Z_TYPE_P(query)) { - uint key_type, key_len; + uint key_len; char *key; ulong key_idx; @@ -197,7 +197,7 @@ PHP_METHOD(yaf_route_supervar, assemble) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|a", &mvc, &query) == FAILURE) { return; } else { - if (return_uri = yaf_route_supervar_assemble(getThis(), mvc, query TSRMLS_CC)) { + if ((return_uri = yaf_route_supervar_assemble(getThis(), mvc, query TSRMLS_CC))) { RETURN_ZVAL(return_uri, 0, 1); } }