Skip to content

Commit 8d7d488

Browse files
committed
defer: make fmt
1 parent ede5ed8 commit 8d7d488

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

libtock-sync/crypto/hmac.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "hmac.h"
2-
31
#include <libtock/defer.h>
42

3+
#include "hmac.h"
4+
55
returncode_t libtocksync_hmac_simple(libtock_hmac_algorithm_t hmac_type,
66
uint8_t* key_buffer, uint32_t key_length,
77
uint8_t* input_buffer, uint32_t input_length,
@@ -13,15 +13,18 @@ returncode_t libtocksync_hmac_simple(libtock_hmac_algorithm_t hmac_type,
1313

1414
ret = libtock_hmac_set_readonly_allow_key_buffer(key_buffer, key_length);
1515
if (ret != RETURNCODE_SUCCESS) return ret;
16-
defer { libtock_hmac_set_readonly_allow_key_buffer(NULL, 0); };
16+
defer { libtock_hmac_set_readonly_allow_key_buffer(NULL, 0);
17+
};
1718

1819
ret = libtock_hmac_set_readonly_allow_data_buffer(input_buffer, input_length);
1920
if (ret != RETURNCODE_SUCCESS) return ret;
20-
defer { libtock_hmac_set_readonly_allow_data_buffer(NULL, 0); };
21+
defer { libtock_hmac_set_readonly_allow_data_buffer(NULL, 0);
22+
};
2123

2224
ret = libtock_hmac_set_readwrite_allow_destination_buffer(hmac_buffer, hmac_length);
2325
if (ret != RETURNCODE_SUCCESS) return ret;
24-
defer { libtock_hmac_set_readwrite_allow_destination_buffer(NULL, 0); };
26+
defer { libtock_hmac_set_readwrite_allow_destination_buffer(NULL, 0);
27+
};
2528

2629
ret = libtock_hmac_command_run();
2730
if (ret != RETURNCODE_SUCCESS) return ret;

libtock/defer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
extern "C" {
55
#endif
66

7-
#define __DEFER__(F, V) \
8-
auto void F(int* V ## SENTINEL); \
9-
[[gnu::cleanup(F)]] int V; \
10-
auto void F(__attribute__ ((unused)) int* V ## SENTINEL)
7+
#define __DEFER__(F, V) \
8+
auto void F(int* V##SENTINEL); \
9+
[[gnu::cleanup(F)]] int V; \
10+
auto void F(__attribute__ ((unused)) int* V##SENTINEL)
1111

1212
#define defer __DEFER(__COUNTER__)
1313
#define __DEFER(N) __DEFER_(N)
14-
#define __DEFER_(N) __DEFER__(__DEFER_FUNCTION_ ## N, __DEFER_VARIABLE_ ## N)
14+
#define __DEFER_(N) __DEFER__(__DEFER_FUNCTION_##N, __DEFER_VARIABLE_##N)
1515

1616
#ifdef __cplusplus
1717
}

0 commit comments

Comments
 (0)