diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-12 11:01:07 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-09-15 15:19:12 +0800 |
commit | eb82fdb2dc0903e6125014abd64aceab42c8eb35 (patch) | |
tree | c07276ba1595c415ebc28943163d88f3e3180254 /git2d/bare.c | |
parent | Remove forge-specific functions from misc (diff) | |
download | forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.gz forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.tar.zst forge-eb82fdb2dc0903e6125014abd64aceab42c8eb35.zip |
Diffstat (limited to 'git2d/bare.c')
-rw-r--r-- | git2d/bare.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/git2d/bare.c b/git2d/bare.c index b580980..307f3d8 100644 --- a/git2d/bare.c +++ b/git2d/bare.c @@ -169,13 +169,7 @@ bare_error bare_get_u64(struct bare_reader *ctx, uint64_t *x) if (err == BARE_ERROR_NONE) { *x = (uint64_t) ((uint8_t *) x)[0] - | (uint64_t) ((uint8_t *) x)[1] << 8 - | (uint64_t) ((uint8_t *) x)[2] << 16 - | (uint64_t) ((uint8_t *) x)[3] << 24 - | (uint64_t) ((uint8_t *) x)[4] << 32 - | (uint64_t) ((uint8_t *) x)[5] << 40 - | (uint64_t) ((uint8_t *) x)[6] << 48 - | (uint64_t) ((uint8_t *) x)[7] << 56; + | (uint64_t) ((uint8_t *) x)[1] << 8 | (uint64_t) ((uint8_t *) x)[2] << 16 | (uint64_t) ((uint8_t *) x)[3] << 24 | (uint64_t) ((uint8_t *) x)[4] << 32 | (uint64_t) ((uint8_t *) x)[5] << 40 | (uint64_t) ((uint8_t *) x)[6] << 48 | (uint64_t) ((uint8_t *) x)[7] << 56; } return err; @@ -257,20 +251,17 @@ bare_error bare_get_bool(struct bare_reader *ctx, bool *x) return bare_get_u8(ctx, (uint8_t *) x); } -bare_error -bare_put_fixed_data(struct bare_writer *ctx, const uint8_t *src, uint64_t sz) +bare_error bare_put_fixed_data(struct bare_writer *ctx, const uint8_t *src, uint64_t sz) { return ctx->write(ctx->buffer, (void *)src, sz); } -bare_error -bare_get_fixed_data(struct bare_reader *ctx, uint8_t *dst, uint64_t sz) +bare_error bare_get_fixed_data(struct bare_reader *ctx, uint8_t *dst, uint64_t sz) { return ctx->read(ctx->buffer, dst, sz); } -bare_error -bare_put_data(struct bare_writer *ctx, const uint8_t *src, uint64_t sz) +bare_error bare_put_data(struct bare_writer *ctx, const uint8_t *src, uint64_t sz) { bare_error err = BARE_ERROR_NONE; |