Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/e7bffc01c496ef36ce672c612984b13a27426788 From e7bffc01c496ef36ce672c612984b13a27426788 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 6 Mar 2023 09:29:07 +0100 Subject: [PATCH] Fix [-Wincompatible-pointer-types] warning --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.c b/parse.c index e63f3d8..17f70ba 100644 --- a/parse.c +++ b/parse.c @@ -531,7 +531,7 @@ void handle_sequence (parser_state_t *state, zval *retval) { /* apply callbacks to the collected node */ if (Y_FILTER_FAILURE == apply_filter( retval, src_event, state->callbacks)) { - zval_ptr_dtor(&retval); + zval_ptr_dtor(retval); ZVAL_UNDEF(retval); goto done; //TODO Sean-Der Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/730a781f7773f752efb17d88737d5ba5b043fa87 From 730a781f7773f752efb17d88737d5ba5b043fa87 Mon Sep 17 00:00:00 2001 From: Tom Regner Date: Thu, 9 Mar 2023 14:03:56 +0100 Subject: [PATCH] Fix #75: Handle zndocs/ndocs correctly Just changing the handling, that is param handling of ndocs and dtor call for zndocs, in yaml_parse_file to that in yaml_parse. That fixes #75 for me. --- yaml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaml.c b/yaml.c index 4ca2cfe..d157a5b 100644 --- a/yaml.c +++ b/yaml.c @@ -407,7 +407,7 @@ PHP_FUNCTION(yaml_parse_file) YAML_G(timestamp_decoder) = NULL; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), - "s|lza/", &filename, &filename_len, &pos, &zndocs, + "s|lz/a/", &filename, &filename_len, &pos, &zndocs, &zcallbacks)) { return; } @@ -451,7 +451,7 @@ PHP_FUNCTION(yaml_parse_file) if (zndocs != NULL) { /* copy document count to var user sent in */ - zval_dtor(zndocs); + zval_ptr_dtor(zndocs); ZVAL_LONG(zndocs, ndocs); } Patch-Source: https://github.com/php/pecl-file_formats-yaml/commit/09bc7fd194cca241d5ce9daef56ee4e51d4e6ed9 From 09bc7fd194cca241d5ce9daef56ee4e51d4e6ed9 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Tue, 28 Mar 2023 13:42:51 -0600 Subject: [PATCH] yaml.c: Use PHP_FE_END macro --- yaml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml.c b/yaml.c index d157a5b..a91d4f1 100644 --- a/yaml.c +++ b/yaml.c @@ -133,7 +133,7 @@ static zend_function_entry yaml_functions[] = { PHP_FE(yaml_parse_url, arginfo_yaml_parse_url) PHP_FE(yaml_emit, arginfo_yaml_emit) PHP_FE(yaml_emit_file, arginfo_yaml_emit_file) - {NULL, NULL, NULL} + PHP_FE_END }; /* }}} */ From fe099012e1526abc6eb22c30d5b5340748ab9545 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Tue, 28 Mar 2023 14:48:04 -0600 Subject: [PATCH] emit.c: fix -Wsign-compare Use size_t for strlen to avoid sign-compare warning. --- emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emit.c b/emit.c index b93db5a..ab7e46c 100644 --- a/emit.c +++ b/emit.c @@ -433,7 +433,7 @@ static int y_write_string( size_t pos = 0, us; int j; const unsigned char *s = (const unsigned char *)Z_STRVAL_P(data); - int len = Z_STRLEN_P(data); + size_t len = Z_STRLEN_P(data); for (j = 0; pos < len; j++) { us = get_next_char(s, len, &pos, &status);