Skip to content

Commit 543134f

Browse files
committed
Mark constant static arrays in function bodies actually as const
1 parent e951202 commit 543134f

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Zend/zend_strtod.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ pow5mult
959959
{
960960
Bigint *b1, *p5, *p51;
961961
int i;
962-
static int p05[3] = { 5, 25, 125 };
962+
static const int p05[3] = { 5, 25, 125 };
963963

964964
if ((i = k & 3))
965965
b = multadd(b, p05[i-1], 0);

ext/fileinfo/libmagic/cdf_time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
100100
{
101101
struct tm tm;
102102
#ifdef HAVE_STRUCT_TM_TM_ZONE
103-
static char UTC[] = "UTC";
103+
static const char UTC[] = "UTC";
104104
#endif
105105
int rdays;
106106

ext/hash/hash_snefru.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void ph(uint32_t h[16])
3939

4040
static inline void Snefru(uint32_t input[16])
4141
{
42-
static int shifts[4] = {16, 8, 16, 24};
42+
static const int shifts[4] = {16, 8, 16, 24};
4343
int b, index, rshift, lshift;
4444
const uint32_t *t0,*t1;
4545
uint32_t SBE,B00,B01,B02,B03,B04,B05,B06,B07,B08,B09,B10,B11,B12,B13,B14,B15;

ext/iconv/iconv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
906906
char *out_p;
907907
size_t out_left;
908908
zend_string *encoded = NULL;
909-
static int qp_table[256] = {
909+
static const int qp_table[256] = {
910910
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x00 */
911911
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 0x10 */
912912
3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x20 */

ext/mbstring/libmbfl/mbfl/mbfilter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ mime_header_encoder_block_collector(int c, void *data)
653653
static int
654654
mime_header_encoder_collector(int c, void *data)
655655
{
656-
static int qp_table[256] = {
656+
static const int qp_table[256] = {
657657
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 */
658658
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0x00 */
659659
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */

0 commit comments

Comments
 (0)