Skip to content

Commit 3a4d3b8

Browse files
committed
tree-wide: Replace ZEND_STATIC_ASSERT() by static_assert()
1 parent af69d3a commit 3a4d3b8

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Zend/zend_compile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ struct _zend_execute_data {
711711
(call)->This.u2.num_args
712712

713713
/* Ensure the correct alignment before slots calculation */
714-
ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
714+
static_assert(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
715715
"zval must be aligned by ZEND_MM_ALIGNMENT");
716716
/* A number of call frame slots (zvals) reserved for zend_execute_data. */
717717
#define ZEND_CALL_FRAME_SLOT \

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ struct _zend_vm_stack {
294294
};
295295

296296
/* Ensure the correct alignment before slots calculation */
297-
ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
297+
static_assert(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval),
298298
"zval must be aligned by ZEND_MM_ALIGNMENT");
299299
/* A number of call frame slots (zvals) reserved for _zend_vm_stack. */
300300
#define ZEND_VM_STACK_HEADER_SLOTS \

ext/random/engine_mt19937.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
*/
8888

8989
#define N 624 /* length of state vector */
90-
ZEND_STATIC_ASSERT(
90+
static_assert(
9191
N == sizeof(((php_random_status_state_mt19937*)0)->state) / sizeof(((php_random_status_state_mt19937*)0)->state[0]),
9292
"Assumed length of Mt19937 state vector does not match actual size."
9393
);

ext/random/php_random_zend_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct _php_random_bytes_insecure_state_for_zend {
2727
php_random_status_state_xoshiro256starstar xoshiro256starstar_state;
2828
} php_random_bytes_insecure_state_for_zend;
2929

30-
ZEND_STATIC_ASSERT(sizeof(zend_random_bytes_insecure_state) >= sizeof(php_random_bytes_insecure_state_for_zend), "");
30+
static_assert(sizeof(zend_random_bytes_insecure_state) >= sizeof(php_random_bytes_insecure_state_for_zend), "");
3131

3232
ZEND_ATTRIBUTE_NONNULL PHPAPI void php_random_bytes_insecure_for_zend(
3333
zend_random_bytes_insecure_state *state, void *bytes, size_t size);

0 commit comments

Comments
 (0)