]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tools: make date2str_log() take some consts
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Sep 2018 17:08:48 +0000 (19:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Sep 2018 14:30:11 +0000 (16:30 +0200)
The "tm" and "date" field are not modified, they can be const instead
of forcing their callers to use vars.

include/common/standard.h
src/standard.c

index 0a956e069f72b3ac33284d808a50a4a6c7a8345a..7af9c25ceb44bb8b462e244001c63055a86535ab 100644 (file)
@@ -1072,7 +1072,7 @@ extern const char *monthname[];
  * without using sprintf. return a pointer to the last char written (\0) or
  * NULL if there isn't enough space.
  */
-char *date2str_log(char *dest, struct tm *tm, struct timeval *date, size_t size);
+char *date2str_log(char *dest, const struct tm *tm, const struct timeval *date, size_t size);
 
 /* Return the GMT offset for a specific local time.
  * Both t and tm must represent the same time.
index 732932ea11c243b41e27fe8f66655388cf42ac2b..04df94ead20eb2278d8c652608a400f32fde2b90 100644 (file)
@@ -2801,7 +2801,7 @@ const char *monthname[12] = {
  * without using sprintf. return a pointer to the last char written (\0) or
  * NULL if there isn't enough space.
  */
-char *date2str_log(char *dst, struct tm *tm, struct timeval *date, size_t size)
+char *date2str_log(char *dst, const struct tm *tm, const struct timeval *date, size_t size)
 {
 
        if (size < 25) /* the size is fixed: 24 chars + \0 */