mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186301 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,8 +55,7 @@ static std::vector<std::pair<void(*)(void*), void*> > CallBacksToRun;
|
||||
static const int IntSigs[] = {
|
||||
SIGHUP, SIGINT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
|
||||
};
|
||||
static const int *const IntSigsEnd =
|
||||
IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]);
|
||||
static const int *const IntSigsEnd = array_endof(IntSigs);
|
||||
|
||||
// KillSigs - Signals that represent that we have a bug, and our prompt
|
||||
// termination has been ordered.
|
||||
@@ -75,8 +74,7 @@ static const int KillSigs[] = {
|
||||
, SIGEMT
|
||||
#endif
|
||||
};
|
||||
static const int *const KillSigsEnd =
|
||||
KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]);
|
||||
static const int *const KillSigsEnd = array_endof(KillSigs);
|
||||
|
||||
static unsigned NumRegisteredSignals = 0;
|
||||
static struct {
|
||||
@@ -86,8 +84,7 @@ static struct {
|
||||
|
||||
|
||||
static void RegisterHandler(int Signal) {
|
||||
assert(NumRegisteredSignals <
|
||||
sizeof(RegisteredSignalInfo)/sizeof(RegisteredSignalInfo[0]) &&
|
||||
assert(NumRegisteredSignals < array_lengthof(RegisteredSignalInfo) &&
|
||||
"Out of space for signal handlers!");
|
||||
|
||||
struct sigaction NewHandler;
|
||||
|
||||
Reference in New Issue
Block a user