summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Minichmayr <markus@tapkey.com>2022-10-06 08:11:16 +0200
committerAllen Winter <allen.winter@kdab.com>2022-11-22 05:12:15 -0500
commit7834e1c798c00775253c59b5fae366bba3997cab (patch)
treedd21a402600e25dc0e50b19bee20139bf890358d
parent7ca4e2f8be8aba1a91844dcc1b07f73e2e9d1fd1 (diff)
downloadlibical-git-7834e1c798c00775253c59b5fae366bba3997cab.tar.gz
Mark read-only static variables as const.
-rw-r--r--src/libical/icalcomponent.c2
-rw-r--r--src/libical/icalrecur.c2
-rw-r--r--src/libical/icaltime.c2
-rw-r--r--src/libical/icaltimezone.c2
-rw-r--r--src/libical/sspm.c8
5 files changed, 8 insertions, 8 deletions
diff --git a/src/libical/icalcomponent.c b/src/libical/icalcomponent.c
index e137173f..daad9694 100644
--- a/src/libical/icalcomponent.c
+++ b/src/libical/icalcomponent.c
@@ -1134,7 +1134,7 @@ void icalcomponent_set_parent(icalcomponent *component, icalcomponent *parent)
component->parent = parent;
}
-static icalcompiter icalcompiter_null = { ICAL_NO_COMPONENT, 0 };
+static const icalcompiter icalcompiter_null = { ICAL_NO_COMPONENT, 0 };
struct icalcomponent_kind_map
{
diff --git a/src/libical/icalrecur.c b/src/libical/icalrecur.c
index 96d4190f..4a135362 100644
--- a/src/libical/icalrecur.c
+++ b/src/libical/icalrecur.c
@@ -375,7 +375,7 @@ static const struct expand_split_map_struct expand_map[] = {
{ICAL_NO_RECURRENCE, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }} //krazy:exclude=style
};
-static struct recur_map
+static const struct recur_map
{
const char *str;
size_t offset;
diff --git a/src/libical/icaltime.c b/src/libical/icaltime.c
index 13213195..1b1821d8 100644
--- a/src/libical/icaltime.c
+++ b/src/libical/icaltime.c
@@ -104,7 +104,7 @@ static icaltime_t make_time(struct tm *tm, int tzm)
icaltime_t tim;
int febs;
- static int days[] = { -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364 };
+ static const int days[] = { -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364 };
/* check that month specification within range */
diff --git a/src/libical/icaltimezone.c b/src/libical/icaltimezone.c
index b272c0f0..9613ab10 100644
--- a/src/libical/icaltimezone.c
+++ b/src/libical/icaltimezone.c
@@ -56,7 +56,7 @@ static pthread_mutex_t changes_mutex = PTHREAD_MUTEX_INITIALIZER;
#define BUILTIN_TZID_PREFIX "/freeassociation.sourceforge.net/"
/* Known prefixes from the old versions of libical */
-static struct _compat_tzids {
+static const struct _compat_tzids {
const char *tzid;
int slashes;
} glob_compat_tzids[] = {
diff --git a/src/libical/sspm.c b/src/libical/sspm.c
index e05d22f7..ef352c9f 100644
--- a/src/libical/sspm.c
+++ b/src/libical/sspm.c
@@ -63,7 +63,7 @@ struct mime_impl
static void *sspm_make_multipart_part(struct mime_impl *impl, struct sspm_header *header);
static void *sspm_make_multipart_subpart(struct mime_impl *impl, struct sspm_header *parent_header);
-static struct major_content_type_map
+static const struct major_content_type_map
{
enum sspm_major_type type;
const char *str;
@@ -81,7 +81,7 @@ static struct major_content_type_map
{SSPM_UNKNOWN_MAJOR_TYPE, ""}
};
-static struct minor_content_type_map
+static const struct minor_content_type_map
{
enum sspm_minor_type type;
const char *str;
@@ -99,7 +99,7 @@ static struct minor_content_type_map
{SSPM_UNKNOWN_MINOR_TYPE, ""}
};
-static struct encoding_map
+static const struct encoding_map
{
enum sspm_encoding encoding;
const char *str;
@@ -252,7 +252,7 @@ static void sspm_default_free_part(void *part)
_unused(part);
}
-static struct sspm_action_map sspm_action_map[] = {
+static const struct sspm_action_map sspm_action_map[] = {
{SSPM_UNKNOWN_MAJOR_TYPE, SSPM_UNKNOWN_MINOR_TYPE, sspm_default_new_part, sspm_default_add_line,
sspm_default_end_part, sspm_default_free_part},
};