Skip to content

Commit 1176915

Browse files
committed
A few changes suggested by clang-tidy
1 parent 71c578c commit 1176915

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/monocypher/base.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ namespace monocypher {
4646

4747
//======== Utilities:
4848

49-
static inline const uint8_t* u8(const void *p) {return reinterpret_cast<const uint8_t*>(p);}
50-
static inline uint8_t* u8(void *p) {return reinterpret_cast<uint8_t*>(p);}
49+
static inline const uint8_t* u8(const void *p) {return static_cast<const uint8_t*>(p);}
50+
static inline uint8_t* u8(void *p) {return static_cast<uint8_t*>(p);}
5151

5252

5353
/// Fills the array with cryptographically-secure random bytes.

include/monocypher/encryption.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ namespace monocypher {
7373

7474

7575
namespace { // internal stuff
76-
static constexpr size_t boxedSize(size_t plaintextSize) {
76+
constexpr size_t boxedSize(size_t plaintextSize) {
7777
return plaintextSize + sizeof(mac);
7878
}
7979

80-
static constexpr size_t unboxedSize(size_t ciphertextSize) {
80+
constexpr size_t unboxedSize(size_t ciphertextSize) {
8181
return std::max(ciphertextSize, sizeof(mac)) - sizeof(mac);
8282
}
8383

include/monocypher/signatures.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace monocypher {
5656
public_key() :byte_array<32>(0) { }
5757
explicit public_key(const std::array<uint8_t,32> &a) :byte_array<32>(a) { }
5858
public_key(const void *data, size_t size) :byte_array<32>(data, size) { }
59-
explicit public_key(input_bytes k) :public_key(k.data, k.size) { }
59+
explicit public_key(input_bytes k) :public_key(k.data, k.size) { }
6060

6161
/// Verifies a signature.
6262
[[nodiscard]]

src/Monocypher+xsalsa20.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "monocypher/ext/xsalsa20.hh"
3232
#include <memory>
33-
#include <string.h>
33+
#include <cstring>
3434

3535
// Wrap 3rd party tweetnacl.c in a namespace to avoid messing with global namespace:
3636
namespace monocypher::tweetnacl {

0 commit comments

Comments
 (0)