Add LE/BE functions for uint16, 32 and 64.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-12-23 20:39:03 +01:00
parent d56b540324
commit 73232b6de4
8 changed files with 53 additions and 72 deletions

View File

@@ -501,11 +501,7 @@ uint32_t decrement_key_counter(file_t *fkey) {
uint32_t val =
(tag_data[0] << 24) | (tag_data[1] << 16) | (tag_data[2] << 8) | tag_data[3];
val--;
tag_data[0] = (val >> 24) & 0xff;
tag_data[1] = (val >> 16) & 0xff;
tag_data[2] = (val >> 8) & 0xff;
tag_data[3] = val & 0xff;
put_uint32_t_be(val, tag_data);
int r = meta_add(fkey->fid, cmeta, (uint16_t)meta_size);
free(cmeta);
if (r != 0) {