Skip to content

Commit 75a72e0

Browse files
Use rather #pragma once in header files
1 parent 7e8d962 commit 75a72e0

72 files changed

Lines changed: 72 additions & 288 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/apdu_constants.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _APDU_CONSTANTS_H_
2-
#define _APDU_CONSTANTS_H_
1+
#pragma once
32

43
#include "offsets.h"
54
#include "shared_context.h"
@@ -116,5 +115,3 @@ uint16_t handleGetEth2PublicKey(uint8_t p1,
116115
#endif
117116

118117
extern uint16_t apdu_response_code;
119-
120-
#endif // _APDU_CONSTANTS_H_

src/chainConfig.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
* limitations under the License.
1616
********************************************************************************/
1717

18-
#ifndef _CHAIN_CONFIG_H_
19-
#define _CHAIN_CONFIG_H_
18+
#pragma once
2019

2120
#include "asset_info.h"
2221

@@ -26,5 +25,3 @@ typedef struct chain_config_s {
2625
} chain_config_t;
2726

2827
#define ETHEREUM_MAINNET_CHAINID 1
29-
30-
#endif // _CHAIN_CONFIG_H_

src/common_ui.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _COMMON_UI_H_
2-
#define _COMMON_UI_H_
1+
#pragma once
32

43
#include <stdint.h>
54
#include <stdbool.h>
@@ -36,5 +35,3 @@ void ui_sign_7702_auth(void);
3635
void ui_sign_7702_revocation(void);
3736
void ui_error_no_7702(void);
3837
void ui_error_no_7702_whitelist(void);
39-
40-
#endif // _COMMON_UI_H_

src/eth_plugin_handler.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef _ETH_PLUGIN_HANDLER_H_
2-
#define _ETH_PLUGIN_HANDLER_H_
1+
#pragma once
32

43
#include "eth_plugin_interface.h"
54

@@ -32,5 +31,3 @@ eth_plugin_result_t eth_plugin_perform_init(uint8_t *contractAddress,
3231
ethPluginInitContract_t *init);
3332
// NULL for cached address, or base contract address
3433
eth_plugin_result_t eth_plugin_call(int method, void *parameter);
35-
36-
#endif // _ETH_PLUGIN_HANDLER_H_

src/handle_check_address.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#ifndef _HANDLE_CHECK_ADDRESS_H_
2-
#define _HANDLE_CHECK_ADDRESS_H_
1+
#pragma once
32

43
#include "swap_lib_calls.h"
54
#include "chainConfig.h"
65

76
uint16_t handle_check_address(check_address_parameters_t* check_address_params,
87
chain_config_t* chain_config);
9-
10-
#endif // _HANDLE_CHECK_ADDRESS_H_

src/handle_get_printable_amount.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#ifndef _HANDLE_GET_PRINTABLE_AMOUNT_H_
2-
#define _HANDLE_GET_PRINTABLE_AMOUNT_H_
1+
#pragma once
32

43
#include "swap_lib_calls.h"
54
#include "chainConfig.h"
65

76
uint16_t handle_get_printable_amount(get_printable_amount_parameters_t* get_printable_amount_params,
87
chain_config_t* config);
9-
10-
#endif // _HANDLE_GET_PRINTABLE_AMOUNT_H_

src/hash_bytes.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#ifndef HASH_BYTES_H_
2-
#define HASH_BYTES_H_
1+
#pragma once
32

43
#include <stdint.h>
54
#include "cx.h"
65

76
void hash_nbytes(const uint8_t *const bytes_ptr, size_t n, cx_hash_t *hash_ctx);
87
void hash_byte(uint8_t byte, cx_hash_t *hash_ctx);
9-
10-
#endif // HASH_BYTES_H_

src/manage_asset_info.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef MANAGE_ASSET_INFO_H_
2-
#define MANAGE_ASSET_INFO_H_
1+
#pragma once
32

43
#include "shared_context.h"
54

@@ -8,5 +7,3 @@ int get_asset_index_by_addr(const uint8_t *addr);
87
extraInfo_t *get_asset_info_by_addr(const uint8_t *contractAddress);
98
extraInfo_t *get_current_asset_info(void);
109
void validate_current_asset_info(void);
11-
12-
#endif // MANAGE_ASSET_INFO_H_

src/mem.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef MEM_H_
2-
#define MEM_H_
1+
#pragma once
32

43
#include <stdlib.h>
54

@@ -9,5 +8,3 @@ void *mem_alloc(size_t size);
98
void mem_dealloc(size_t size);
109
void *mem_rev_alloc(size_t size);
1110
void mem_rev_dealloc(size_t size);
12-
13-
#endif // MEM_H_

src/mem_utils.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#ifndef MEM_UTILS_H_
2-
#define MEM_UTILS_H_
1+
#pragma once
32

43
#include <stdint.h>
54

@@ -8,5 +7,3 @@
87
char *mem_alloc_and_format_uint(uint32_t value, uint8_t *const written_chars);
98
uint8_t mem_align(size_t alignment);
109
void *mem_alloc_and_align(size_t size, size_t alignment);
11-
12-
#endif // MEM_UTILS_H_

0 commit comments

Comments
 (0)