Skip to content

Commit

Permalink
Fixed some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Feb 25, 2025
1 parent 2bb184e commit 860ffcd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion php_yaf.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ int yaf_call_user_method_with_1_arguments(zend_object *obj, zend_function *fbc,
int yaf_call_user_method_with_2_arguments(zend_object *obj, zend_function *fbc, zval *arg1, zval *arg2, zval *ret);
void yaf_replace_chr(char *name, uint32_t len, zend_uchar f, zend_uchar t);

extern const char const *yaf_known_chars[];
extern const char *yaf_known_chars[];
extern zend_string **yaf_known_strings;
#define YAF_KNOWN_STR(id) (yaf_known_strings[id])
#define YAF_KNOWN_CHARS(id) (yaf_known_chars[id])
Expand Down
6 changes: 3 additions & 3 deletions routes/yaf_route_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ static inline zend_string *yaf_route_map_build(const char *src, size_t len, zend
unsigned char *p, *q, *e;
zend_string *result = zend_string_alloc(end - str, 0);

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

if (ctl) {
*p++ = toupper(*q++);
} else {
*p++, *q++;
p++, q++;
}
while (q < e) {
if (*q == YAF_ROUTER_URL_DELIMIETER) {
Expand Down Expand Up @@ -167,7 +167,7 @@ static inline zend_string *yaf_route_map_build(const char *src, size_t len, zend

int yaf_route_map_route(yaf_route_t *route, yaf_request_t *req) /* {{{ */ {
size_t len, query_len;
const char *uri, *query, *p;
const char *uri, *query;
yaf_request_object *request = Z_YAFREQUESTOBJ_P(req);
yaf_route_map_object *map = Z_YAFROUTEMAPOBJ_P(route);

Expand Down
6 changes: 3 additions & 3 deletions yaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
ZEND_DECLARE_MODULE_GLOBALS(yaf);

zend_string **yaf_known_strings = NULL;
const char const *yaf_known_chars[] = {
const char *yaf_known_chars[] = {
#define _YAF_CHARS(id, str) str,
YAF_KNOWN_NAMES(_YAF_CHARS)
#undef _YAF_CHARS
Expand Down Expand Up @@ -600,11 +600,11 @@ PHP_MINIT_FUNCTION(yaf)
*/
PHP_MSHUTDOWN_FUNCTION(yaf)
{
uint32_t idx = 0;
int idx = 0;

UNREGISTER_INI_ENTRIES();

for (idx; idx < sizeof(yaf_known_chars)/sizeof(char*) - 1; idx++) {
for (; idx < sizeof(yaf_known_chars)/sizeof(char*) - 1; idx++) {
free(yaf_known_strings[idx]);
}
free(yaf_known_strings);
Expand Down
2 changes: 2 additions & 0 deletions yaf_dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ ZEND_HOT yaf_response_t *yaf_dispatcher_dispatch(yaf_dispatcher_object *dispatch
yaf_trigger_error(YAF_ERR_DISPATCH_FAILED, "The maximum dispatching count %ld is reached", yaf_get_forward_limit());
YAF_EXCEPTION_HANDLE(dispatcher);
}

return NULL;
}
/* }}} */

Expand Down

0 comments on commit 860ffcd

Please sign in to comment.