gbranden pushed a commit to branch master
in repository groff.
commit 1c3fbbf8dadfb4842062bb0549fa0eb6cca679f4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu May 15 13:22:40 2025 -0500
[troff]: Trivially refactor.
Respell the `unsigned` data type as `unsigned int`. Use of `signed` and
`unsigned` as if they were types of themselves rather than qualifiers on
types is a slovenly practice from pre-ANSI C.
* src/roff/troff/env.h (class environment):
* src/roff/troff/env.cpp (environment::get_hyphenation_mode)
(environment::get_hyphenation_mode_default)
(class unsigned_env_reg):
(unsigned_env_reg::get_value):
(hyphenate): Do it.
---
ChangeLog | 14 ++++++++++++++
src/roff/troff/env.cpp | 14 +++++++-------
src/roff/troff/env.h | 4 ++--
3 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9bd9dd037..4ea905f4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2025-05-15 G. Branden Robinson <[email protected]>
+
+ [troff]: Trivially refactor. Respell the `unsigned` data type
+ as `unsigned int`. Use of `signed` and `unsigned` as if they
+ were types of themselves rather than qualifiers on types is a
+ slovenly practice from pre-ANSI C.
+
+ * src/roff/troff/env.h (class environment):
+ * src/roff/troff/env.cpp (environment::get_hyphenation_mode)
+ (environment::get_hyphenation_mode_default)
+ (class unsigned_env_reg):
+ (unsigned_env_reg::get_value):
+ (hyphenate): Do it.
+
2025-05-15 G. Branden Robinson <[email protected]>
[troff]: Refactor margin character flag handling. Namespace it
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 4b6e85de5..3ebcc01c1 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -439,12 +439,12 @@ void environment::add_hyphen_indicator()
line = line->add_discretionary_hyphen();
}
-unsigned environment::get_hyphenation_mode()
+unsigned int environment::get_hyphenation_mode()
{
return hyphenation_mode;
}
-unsigned environment::get_hyphenation_mode_default()
+unsigned int environment::get_hyphenation_mode_default()
{
return hyphenation_mode_default;
}
@@ -1097,7 +1097,7 @@ hunits environment::get_digit_width()
return env_digit_width(this);
}
-unsigned environment::get_adjust_mode()
+unsigned int environment::get_adjust_mode()
{
return adjust_mode;
}
@@ -3222,7 +3222,7 @@ void environment::add_padding()
}
typedef int (environment::*INT_FUNCP)();
-typedef unsigned (environment::*UNSIGNED_FUNCP)();
+typedef unsigned int (environment::*UNSIGNED_FUNCP)();
typedef vunits (environment::*VUNITS_FUNCP)();
typedef hunits (environment::*HUNITS_FUNCP)();
typedef const char *(environment::*STRING_FUNCP)();
@@ -3240,7 +3240,7 @@ class unsigned_env_reg : public reg {
public:
unsigned_env_reg(UNSIGNED_FUNCP);
const char *get_string();
- bool get_value(unsigned *val);
+ bool get_value(unsigned int *val);
};
class vunits_env_reg : public reg {
@@ -3285,7 +3285,7 @@ unsigned_env_reg::unsigned_env_reg(UNSIGNED_FUNCP f) :
func(f)
{
}
-bool unsigned_env_reg::get_value(unsigned *val)
+bool unsigned_env_reg::get_value(unsigned int *val)
{
*val = (curenv->*func)();
return true;
@@ -4395,7 +4395,7 @@ void init_env_requests()
// Appendix H of _The TeXbook_ is useful background for the following.
-void hyphenate(hyphen_list *h, unsigned flags)
+void hyphenate(hyphen_list *h, unsigned int flags)
{
if (0 /* nullptr */ == current_language)
return;
diff --git a/src/roff/troff/env.h b/src/roff/troff/env.h
index 5e0cedc80..95a2c2739 100644
--- a/src/roff/troff/env.h
+++ b/src/roff/troff/env.h
@@ -209,8 +209,8 @@ class environment {
int line_number_indent; // in digit spaces
int line_number_multiple;
int no_number_count;
- unsigned hyphenation_mode;
- unsigned hyphenation_mode_default;
+ unsigned int hyphenation_mode;
+ unsigned int hyphenation_mode_default;
int hyphen_line_count;
int hyphen_line_max;
hunits hyphenation_space;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit