]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
include/encoding: add encoder helpers for sized ints
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 24 Jun 2025 02:37:16 +0000 (22:37 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Mon, 22 Sep 2025 16:35:21 +0000 (12:35 -0400)
commitca606fe312443f31ec55b88ad8f2ebe864e2f9e7
tree4b0dc7b650d501933d05feb084cfbb94fb82285f
parent6b32cf6d8a245d8192515ddc037b23a2d031c2cb
include/encoding: add encoder helpers for sized ints

When the raw type may not match the required encoded size, this helper makes
intent clear and avoids a common verbose pattern:

    intX_t t = val;
    encode(t, bl);

and

    intX_t t;
    decode(t, p);
    val = t;

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
(cherry picked from commit 143825e2efea71361f80ba9830ef689ce27fa084)
src/include/encoding.h