]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: mux-quic: remove usage of non-standard ull type
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 30 Sep 2022 16:03:03 +0000 (18:03 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 3 Oct 2022 14:24:44 +0000 (16:24 +0200)
ull is a typedef to unsigned long long. It is only defined in
xprt_quic-t.h. Its usage should be limited over time to reduce xprt_quic
dependency over the whole code. It can be replaced by ullong typedef
from compat.h.

For the moment, ull references have been replaced in qmux_trace module.
They were only used for printf format and has been replaced by the true
variable type.

This change is useful to reduce dependencies on xprt_quic in other
files.

This should be backported up to 2.6.

src/qmux_trace.c

index 6d84b7afe2c185b3e444591d2a8b23982133a48c..72a8f1b2fb1ce618274fe9bbf6f96b854ac54346 100644 (file)
@@ -43,13 +43,13 @@ static void qmux_trace_frm(const struct quic_frame *frm)
 {
        switch (frm->type) {
        case QUIC_FT_MAX_STREAMS_BIDI:
-               chunk_appendf(&trace_buf, " max_streams=%llu",
-                             (ull)frm->max_streams_bidi.max_streams);
+               chunk_appendf(&trace_buf, " max_streams=%lu",
+                             frm->max_streams_bidi.max_streams);
                break;
 
        case QUIC_FT_MAX_STREAMS_UNI:
-               chunk_appendf(&trace_buf, " max_streams=%llu",
-                             (ull)frm->max_streams_uni.max_streams);
+               chunk_appendf(&trace_buf, " max_streams=%lu",
+                             frm->max_streams_uni.max_streams);
                break;
 
        default:
@@ -76,13 +76,13 @@ static void qmux_trace(enum trace_level level, uint64_t mask,
                        chunk_appendf(&trace_buf, " qc=%p", qcc->conn->handle.qc);
 
                if (qcs)
-                       chunk_appendf(&trace_buf, " qcs=%p .id=%llu .st=%s",
-                                     qcs, (ull)qcs->id,
+                       chunk_appendf(&trace_buf, " qcs=%p .id=%lu .st=%s",
+                                     qcs, qcs->id,
                                      qcs_st_to_str(qcs->st));
 
                if (mask & QMUX_EV_QCC_NQCS) {
                        const uint64_t *id = a3;
-                       chunk_appendf(&trace_buf, " id=%llu", (ull)*id);
+                       chunk_appendf(&trace_buf, " id=%lu", *id);
                }
 
                if (mask & QMUX_EV_SEND_FRM)
@@ -90,14 +90,14 @@ static void qmux_trace(enum trace_level level, uint64_t mask,
 
                if (mask & QMUX_EV_QCS_XFER_DATA) {
                        const struct qcs_xfer_data_trace_arg *arg = a3;
-                       chunk_appendf(&trace_buf, " prep=%llu xfer=%d",
-                                     (ull)arg->prep, arg->xfer);
+                       chunk_appendf(&trace_buf, " prep=%lu xfer=%d",
+                                     arg->prep, arg->xfer);
                }
 
                if (mask & QMUX_EV_QCS_BUILD_STRM) {
                        const struct qcs_build_stream_trace_arg *arg = a3;
-                       chunk_appendf(&trace_buf, " len=%llu fin=%d offset=%llu",
-                                     (ull)arg->len, arg->fin, (ull)arg->offset);
+                       chunk_appendf(&trace_buf, " len=%lu fin=%d offset=%lu",
+                                     arg->len, arg->fin, arg->offset);
                }
        }
 }