gbranden pushed a commit to branch master
in repository groff.

commit 4b6bb307523ecc1e8df6c43cc6bab6d9465af85b
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Sep 9 15:37:42 2024 -0500

    [troff]: Fix code style nits (env.cpp).
    
    * src/roff/troff/env.cpp (environment_copy): Use C++ `static_cast`
      operator instead of C-style type cast.  Explicitly compare variable of
      pointer type to null pointer constant instead of letting it pun down
      to a Boolean.
---
 ChangeLog              | 7 +++++++
 src/roff/troff/env.cpp | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0e2ffb88a..c1ea85540 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-09-08  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/env.cpp (environment_copy): Use C++
+       `static_cast` operator instead of C-style type cast.  Explicitly
+       compare variable of pointer type to null pointer constant
+       instead of letting it pun down to a Boolean.
+
 2024-09-08  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (environment::output_line): Resize
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 89f1dc417..ee265a2e1 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1259,8 +1259,8 @@ void environment_copy()
     error("no environment specified to copy from");
   }
   else {
-    e = (environment *)env_dictionary.lookup(nm);
-  if (e)
+    e = static_cast<environment *>(env_dictionary.lookup(nm));
+  if (e != 0 /* nullptr */)
     curenv->copy(e);
   else
     error("cannot copy from nonexistent environment '%1'",

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to