summaryrefslogtreecommitdiffstats
path: root/hdr_histogram-build.patch
blob: 0f043ee872e1f03d7aa6fbe7faca99a2fd4258d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 5b5990ab8093aa408f91de456b3ce7284dc35d63 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 24 Apr 2024 08:46:46 +0200
Subject: [PATCH 1/2] fix decl requiring c99

---
 hdrhistogram.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hdrhistogram.c b/hdrhistogram.c
index c24d1eb..baf9281 100644
--- a/hdrhistogram.c
+++ b/hdrhistogram.c
@@ -673,7 +673,8 @@ PHP_FUNCTION(hdr_export)
 
     int64_t found = 0;
     zend_long skipped = 0;
-    for (int32_t i = 0; i < hdr->counts_len; i++) {
+    int32_t i;
+    for (i = 0; i < hdr->counts_len; i++) {
         if (found >= hdr->total_count) {
             break;
         }

From 3f378645578cae0a48bb98a01153353adc104d85 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 24 Apr 2024 08:47:29 +0200
Subject: [PATCH 2/2] fix warning [-Wunused-but-set-variable]

---
 hdrhistogram.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hdrhistogram.c b/hdrhistogram.c
index baf9281..842ad26 100644
--- a/hdrhistogram.c
+++ b/hdrhistogram.c
@@ -775,6 +775,7 @@ PHP_FUNCTION(hdr_import)
         zend_ulong num_key;
         int bucket = 0;
         ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(value), num_key, key, item) {
+            (void)num_key;
             if (!key && bucket < hdr->counts_len) {
                 convert_to_long_ex(item);
                 if (Z_LVAL_P(item) > 0) {