CLEANUP: Make lf_expr parameter of sess_build_logline_orig() const

Since this is safely possible without making any changes, we can provide this
hint to the compiler.
This commit is contained in:
Tim Duesterhus 2026-04-13 19:37:26 +02:00 committed by Willy Tarreau
parent 9a5db56a36
commit 4cf06a7d23
2 changed files with 6 additions and 6 deletions

View File

@ -98,11 +98,11 @@ static inline struct log_orig log_orig(enum log_orig_id id, uint16_t flags)
/* build a log line for the session and an optional stream */
size_t sess_build_logline_orig(struct session *sess, struct stream *s, char *dst, size_t maxsize,
struct lf_expr *lf_expr, struct log_orig orig);
const struct lf_expr *lf_expr, struct log_orig orig);
/* wrapper for sess_build_logline_orig(), uses LOG_ORIG_UNSPEC log origin */
static inline size_t sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize,
struct lf_expr *lf_expr)
const struct lf_expr *lf_expr)
{
return sess_build_logline_orig(sess, s, dst, maxsize, lf_expr,
log_orig(LOG_ORIG_UNSPEC, LOG_ORIG_FL_NONE));
@ -200,7 +200,7 @@ char * get_format_pid_sep2(int format, size_t *len);
* Builds a log line for the stream (must be valid).
*/
static inline size_t build_logline_orig(struct stream *s, char *dst, size_t maxsize,
struct lf_expr *lf_expr, struct log_orig orig)
const struct lf_expr *lf_expr, struct log_orig orig)
{
return sess_build_logline_orig(strm_sess(s), s, dst, maxsize, lf_expr, orig);
}
@ -208,7 +208,7 @@ static inline size_t build_logline_orig(struct stream *s, char *dst, size_t maxs
/*
* Wrapper for build_logline_orig, uses LOG_ORIG_UNSPEC log origin
*/
static inline size_t build_logline(struct stream *s, char *dst, size_t maxsize, struct lf_expr *lf_expr)
static inline size_t build_logline(struct stream *s, char *dst, size_t maxsize, const struct lf_expr *lf_expr)
{
return build_logline_orig(s, dst, maxsize, lf_expr,
log_orig(LOG_ORIG_UNSPEC, LOG_ORIG_FL_NONE));

View File

@ -3886,7 +3886,7 @@ int lf_expr_dup(const struct lf_expr *orig, struct lf_expr *dest)
* stream is NULL, default values will be assumed for the stream part.
*/
size_t sess_build_logline_orig(struct session *sess, struct stream *s,
char *dst, size_t maxsize, struct lf_expr *lf_expr,
char *dst, size_t maxsize, const struct lf_expr *lf_expr,
struct log_orig log_orig)
{
struct lf_buildctx _ctx = {};
@ -3896,7 +3896,7 @@ size_t sess_build_logline_orig(struct session *sess, struct stream *s,
struct http_txn *txn;
const struct strm_logs *logs;
struct connection *fe_conn, *be_conn;
struct list *list_format = &lf_expr->nodes.list;
const struct list *list_format = &lf_expr->nodes.list;
unsigned int s_flags;
unsigned int uniq_id;
struct buffer chunk;