gbranden pushed a commit to branch master
in repository groff.
commit d67d0b327ed6ffba879f9cbadae28c33ca1b47f5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Apr 22 21:56:17 2025 -0500
[troff]: Fix code style nits.
* src/roff/troff/input.cpp (temp_iterator::temp_iterator):
* src/roff/troff/node.cpp (same_node): Un-guard `inline` keyword from
preprocessor. `inline` is a standard C++98 keyword, and not (any
longer?) a GNU extension.
* src/roff/troff/node.h: Rationalize "#include"s. Include C standard
library header file we require.
---
ChangeLog | 11 +++++++++++
src/roff/troff/input.cpp | 5 +----
src/roff/troff/node.cpp | 6 ++----
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7c08d4cb7..f7ef44dd9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2025-04-22 G. Branden Robinson <[email protected]>
+
+ [troff]: Fix code style nits.
+
+ * src/roff/troff/input.cpp (temp_iterator::temp_iterator):
+ * src/roff/troff/node.cpp (same_node): Un-guard `inline` keyword
+ from preprocessor. `inline` is a standard C++98 keyword, and
+ not (any longer?) a GNU extension.
+ * src/roff/troff/node.h: Rationalize "#include"s. Include C
+ standard library header file we require.
+
2025-04-22 G. Branden Robinson <[email protected]>
[troff]: When input blows out the stack, say how big it was.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 46e8e3da8..7c53a0edc 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3976,10 +3976,7 @@ public:
friend input_iterator *make_temp_iterator(const char *);
};
-#ifdef __GNUG__
-inline
-#endif
-temp_iterator::temp_iterator(const char *s, int len)
+inline temp_iterator::temp_iterator(const char *s, int len)
: base(0 /* nullptr */)
{
if (len > 0) {
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 18fd33152..9db1912b7 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -22,6 +22,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <stdlib.h> // free(), malloc()
+#include <string.h> // strerror()
#include "troff.h"
#include "dictionary.h"
@@ -5588,10 +5589,7 @@ node *node::add_char(charinfo *ci, environment *env,
return res;
}
-#ifdef __GNUG__
-inline
-#endif
-int same_node(node *n1, node *n2)
+static inline int same_node(node *n1, node *n2)
{
if (n1 != 0 /* nullptr */) {
if (n2 != 0 /* nullptr */)
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit