[PATCH] D41421: Eliminate a magic number. NFC.
Matt Davis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 19 16:46:11 PST 2017
mattd created this revision.
mattd added a reviewer: bkramer.
Calculate sizeof Buffer instead of using a magic value.
https://reviews.llvm.org/D41421
Files:
PrintPreprocessedOutput.cpp
Index: PrintPreprocessedOutput.cpp
===================================================================
--- PrintPreprocessedOutput.cpp
+++ PrintPreprocessedOutput.cpp
@@ -752,7 +752,7 @@
} else if (Tok.isLiteral() && !Tok.needsCleaning() &&
Tok.getLiteralData()) {
OS.write(Tok.getLiteralData(), Tok.getLength());
- } else if (Tok.getLength() < 256) {
+ } else if (Tok.getLength() < sizeof(Buffer)) {
const char *TokPtr = Buffer;
unsigned Len = PP.getSpelling(Tok, TokPtr);
OS.write(TokPtr, Len);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41421.127623.patch
Type: text/x-patch
Size: 552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171220/66917c4e/attachment.bin>
More information about the cfe-commits
mailing list