Skip to content

Commit

Permalink
Fix some compiler warnings by Remi
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Dec 18, 2012
1 parent f20bfe0 commit a6c0d5a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 23 deletions.
14 changes: 7 additions & 7 deletions views/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: simple.c 328262 2012-11-06 10:31:55Z laruence $ */
/* $Id: simple.c 328823 2012-12-18 10:10:55Z remi $ */

#include "main/php_output.h"

Expand Down Expand Up @@ -801,13 +801,13 @@ PHP_METHOD(yaf_view_simple, get) {
/** {{{ proto public Yaf_View_Simple::render(string $tpl, array $vars = NULL)
*/
PHP_METHOD(yaf_view_simple, render) {
zval *tpl, *vars = NULL, *tpl_vars;
zval *tpl, *vars = NULL; /*, *tpl_vars;*/

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &tpl, &vars) == FAILURE) {
return;
}

tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 1 TSRMLS_CC);
/*tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 1 TSRMLS_CC);*/
#if ((PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 4))
zend_try {
#endif
Expand Down Expand Up @@ -844,13 +844,13 @@ PHP_METHOD(yaf_view_simple, render) {
/** {{{ proto public Yaf_View_Simple::eval(string $tpl_content, array $vars = NULL)
*/
PHP_METHOD(yaf_view_simple, eval) {
zval *tpl, *vars = NULL, *tpl_vars;
zval *tpl, *vars = NULL; /*, *tpl_vars;*/

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &tpl, &vars) == FAILURE) {
return;
}

tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 1 TSRMLS_CC);
/*tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 1 TSRMLS_CC);*/
if (!yaf_view_simple_eval(getThis(), tpl, vars, return_value TSRMLS_CC)) {
RETURN_FALSE;
}
Expand All @@ -860,13 +860,13 @@ PHP_METHOD(yaf_view_simple, eval) {
/** {{{ proto public Yaf_View_Simple::display(string $tpl, array $vars = NULL)
*/
PHP_METHOD(yaf_view_simple, display) {
zval *tpl, *tpl_vars, *vars = NULL;
zval *tpl, *vars = NULL; /* , *tpl_vars*/

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &tpl, &vars) == FAILURE) {
return;
}

tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 0 TSRMLS_CC);
/*tpl_vars = zend_read_property(yaf_view_simple_ce, getThis(), ZEND_STRL(YAF_VIEW_PROPERTY_NAME_TPLVARS), 0 TSRMLS_CC);*/
if (!yaf_view_simple_display(getThis(), tpl, vars, return_value TSRMLS_CC)) {
RETURN_FALSE;
}
Expand Down
4 changes: 1 addition & 3 deletions yaf_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_controller.c 328262 2012-11-06 10:31:55Z laruence $ */
/* $Id: yaf_controller.c 328819 2012-12-18 08:06:57Z remi $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -152,7 +152,6 @@ int yaf_controller_display(yaf_controller_t *instance, char *action_name, int le
zval *name, *param, *ret = NULL;
int path_len;
yaf_view_t *view;
zend_class_entry *view_ce;

view = zend_read_property(yaf_controller_ce, instance, ZEND_STRL(YAF_CONTROLLER_PROPERTY_NAME_VIEW), 1 TSRMLS_CC);
name = zend_read_property(yaf_controller_ce, instance, ZEND_STRL(YAF_CONTROLLER_PROPERTY_NAME_NAME), 1 TSRMLS_CC);
Expand Down Expand Up @@ -186,7 +185,6 @@ int yaf_controller_display(yaf_controller_t *instance, char *action_name, int le
MAKE_STD_ZVAL(param);
ZVAL_STRINGL(param, path, path_len, 0);

view_ce = Z_OBJCE_P(view);
if (var_array) {
zend_call_method_with_2_params(&view, Z_OBJCE_P(view), NULL, "display", &ret, param, var_array);
} else {
Expand Down
14 changes: 7 additions & 7 deletions yaf_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_dispatcher.c 328702 2012-12-07 02:20:15Z laruence $ */
/* $Id: yaf_dispatcher.c 328822 2012-12-18 08:25:56Z remi $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -424,7 +424,7 @@ zend_class_entry * yaf_dispatcher_get_action(char *app_dir, yaf_controller_t *co
/* {{{ This only effects internally */
if (YAF_G(st_compatible)) {
char *directory, *class, *class_lowercase, *p;
uint directory_len, class_len;
uint class_len;
zend_class_entry **ce;
char *action_upper = estrndup(action, len);

Expand All @@ -449,9 +449,9 @@ zend_class_entry * yaf_dispatcher_get_action(char *app_dir, yaf_controller_t *co
}

if (def_module) {
directory_len = spprintf(&directory, 0, "%s%c%s", app_dir, DEFAULT_SLASH, "actions");
spprintf(&directory, 0, "%s%c%s", app_dir, DEFAULT_SLASH, "actions");
} else {
directory_len = spprintf(&directory, 0, "%s%c%s%c%s%c%s", app_dir, DEFAULT_SLASH,
spprintf(&directory, 0, "%s%c%s%c%s%c%s", app_dir, DEFAULT_SLASH,
"modules", DEFAULT_SLASH, module, DEFAULT_SLASH, "actions");
}

Expand Down Expand Up @@ -522,7 +522,7 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,
return 0;
} else {
int is_def_module = 0;
int is_def_ctr = 0;
/* int is_def_ctr = 0; */
zval *module, *controller, *dmodule, *dcontroller, *instantly_flush;
zend_class_entry *ce;
yaf_controller_t *executor;
Expand Down Expand Up @@ -553,9 +553,9 @@ int yaf_dispatcher_handle(yaf_dispatcher_t *dispatcher, yaf_request_t *request,
is_def_module = 1;
}

if (strncasecmp(Z_STRVAL_P(dcontroller), Z_STRVAL_P(controller), Z_STRLEN_P(controller)) == 0) {
/* if (strncasecmp(Z_STRVAL_P(dcontroller), Z_STRVAL_P(controller), Z_STRLEN_P(controller)) == 0) {
is_def_ctr = 1;
}
} */

ce = yaf_dispatcher_get_controller(app_dir, Z_STRVAL_P(module), Z_STRVAL_P(controller), Z_STRLEN_P(controller), is_def_module TSRMLS_CC);
if (!ce) {
Expand Down
7 changes: 3 additions & 4 deletions yaf_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_loader.c 328439 2012-11-21 07:58:03Z laruence $ */
/* $Id: yaf_loader.c 328824 2012-12-18 10:13:17Z remi $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -190,7 +190,7 @@ static int yaf_loader_is_category(char *class, uint class_len, char *category, u
*/
int yaf_loader_is_local_namespace(yaf_loader_t *loader, char *class_name, int len TSRMLS_DC) {
char *pos, *ns, *prefix = NULL;
char orig_char, *backup = NULL;
char orig_char = 0, *backup = NULL;
uint prefix_len = 0;

if (!YAF_G(local_namespaces)) {
Expand Down Expand Up @@ -476,14 +476,13 @@ int yaf_internal_autoload(char *file_name, uint name_len, char **directory TSRML
/** {{{ int yaf_loader_register_namespace_single(char *prefix, uint len TSRMLS_DC)
*/
int yaf_loader_register_namespace_single(char *prefix, uint len TSRMLS_DC) {
char *namespaces;

if (YAF_G(local_namespaces)) {
uint orig_len = strlen(YAF_G(local_namespaces));
YAF_G(local_namespaces) = erealloc(YAF_G(local_namespaces), orig_len + 1 + len + 1);
snprintf(YAF_G(local_namespaces) + orig_len, len + 2, "%c%s", DEFAULT_DIR_SEPARATOR, prefix);
} else {
namespaces = YAF_G(local_namespaces) = emalloc(len + 1 + 1);
YAF_G(local_namespaces) = emalloc(len + 1 + 1);
snprintf(YAF_G(local_namespaces), len + 2, "%s", prefix);
}

Expand Down
4 changes: 2 additions & 2 deletions yaf_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
*/

/* $Id: yaf_request.c 328176 2012-10-29 06:20:10Z laruence $*/
/* $Id: yaf_request.c 328820 2012-12-18 08:16:24Z remi $*/

#ifdef HAVE_CONFIG_H
#include "config.h"
Expand Down Expand Up @@ -226,7 +226,7 @@ int yaf_request_set_base_uri(yaf_request_t *request, char *base_uri, char *reque
/** {{{ zval * yaf_request_query(uint type, char * name, uint len TSRMLS_DC)
*/
zval * yaf_request_query(uint type, char * name, uint len TSRMLS_DC) {
zval **carrier, **ret;
zval **carrier = NULL, **ret;

#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 4)
zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays));
Expand Down

0 comments on commit a6c0d5a

Please sign in to comment.