Skip to content

Commit 34c1d5c

Browse files
Merge pull request #33 from LedgerHQ/fix/apa/func_args_const_pointers
Added missing const qualifier to the pointer arguments of some functions
2 parents 3acf770 + 0380ce3 commit 34c1d5c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/common_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void getEthAddressStringFromRawKey(const uint8_t raw_pubkey[static 65],
248248
getEthAddressStringFromBinary(hashAddress + 12, out, chainId);
249249
}
250250

251-
bool getEthAddressStringFromBinary(uint8_t *address,
251+
bool getEthAddressStringFromBinary(const uint8_t *address,
252252
char out[static(ADDRESS_LENGTH * 2) + 1],
253253
uint64_t chainId) {
254254
// save some precious stack space
@@ -313,7 +313,7 @@ bool getEthAddressStringFromBinary(uint8_t *address,
313313
return true;
314314
}
315315

316-
bool getEthDisplayableAddress(uint8_t *in,
316+
bool getEthDisplayableAddress(const uint8_t *in,
317317
char *out,
318318
size_t out_len,
319319
uint64_t chainId) {
@@ -341,7 +341,7 @@ int allzeroes(const void *buf, size_t n) {
341341
return 1;
342342
}
343343

344-
int ismaxint(uint8_t *buf, int n) {
344+
int ismaxint(const uint8_t *buf, int n) {
345345
for (int i = 0; i < n; ++i) {
346346
if (buf[i] != 0xff) {
347347
return 0;

src/common_utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void getEthAddressStringFromRawKey(const uint8_t raw_pubkey[static 65],
210210
* @return true if the conversion was successful and the output buffer contains
211211
* the resulting string, false if an error occurs.
212212
*/
213-
bool getEthAddressStringFromBinary(uint8_t *address,
213+
bool getEthAddressStringFromBinary(const uint8_t *address,
214214
char out[static(ADDRESS_LENGTH * 2) + 1],
215215
uint64_t chainId);
216216

@@ -236,7 +236,7 @@ bool getEthAddressStringFromBinary(uint8_t *address,
236236
* uint8_t*:0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB ->
237237
* char*:"0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB\0"
238238
*/
239-
bool getEthDisplayableAddress(uint8_t *in,
239+
bool getEthDisplayableAddress(const uint8_t *in,
240240
char *out,
241241
size_t out_len,
242242
uint64_t chainId);
@@ -264,7 +264,7 @@ int allzeroes(const void *buf, size_t n);
264264
* @param n The number of bytes to check in the buffer.
265265
* @return 1 if all bytes in the buffer are 0xff, 0 otherwise.
266266
*/
267-
int ismaxint(uint8_t *buf, int n);
267+
int ismaxint(const uint8_t *buf, int n);
268268

269269
/**
270270
* @deprecated

0 commit comments

Comments
 (0)