Skip to content

Commit 860ffcd

Browse files
committed
Fixed some compiler warnings
1 parent 2bb184e commit 860ffcd

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

php_yaf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ int yaf_call_user_method_with_1_arguments(zend_object *obj, zend_function *fbc,
158158
int yaf_call_user_method_with_2_arguments(zend_object *obj, zend_function *fbc, zval *arg1, zval *arg2, zval *ret);
159159
void yaf_replace_chr(char *name, uint32_t len, zend_uchar f, zend_uchar t);
160160

161-
extern const char const *yaf_known_chars[];
161+
extern const char *yaf_known_chars[];
162162
extern zend_string **yaf_known_strings;
163163
#define YAF_KNOWN_STR(id) (yaf_known_strings[id])
164164
#define YAF_KNOWN_CHARS(id) (yaf_known_chars[id])

routes/yaf_route_map.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ static inline zend_string *yaf_route_map_build(const char *src, size_t len, zend
129129
unsigned char *p, *q, *e;
130130
zend_string *result = zend_string_alloc(end - str, 0);
131131

132-
zend_str_tolower_copy(ZSTR_VAL(result), str, end - str);
132+
zend_str_tolower_copy(ZSTR_VAL(result), (char*)str, end - str);
133133
p = q = (unsigned char*)ZSTR_VAL(result);
134134
e = p + ZSTR_LEN(result);
135135

136136
if (ctl) {
137137
*p++ = toupper(*q++);
138138
} else {
139-
*p++, *q++;
139+
p++, q++;
140140
}
141141
while (q < e) {
142142
if (*q == YAF_ROUTER_URL_DELIMIETER) {
@@ -167,7 +167,7 @@ static inline zend_string *yaf_route_map_build(const char *src, size_t len, zend
167167

168168
int yaf_route_map_route(yaf_route_t *route, yaf_request_t *req) /* {{{ */ {
169169
size_t len, query_len;
170-
const char *uri, *query, *p;
170+
const char *uri, *query;
171171
yaf_request_object *request = Z_YAFREQUESTOBJ_P(req);
172172
yaf_route_map_object *map = Z_YAFROUTEMAPOBJ_P(route);
173173

yaf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
ZEND_DECLARE_MODULE_GLOBALS(yaf);
5151

5252
zend_string **yaf_known_strings = NULL;
53-
const char const *yaf_known_chars[] = {
53+
const char *yaf_known_chars[] = {
5454
#define _YAF_CHARS(id, str) str,
5555
YAF_KNOWN_NAMES(_YAF_CHARS)
5656
#undef _YAF_CHARS
@@ -600,11 +600,11 @@ PHP_MINIT_FUNCTION(yaf)
600600
*/
601601
PHP_MSHUTDOWN_FUNCTION(yaf)
602602
{
603-
uint32_t idx = 0;
603+
int idx = 0;
604604

605605
UNREGISTER_INI_ENTRIES();
606606

607-
for (idx; idx < sizeof(yaf_known_chars)/sizeof(char*) - 1; idx++) {
607+
for (; idx < sizeof(yaf_known_chars)/sizeof(char*) - 1; idx++) {
608608
free(yaf_known_strings[idx]);
609609
}
610610
free(yaf_known_strings);

yaf_dispatcher.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ ZEND_HOT yaf_response_t *yaf_dispatcher_dispatch(yaf_dispatcher_object *dispatch
761761
yaf_trigger_error(YAF_ERR_DISPATCH_FAILED, "The maximum dispatching count %ld is reached", yaf_get_forward_limit());
762762
YAF_EXCEPTION_HANDLE(dispatcher);
763763
}
764+
765+
return NULL;
764766
}
765767
/* }}} */
766768

0 commit comments

Comments
 (0)