Commit ad7cce6
authored
zend_portability: Add
* zend_portability: Add `ZEND_CONTAINER_OF()`
* tree-wide: Use `ZEND_CONTAINER_OF()`
Changes made with Coccinelle:
@@
type T_container;
identifier member;
expression e;
@@
- (T_container *)(((char *)(e)) - offsetof(T_container, member))
+ ZEND_CONTAINER_OF(e, T_container, member)
@@
type T_container;
identifier member;
expression e;
typedef uintptr_t;
@@
- (T_container *)(((uintptr_t)(e)) - offsetof(T_container, member))
+ ZEND_CONTAINER_OF(e, T_container, member)
@@
type T_container;
identifier member;
expression e;
@@
- (const T_container *)(((char *)(e)) - offsetof(T_container, member))
+ ZEND_CONTAINER_OF(e, T_container, member)
@@
type T_container;
identifier member;
expression e;
typedef uintptr_t;
@@
- (const T_container *)(((uintptr_t)(e)) - offsetof(T_container, member))
+ ZEND_CONTAINER_OF(e, T_container, member)
* bcmath: Fix `get_bcmath_number_from_obj()` const-correctness
A follow-up change to the new `ZEND_CONTAINER_OF()` macro will preserve the
`const`-ness of the input pointer. By wrapping this macro inside a macro rather
an an inline function we can preserve the `const`-ness across all layers.
* zend_portability: Keep `const`-ness in `ZEND_CONTAINER_OF()`
* zend_portability: Add C++ version to `ZEND_CONTAINER_OF()`ZEND_CONTAINER_OF() (php#21903)1 parent d6b7bd0 commit ad7cce6
69 files changed
Lines changed: 123 additions & 97 deletions
File tree
- Zend
- Optimizer
- ext
- bcmath
- curl
- date
- dba
- dom
- enchant
- fileinfo
- gd
- gmp
- intl
- breakiterator
- calendar
- collator
- common
- dateformat
- formatter
- listformatter
- msgformat
- rangeformatter
- resourcebundle
- spoofchecker
- timezone
- transliterator
- ldap
- mysqli
- odbc
- openssl
- pdo
- pgsql
- random
- reflection
- shmop
- simplexml
- snmp
- soap
- sockets
- spl
- sqlite3
- sysvmsg
- sysvsem
- sysvshm
- tidy
- uri
- xmlreader
- xmlwriter
- xml
- xsl
- zend_test
- zip
- zlib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
780 | 780 | | |
781 | 781 | | |
782 | 782 | | |
783 | | - | |
| 783 | + | |
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
804 | | - | |
| 804 | + | |
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
| 833 | + | |
834 | 834 | | |
835 | 835 | | |
836 | 836 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5175 | 5175 | | |
5176 | 5176 | | |
5177 | 5177 | | |
5178 | | - | |
| 5178 | + | |
5179 | 5179 | | |
5180 | 5180 | | |
5181 | 5181 | | |
| |||
5472 | 5472 | | |
5473 | 5473 | | |
5474 | 5474 | | |
5475 | | - | |
| 5475 | + | |
5476 | 5476 | | |
5477 | 5477 | | |
5478 | 5478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
390 | 418 | | |
391 | 419 | | |
392 | 420 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
875 | 875 | | |
876 | 876 | | |
877 | 877 | | |
878 | | - | |
879 | | - | |
880 | | - | |
881 | | - | |
| 878 | + | |
882 | 879 | | |
883 | 880 | | |
884 | 881 | | |
| |||
1214 | 1211 | | |
1215 | 1212 | | |
1216 | 1213 | | |
1217 | | - | |
| 1214 | + | |
1218 | 1215 | | |
1219 | 1216 | | |
1220 | 1217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
0 commit comments