[PATCH] D139262: Fix name style. NFC.

Alexander Kornienko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 3 15:55:46 PST 2022


alexfh created this revision.
alexfh added a reviewer: gribozavr.
Herald added a subscriber: hiraditya.
Herald added a project: All.
alexfh requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139262

Files:
  llvm/lib/Support/Unicode.cpp


Index: llvm/lib/Support/Unicode.cpp
===================================================================
--- llvm/lib/Support/Unicode.cpp
+++ llvm/lib/Support/Unicode.cpp
@@ -476,31 +476,31 @@
   return 1;
 }
 
-static bool isprintableascii(char c) { return c > 31 && c < 127; }
+static bool isPrintableASCII(char C) { return C > 31 && C < 127; }
 
 int columnWidthUTF8(StringRef Text) {
   unsigned ColumnWidth = 0;
   unsigned Length;
-  for (size_t i = 0, e = Text.size(); i < e; i += Length) {
-    Length = getNumBytesForUTF8(Text[i]);
+  for (size_t I = 0, E = Text.size(); I < E; I += Length) {
+    Length = getNumBytesForUTF8(Text[I]);
 
     // fast path for ASCII characters
     if (Length == 1) {
-      if (!isprintableascii(Text[i]))
+      if (!isPrintableASCII(Text[I]))
         return ErrorNonPrintableCharacter;
       ColumnWidth += 1;
       continue;
     }
 
-    if (Length <= 0 || i + Length > Text.size())
+    if (Length <= 0 || I + Length > Text.size())
       return ErrorInvalidUTF8;
-    UTF32 buf[1];
-    const UTF8 *Start = reinterpret_cast<const UTF8 *>(Text.data() + i);
-    UTF32 *Target = &buf[0];
+    UTF32 Buf[1];
+    const UTF8 *Start = reinterpret_cast<const UTF8 *>(Text.data() + I);
+    UTF32 *Target = &Buf[0];
     if (conversionOK != ConvertUTF8toUTF32(&Start, Start + Length, &Target,
                                            Target + 1, strictConversion))
       return ErrorInvalidUTF8;
-    int Width = charWidth(buf[0]);
+    int Width = charWidth(Buf[0]);
     if (Width < 0)
       return ErrorNonPrintableCharacter;
     ColumnWidth += Width;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139262.479876.patch
Type: text/x-patch
Size: 1605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221203/13e73c01/attachment.bin>


More information about the llvm-commits mailing list