]> 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>
Wed, 1 Oct 2025 18:47:12 +0000 (14:47 -0400)
commita36bd5b962077bef696e7a65daf66b85c706461c
tree65445757b7c07bab1a14886d1cff070b0c936d3d
parentfb17ecdd1c5cb733acf9e53ff4fe99a926e82ba6
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>
src/include/encoding.h