[prev in list] [next in list] [prev in thread] [next in thread]
List: pecl-cvs
Subject: [PECL-CVS] [pecl-processing-rrd] master: Fix Windows build for PHP 7.4 (#1)
From: "Christoph M. Becker via GitHub" <noreply () php ! net>
Date: 2021-04-22 14:22:55
Message-ID: vMHvNzdGWFS8QXNgvC00z7uOBB20A8df7w8WEOlyI () main ! php ! net
[Download RAW message or body]
Author: Christoph M. Becker (cmb69)
Committer: GitHub (web-flow)
Pusher: MirKml
Date: 2021-04-22T16:23:04+02:00
Commit: https://github.com/php/pecl-processing-rrd/commit/ee9f807108f5ef38ecd3e6c50dd00acbe4becb9e
Raw diff: https://github.com/php/pecl-processing-rrd/commit/ee9f807108f5ef38ecd3e6c50dd00acbe4becb9e.diff
Fix Windows build for PHP 7.4 (#1)
As of PHP 7.4.0, fallback declarations of `uint` and `ulong` have been
removed. These types are not declared on Windows, and maybe on macOS.
Thus, we replace their usage with `unsigned` and `zend_ulong`,
respectively.
Changed paths:
M rrd.c
M rrd_graph.c
M rrd_info.c
M rrd_info.h
Diff:
diff --git a/rrd.c b/rrd.c
index 9634774..526f094 100644
--- a/rrd.c
+++ b/rrd.c
@@ -55,7 +55,7 @@ PHP_FUNCTION(rrd_fetch)
rrd_args *argv;
/* returned values if rrd_fetch doesn't fail */
time_t start, end;
- ulong step,
+ zend_ulong step,
ds_cnt; /* count of data sources */
char **ds_namv; /* list of data source names */
rrd_value_t *ds_data; /* all data from all sources */
@@ -95,7 +95,7 @@ PHP_FUNCTION(rrd_fetch)
add_assoc_null(return_value, "data");
} else {
rrd_value_t *datap = ds_data;
- uint timestamp, ds_counter;
+ unsigned timestamp, ds_counter;
/* final array for all data from all data sources */
zval zv_data_array;
@@ -263,7 +263,7 @@ PHP_FUNCTION(rrd_lastupdate)
if (!ds_namv || !ds_cnt) {
add_assoc_null(return_value, "ds_namv");
} else {
- uint i;
+ unsigned i;
zval zv_ds_namv_array;
array_init(&zv_ds_namv_array);
@@ -279,7 +279,7 @@ PHP_FUNCTION(rrd_lastupdate)
if (!last_ds || !ds_cnt) {
add_assoc_null(return_value, "data");
} else {
- uint i;
+ unsigned i;
zval zv_data_array;
array_init(&zv_data_array);
@@ -396,11 +396,11 @@ PHP_FUNCTION(rrd_xport)
/* return values from rrd_xport */
int xxsize;
time_t start, end, time_index;
- ulong step, outvar_count;
+ zend_ulong step, outvar_count;
char **legend_v;
rrd_value_t *data, *data_ptr;
zval zv_data;
- ulong outvar_index;
+ zend_ulong outvar_index;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &zv_arr_options) == FAILURE) {
return;
@@ -637,7 +637,7 @@ zend_module_entry rrd_module_entry = {
rrd_args *rrd_args_init_by_phparray(const char *command_name, const char *filename,
const zval *options)
{
- uint i, option_count, args_counter = 2;
+ unsigned i, option_count, args_counter = 2;
rrd_args *result;
if (Z_TYPE_P(options) != IS_ARRAY) return NULL;
diff --git a/rrd_graph.c b/rrd_graph.c
index 526797e..96a47f4 100644
--- a/rrd_graph.c
+++ b/rrd_graph.c
@@ -230,7 +230,7 @@ PHP_METHOD(RRDGraph, save)
zval zv_calcpr_array;
array_init(&zv_calcpr_array);
if (calcpr) {
- uint i;
+ unsigned i;
for (i = 0; calcpr[i]; i++) {
add_next_index_string(&zv_calcpr_array, calcpr[i]);
free(calcpr[i]);
@@ -342,7 +342,7 @@ PHP_FUNCTION(rrd_graph)
zval zv_calcpr_array;
array_init(&zv_calcpr_array);
if (calcpr) {
- uint i;
+ unsigned i;
for (i = 0; calcpr[i]; i++) {
add_next_index_string(&zv_calcpr_array, calcpr[i]);
free(calcpr[i]);
diff --git a/rrd_info.c b/rrd_info.c
index bbc9b2f..19cb1b5 100644
--- a/rrd_info.c
+++ b/rrd_info.c
@@ -60,7 +60,7 @@ PHP_FUNCTION(rrd_info)
/* {{{ converts rrd_info_t struct into php array
@return int 1 OK, 0 conversion failed
*/
-uint rrd_info_toarray(const rrd_info_t *rrd_info_data, zval *array)
+unsigned rrd_info_toarray(const rrd_info_t *rrd_info_data, zval *array)
{
const rrd_info_t *data_p;
diff --git a/rrd_info.h b/rrd_info.h
index c02b50c..9f679c0 100644
--- a/rrd_info.h
+++ b/rrd_info.h
@@ -15,6 +15,6 @@ extern PHP_FUNCTION(rrd_info);
/* necessary, because rrd_info_t definition is needed for function definition */
#include <rrd.h>
-extern uint rrd_info_toarray(const rrd_info_t *rrd_info_data, zval *array);
+extern unsigned rrd_info_toarray(const rrd_info_t *rrd_info_data, zval *array);
#endif /* RRD_INFO_H */
--
PECL CVS Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic