Merge pull request #3655 from onikitenko/vsftpd-fix
[feed/packages.git] / lang / php7-pecl-dio / patches / 0009-Replace-zend_hash_find-with-zend_hash_str_find.patch
1 From 7533f64b19006262fae7c6a4769392c67078166b Mon Sep 17 00:00:00 2001
2 From: Michael Heimpold <mhei@heimpold.de>
3 Date: Wed, 13 Jul 2016 01:07:22 +0200
4 Subject: [PATCH 09/16] Replace zend_hash_find with zend_hash_str_find
5
6 Signed-off-by: Michael Heimpold <mhei@heimpold.de>
7 ---
8 dio.c | 44 ++++++++++++++++++++++----------------------
9 1 file changed, 22 insertions(+), 22 deletions(-)
10
11 diff --git a/dio.c b/dio.c
12 index e8660f8..b489747 100644
13 --- a/dio.c
14 +++ b/dio.c
15 @@ -364,7 +364,7 @@ PHP_FUNCTION(dio_fcntl)
16 switch (cmd) {
17 case F_SETLK:
18 case F_SETLKW: {
19 - zval **element;
20 + zval *element;
21 struct flock lk = {0};
22 HashTable *fh;
23
24 @@ -374,28 +374,28 @@ PHP_FUNCTION(dio_fcntl)
25 }
26 if (Z_TYPE_P(arg) == IS_ARRAY) {
27 fh = HASH_OF(arg);
28 - if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) {
29 + if ((element = zend_hash_str_find(fh, "start", sizeof("start"))) == NULL) {
30 lk.l_start = 0;
31 } else {
32 - lk.l_start = Z_LVAL_PP(element);
33 + lk.l_start = Z_LVAL_P(element);
34 }
35
36 - if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) {
37 + if ((element = zend_hash_str_find(fh, "length", sizeof("length"))) == NULL) {
38 lk.l_len = 0;
39 } else {
40 - lk.l_len = Z_LVAL_PP(element);
41 + lk.l_len = Z_LVAL_P(element);
42 }
43
44 - if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) {
45 + if ((element = zend_hash_str_find(fh, "whence", sizeof("whence"))) == NULL) {
46 lk.l_whence = 0;
47 } else {
48 - lk.l_whence = Z_LVAL_PP(element);
49 + lk.l_whence = Z_LVAL_P(element);
50 }
51
52 - if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) {
53 + if ((element = zend_hash_str_find(fh, "type", sizeof("type"))) == NULL) {
54 lk.l_type = 0;
55 } else {
56 - lk.l_type = Z_LVAL_PP(element);
57 + lk.l_type = Z_LVAL_P(element);
58 }
59 } else if (Z_TYPE_P(arg) == IS_LONG) {
60 lk.l_start = 0;
61 @@ -463,7 +463,7 @@ PHP_FUNCTION(dio_tcsetattr)
62 int Baud_Rate, Data_Bits=8, Stop_Bits=1, Parity=0, Flow_Control=1, Is_Canonical=1;
63 long BAUD,DATABITS,STOPBITS,PARITYON,PARITY;
64 HashTable *fh;
65 - zval **element;
66 + zval *element;
67
68 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
69 return;
70 @@ -480,40 +480,40 @@ PHP_FUNCTION(dio_tcsetattr)
71
72 fh = HASH_OF(arg);
73
74 - if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) {
75 + if ((element = zend_hash_str_find(fh, "baud", sizeof("baud"))) == NULL) {
76 Baud_Rate = 9600;
77 } else {
78 - Baud_Rate = Z_LVAL_PP(element);
79 + Baud_Rate = Z_LVAL_P(element);
80 }
81
82 - if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) {
83 + if ((element = zend_hash_str_find(fh, "bits", sizeof("bits"))) == NULL) {
84 Data_Bits = 8;
85 } else {
86 - Data_Bits = Z_LVAL_PP(element);
87 + Data_Bits = Z_LVAL_P(element);
88 }
89
90 - if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) {
91 + if ((element = zend_hash_str_find(fh, "stop", sizeof("stop"))) == NULL) {
92 Stop_Bits = 1;
93 } else {
94 - Stop_Bits = Z_LVAL_PP(element);
95 + Stop_Bits = Z_LVAL_P(element);
96 }
97
98 - if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) {
99 + if ((element = zend_hash_str_find(fh, "parity", sizeof("parity"))) == NULL) {
100 Parity = 0;
101 } else {
102 - Parity = Z_LVAL_PP(element);
103 + Parity = Z_LVAL_P(element);
104 }
105
106 - if (zend_hash_find(fh, "flow_control", sizeof("flow_control"), (void **) &element) == FAILURE) {
107 + if ((element = zend_hash_str_find(fh, "flow_control", sizeof("flow_control"))) == NULL) {
108 Flow_Control = 1;
109 } else {
110 - Flow_Control = Z_LVAL_PP(element);
111 + Flow_Control = Z_LVAL_P(element);
112 }
113
114 - if (zend_hash_find(fh, "is_canonical", sizeof("is_canonical"), (void **) &element) == FAILURE) {
115 + if ((element = zend_hash_str_find(fh, "is_canonical", sizeof("is_canonical"))) == NULL) {
116 Is_Canonical = 0;
117 } else {
118 - Is_Canonical = Z_LVAL_PP(element);
119 + Is_Canonical = Z_LVAL_P(element);
120 }
121
122 /* assign to correct values... */
123 --
124 2.5.0
125