From abf7c40185e18192cacda867c9da10c3a77fb11f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 3 May 2024 19:43:33 +0200 Subject: [PATCH] const: static array Such array can be stored in .rodata section. --- device_mapper/libdm-report.c | 2 +- lib/report/report.c | 2 +- libdm/libdm-report.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/device_mapper/libdm-report.c b/device_mapper/libdm-report.c index 122ca83ab..24d350db5 100644 --- a/device_mapper/libdm-report.c +++ b/device_mapper/libdm-report.c @@ -2867,7 +2867,7 @@ static const char *_out_of_range_msg = "Field selection value %s out of supporte #define DELIM_DATE '-' #define DELIM_TIME ':' -static int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +static const int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static int _is_leap_year(long year) { diff --git a/lib/report/report.c b/lib/report/report.c index 319f423d2..da41d1635 100644 --- a/lib/report/report.c +++ b/lib/report/report.c @@ -851,7 +851,7 @@ static void _adjust_time_for_granularity(struct time_info *info, struct tm *tm, #define SECS_PER_HOUR 3600 #define SECS_PER_DAY ((time_t)86400) -static int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +static const int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static int _is_leap_year(long year) { diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 87defe94a..d37bfceb0 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -2865,7 +2865,7 @@ static const char *_out_of_range_msg = "Field selection value %s out of supporte #define DELIM_DATE '-' #define DELIM_TIME ':' -static int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; +static const int _days_in_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static int _is_leap_year(long year) {