From: Mateusz Majewski Date: Thu, 24 Oct 2019 08:51:22 +0000 (+0200) Subject: Add some missing consts X-Git-Tag: submit/tizen/20191105.163340~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F216397%2F1;p=platform%2Fcore%2Fsystem%2Fdlog.git Add some missing consts Change-Id: I22c50dea669bb940dc25871dc47d5ed8afaede6f --- diff --git a/include/logprint.h b/include/logprint.h index 99c0af3..d33441c 100644 --- a/include/logprint.h +++ b/include/logprint.h @@ -161,14 +161,14 @@ bool log_should_print_line( * * Finds the beginning of a log tag in entry's payload and returns it */ -char* log_buffer_get_tag(const struct dlogutil_entry *entry); +const char* log_buffer_get_tag(const struct dlogutil_entry *entry); /** * Returns pointer to log entry message * * Finds the beginning of a log message in entry's payload and returns it */ -char* log_buffer_get_message(const struct dlogutil_entry *entry); +const char* log_buffer_get_message(const struct dlogutil_entry *entry); /** * Formats a log message into a buffer diff --git a/src/shared/logprint.c b/src/shared/logprint.c index f0a03a4..f822aad 100644 --- a/src/shared/logprint.c +++ b/src/shared/logprint.c @@ -537,7 +537,7 @@ int log_add_filter_tid(log_filter *p_filter, pthread_t tid) * @param[in] entry The log entry * @return Pointer to log tag */ -char* log_buffer_get_tag(const struct dlogutil_entry *entry) +const char* log_buffer_get_tag(const struct dlogutil_entry *entry) { if (entry->len - (int) sizeof(struct dlogutil_entry) < 2) return NULL; @@ -551,7 +551,7 @@ char* log_buffer_get_tag(const struct dlogutil_entry *entry) * @param[in] entry The log entry * @return Pointer to log message */ -char* log_buffer_get_message(const struct dlogutil_entry *entry) +const char* log_buffer_get_message(const struct dlogutil_entry *entry) { if (entry->len - (int) sizeof(struct dlogutil_entry) < 2) return NULL; @@ -631,7 +631,7 @@ static char to_hex_digit(int digit) return digit + 'A' - 10; } -char *json_escape_string(char *in) +char *json_escape_string(const char *in) { assert(in); size_t len = strlen(in); @@ -729,8 +729,8 @@ char *log_format_json( size_t default_buffer_size, const struct dlogutil_entry *entry, size_t *p_outLength, - char *tag, - char *msg) + const char *tag, + const char *msg) { const char *prio_name = json_priority_name(entry->priority); @@ -911,7 +911,7 @@ char *log_format_log_line( char prefixBuf[128], suffixBuf[128]; char priChar; int prefixSuffixIsHeaderFooter = 0; - char *tag, *msg; + const char *tag, *msg; char * ret = NULL; priChar = filter_pri_to_char((log_priority)entry->priority);