groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 05/12: [troff]: Fix code style nits.


From: G. Branden Robinson
Subject: [groff] 05/12: [troff]: Fix code style nits.
Date: Thu, 7 Mar 2024 18:37:43 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 602b90042974d83b950430351f61126a58200067
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Mar 7 10:08:25 2024 -0600

    [troff]: Fix code style nits.
    
    Annotate null pointers with `nullptr` comment to ease any future
    transition to C++11, which defines it as a keyword.
---
 src/roff/troff/node.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 3f621efc5..0240d0501 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1666,16 +1666,16 @@ real_output_file::~real_output_file()
   is_dying = true;
   // To avoid looping, set fp to 0 before calling fatal().
   if (ferror(fp)) {
-    fp = 0;
+    fp = 0 /* nullptr */;
     fatal("error on output file stream");
   }
   else if (fflush(fp) < 0) {
-    fp = 0;
+    fp = 0 /* nullptr */;
     fatal("unable to flush output file: %1", strerror(errno));
   }
   if (piped) {
     int result = pclose(fp);
-    fp = 0;
+    fp = 0 /* nullptr */;
     if (result < 0)
       fatal("unable to close pipe: %1", strerror(errno));
     if (!WIFEXITED(result))
@@ -1691,7 +1691,7 @@ real_output_file::~real_output_file()
   }
   else
   if (fclose(fp) < 0) {
-    fp = 0;
+    fp = 0 /* nullptr */;
     fatal("unable to close output file: %1", strerror(errno));
   }
 }
@@ -1700,7 +1700,7 @@ void real_output_file::flush()
 {
   // To avoid looping, set fp to 0 before calling fatal().
   if (fflush(fp) < 0) {
-    fp = 0;
+    fp = 0 /* nullptr */;
     fatal("unable to flush output file: %1", strerror(errno));
   }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]