From 718729053637fe7e844e57e52cd004ae91e40bb2 Mon Sep 17 00:00:00 2001 From: Benedikt Heine Date: Fri, 6 Jul 2018 18:40:25 +0200 Subject: [PATCH] Turn read only fields into const --- src/notification.c | 10 +++++----- src/notification.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/notification.c b/src/notification.c index df5b851..44730ee 100644 --- a/src/notification.c +++ b/src/notification.c @@ -98,10 +98,10 @@ void notification_run_script(notification *n) if (!n->script || strlen(n->script) < 1) return; - char *appname = n->appname ? n->appname : ""; - char *summary = n->summary ? n->summary : ""; - char *body = n->body ? n->body : ""; - char *icon = n->icon ? n->icon : ""; + const char *appname = n->appname ? n->appname : ""; + const char *summary = n->summary ? n->summary : ""; + const char *body = n->body ? n->body : ""; + const char *icon = n->icon ? n->icon : ""; const char *urgency = notification_urgency_to_string(n->urgency); @@ -134,7 +134,7 @@ void notification_run_script(notification *n) /* * Helper function to convert an urgency to a string */ -const char *notification_urgency_to_string(enum urgency urgency) +const char *notification_urgency_to_string(const enum urgency urgency) { switch (urgency) { case URG_NONE: diff --git a/src/notification.h b/src/notification.h index fa1de64..0b264ed 100644 --- a/src/notification.h +++ b/src/notification.h @@ -101,7 +101,7 @@ void notification_replace_single_field(char **haystack, void notification_update_text_to_render(notification *n); void notification_do_action(notification *n); -const char *notification_urgency_to_string(enum urgency urgency); +const char *notification_urgency_to_string(const enum urgency urgency); /** * Return the string representation for fullscreen behavior