[llvm] r254380 - Use array_lengthof instead of manually calculating it. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 30 22:12:59 PST 2015
Author: ctopper
Date: Tue Dec 1 00:12:59 2015
New Revision: 254380
URL: http://llvm.org/viewvc/llvm-project?rev=254380&view=rev
Log:
Use array_lengthof instead of manually calculating it. NFC
Modified:
llvm/trunk/lib/Support/Unix/Signals.inc
Modified: llvm/trunk/lib/Support/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Signals.inc?rev=254380&r1=254379&r2=254380&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc (original)
+++ llvm/trunk/lib/Support/Unix/Signals.inc Tue Dec 1 00:12:59 2015
@@ -86,12 +86,11 @@ static unsigned NumRegisteredSignals = 0
static struct {
struct sigaction SA;
int SigNo;
-} RegisteredSignalInfo[(sizeof(IntSigs)+sizeof(KillSigs))/sizeof(KillSigs[0])];
+} RegisteredSignalInfo[array_lengthof(IntSigs) + array_lengthof(KillSigs)];
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;
More information about the llvm-commits
mailing list