Add some missing consts 97/216397/1
authorMateusz Majewski <m.majewski2@samsung.com>
Thu, 24 Oct 2019 08:51:22 +0000 (10:51 +0200)
committerMateusz Majewski <m.majewski2@samsung.com>
Thu, 24 Oct 2019 09:00:30 +0000 (11:00 +0200)
Change-Id: I22c50dea669bb940dc25871dc47d5ed8afaede6f

include/logprint.h
src/shared/logprint.c

index 99c0af3..d33441c 100644 (file)
@@ -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
index f0a03a4..f822aad 100644 (file)
@@ -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);