Skip to content

Commit 8eb2abd

Browse files
committed
[clang-tidy] Address several clang-tidy comments
1 parent c87b2fa commit 8eb2abd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

include/CppInterOp/CppInterOp.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define CPPINTEROP_CPPINTEROP_H
1616

1717
#include <cassert>
18+
#include <cstddef>
1819
#include <cstdint>
1920
#include <set>
2021
#include <string>
@@ -41,7 +42,7 @@ using TCppFuncAddr_t = void*;
4142
using TInterp_t = void*;
4243
using TCppObject_t = void*;
4344

44-
enum Operator {
45+
enum Operator : unsigned char {
4546
OP_None,
4647
OP_New,
4748
OP_Delete,
@@ -90,7 +91,7 @@ enum Operator {
9091
OP_Coawait,
9192
};
9293

93-
enum OperatorArity { kUnary = 1, kBinary, kBoth };
94+
enum OperatorArity : unsigned char { kUnary = 1, kBinary, kBoth };
9495

9596
/// A class modeling function calls for functions produced by the interpreter
9697
/// in compiled code. It provides an information if we are calling a standard
@@ -108,7 +109,7 @@ class JitCall {
108109
void** m_Args = nullptr;
109110
size_t m_ArgSize = 0;
110111
// Clang struggles with =default...
111-
ArgList() : m_Args(nullptr), m_ArgSize(0) {}
112+
ArgList() {}
112113
ArgList(void** Args, size_t ArgSize) : m_Args(Args), m_ArgSize(ArgSize) {}
113114
};
114115
// FIXME: Figure out how to unify the wrapper signatures.
@@ -122,13 +123,13 @@ class JitCall {
122123
GenericCall m_GenericCall;
123124
DestructorCall m_DestructorCall;
124125
};
125-
const Kind m_Kind;
126+
Kind m_Kind;
126127
TCppConstFunction_t m_FD;
127-
JitCall() : m_Kind(kUnknown), m_GenericCall(nullptr), m_FD(nullptr) {}
128+
JitCall() : m_GenericCall(nullptr), m_Kind(kUnknown), m_FD(nullptr) {}
128129
JitCall(Kind K, GenericCall C, TCppConstFunction_t FD)
129-
: m_Kind(K), m_GenericCall(C), m_FD(FD) {}
130+
: m_GenericCall(C), m_Kind(K), m_FD(FD) {}
130131
JitCall(Kind K, DestructorCall C, TCppConstFunction_t Dtor)
131-
: m_Kind(K), m_DestructorCall(C), m_FD(Dtor) {}
132+
: m_DestructorCall(C), m_Kind(K), m_FD(Dtor) {}
132133

133134
/// Checks if the passed arguments are valid for the given function.
134135
CPPINTEROP_API bool AreArgumentsValid(void* result, ArgList args,

0 commit comments

Comments
 (0)