Bug 1508818, part 4 - Rearrange various string literals so they fit in 80 columns. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Wed, 28 Nov 2018 21:06:53 +0000
changeset 505026 09c2de91a87f13c8de2da8508bae2bc2daff6b70
parent 505025 67b1d1e433013e79b67684b48c4c074712e2509e
child 505027 d53add8e41304d0da346582da8c16fd43c9f174a
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1508818
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508818, part 4 - Rearrange various string literals so they fit in 80 columns. r=froydnj clang-format doesn't seem to reflow text when a single string constant is represented as multiple lines of string literals to fit within 80 columns. Instead, if a single string literal is too long, it breaks off a piece and moves it to the next line, which leads to a bunch of choppy short string bits. The resulting string literals are still a bit choppy, mostly because I didn't want to break up the long names of prefs. Here's an example of what I mean: |--- max width --- | "some long string literal" "is here but it goes on for multiple lines" This gets turned into: |--- max width --- | "some long string " "literal" "is here but it " "goes on for multiple lines" My patch manually would turn this into: |--- max width --- | "some long string " "literal is here " "but it goes on " "for multiple lines" The strings in my patch don't always end up at column 80, because the width is set to work with wherever clang format ends up actually indenting them. There are more instances of this problem when MOZ_COLLECT_REPORT is used, but that can be dealt with in another bug. There are a ton of them. Depends on D13184 Differential Revision: https://phabricator.services.mozilla.com/D13185
xpcom/base/nsConsoleService.cpp
xpcom/base/nsTraceRefcnt.cpp
--- a/xpcom/base/nsConsoleService.cpp
+++ b/xpcom/base/nsConsoleService.cpp
@@ -242,19 +242,20 @@ nsConsoleService::LogMessageWithMode(nsI
 
   if (!gLoggingEnabled) {
     return NS_OK;
   }
 
   if (NS_IsMainThread() && mDeliveringMessage) {
     nsCString msg;
     aMessage->ToString(msg);
-    NS_WARNING(nsPrintfCString("Reentrancy error: some client attempted "
-      "to display a message to the console while in a console listener. "
-      "The following message was discarded: \"%s\"", msg.get()).get());
+    NS_WARNING(nsPrintfCString(
+      "Reentrancy error: some client attempted to display a message to "
+      "the console while in a console listener. The following message "
+      "was discarded: \"%s\"", msg.get()).get());
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<LogMessageRunnable> r;
   nsCOMPtr<nsIConsoleMessage> retiredMessage;
 
   /*
    * Lock while updating buffer, and while taking snapshot of
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -670,34 +670,37 @@ InitTraceLog()
 
   const char* classes = getenv("XPCOM_MEM_LOG_CLASSES");
 
 #ifdef HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
   if (classes) {
     InitLog(ENVVAR("XPCOM_MEM_COMPTR_LOG"), "nsCOMPtr", &gCOMPtrLog);
   } else {
     if (getenv("XPCOM_MEM_COMPTR_LOG")) {
-      fprintf(stdout, "### XPCOM_MEM_COMPTR_LOG defined -- but XPCOM_MEM_LOG_CLASSES is not defined\n");
+      fprintf(stdout, "### XPCOM_MEM_COMPTR_LOG defined -- "
+              "but XPCOM_MEM_LOG_CLASSES is not defined\n");
     }
   }
 #else
   const char* comptr_log = getenv("XPCOM_MEM_COMPTR_LOG");
   if (comptr_log) {
-    fprintf(stdout, "### XPCOM_MEM_COMPTR_LOG defined -- but it will not work without dynamic_cast\n");
+    fprintf(stdout, "### XPCOM_MEM_COMPTR_LOG defined -- "
+            "but it will not work without dynamic_cast\n");
   }
 #endif // HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
 
 #undef ENVVAR
 
   if (classes) {
     // if XPCOM_MEM_LOG_CLASSES was set to some value, the value is interpreted
     // as a list of class names to track
     gTypesToLog = new CharPtrSet(256);
 
-    fprintf(stdout, "### XPCOM_MEM_LOG_CLASSES defined -- only logging these classes: ");
+    fprintf(stdout, "### XPCOM_MEM_LOG_CLASSES defined -- "
+            "only logging these classes: ");
     const char* cp = classes;
     for (;;) {
       char* cm = (char*)strchr(cp, ',');
       if (cm) {
         *cm = '\0';
       }
       gTypesToLog->PutEntry(cp);
       fprintf(stdout, "%s ", cp);
@@ -712,19 +715,21 @@ InitTraceLog()
     gSerialNumbers = new SerialHash(256);
   }
 
   const char* objects = getenv("XPCOM_MEM_LOG_OBJECTS");
   if (objects) {
     gObjectsToLog = new IntPtrSet(256);
 
     if (!(gRefcntsLog || gAllocLog || gCOMPtrLog)) {
-      fprintf(stdout, "### XPCOM_MEM_LOG_OBJECTS defined -- but none of XPCOM_MEM_(REFCNT|ALLOC|COMPTR)_LOG is defined\n");
+      fprintf(stdout, "### XPCOM_MEM_LOG_OBJECTS defined -- "
+              "but none of XPCOM_MEM_(REFCNT|ALLOC|COMPTR)_LOG is defined\n");
     } else {
-      fprintf(stdout, "### XPCOM_MEM_LOG_OBJECTS defined -- only logging these objects: ");
+      fprintf(stdout, "### XPCOM_MEM_LOG_OBJECTS defined -- "
+              "only logging these objects: ");
       const char* cp = objects;
       for (;;) {
         char* cm = (char*)strchr(cp, ',');
         if (cm) {
           *cm = '\0';
         }
         intptr_t top = 0;
         intptr_t bottom = 0;