gbranden pushed a commit to branch master
in repository groff.
commit 8c7863ab1f0051735c990cc2c4e761a767d82566
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Apr 9 21:23:02 2026 -0500
[troff]: Fix code style nit.
* src/roff/troff/number.cpp:
* src/roff/troff/token.h: Comment formal argument names in function
declarations as a compromise with the Stroustrup-style C++ used in
most of groff.
Also annotate future plans in "number.cpp" and "token.h".
---
ChangeLog | 7 +++++++
src/roff/troff/number.cpp | 44 +++++++++++++++++++++++++++++---------------
src/roff/troff/token.h | 9 +++++----
3 files changed, 41 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5c18c41c2..af9afc65e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-04-09 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/number.cpp:
+ * src/roff/troff/token.h: Comment formal argument names in
+ function declarations as a compromise with the Stroustrup-style
+ C++ used in most of groff.
+
2026-04-09 G. Branden Robinson <[email protected]>
[troff]: Work on Savannah #67735.
diff --git a/src/roff/troff/number.cpp b/src/roff/troff/number.cpp
index 39ae7ed43..8ae1d2732 100644
--- a/src/roff/troff/number.cpp
+++ b/src/roff/troff/number.cpp
@@ -55,12 +55,13 @@ units vresolution = 1;
units units_per_inch;
int sizescale; // subdivisions per point
-static bool is_valid_expression(units *u, int scaling_unit,
- bool is_parenthesized,
- bool is_mandatory = false);
+static bool is_valid_expression(units * /* u */,
+ unsigned char /* scaling_unit */, // TODO:
grochar
+ bool /* is_parenthesized */,
+ bool /* is_mandatory */ = false);
static bool is_valid_expression_start();
-bool read_vunits(vunits *res, unsigned char si)
+bool read_vunits(vunits *res, unsigned char si) // TODO: grochar
{
if (!is_valid_expression_start())
return false;
@@ -73,7 +74,7 @@ bool read_vunits(vunits *res, unsigned char si)
return false;
}
-bool read_hunits(hunits *res, unsigned char si)
+bool read_hunits(hunits *res, unsigned char si) // TODO: grochar
{
if (!is_valid_expression_start())
return false;
@@ -86,7 +87,9 @@ bool read_hunits(hunits *res, unsigned char si)
return false;
}
-bool read_measurement(units *res, unsigned char si, bool is_mandatory)
+bool read_measurement(units *res,
+ unsigned char si, // TODO: grochar
+ bool is_mandatory)
{
if (!is_valid_expression_start())
return false;
@@ -116,9 +119,12 @@ bool read_integer(int *res)
enum incr_number_result { INVALID, ASSIGN, INCREMENT, DECREMENT };
-static incr_number_result get_incr_number(units *res, unsigned char);
+static incr_number_result get_incr_number(units * /* res */,
+ unsigned char /* si */); // TODO:
grochar
-bool read_vunits(vunits *res, unsigned char si, vunits prev_value)
+bool read_vunits(vunits *res,
+ unsigned char si, // TODO: grochar
+ vunits prev_value)
{
units v;
// Use a primitive temporary because having the ckd macros store to
@@ -146,7 +152,9 @@ bool read_vunits(vunits *res, unsigned char si, vunits
prev_value)
return true;
}
-bool read_hunits(hunits *res, unsigned char si, hunits prev_value)
+bool read_hunits(hunits *res,
+ unsigned char si, // TODO: grochar
+ hunits prev_value)
{
units h;
// Use a primitive temporary because having the ckd macros store to
@@ -222,7 +230,8 @@ bool read_integer(int *res, int prev_value)
}
-static incr_number_result get_incr_number(units *res, unsigned char si)
+static incr_number_result get_incr_number(units *res,
+ unsigned char si) // TODO: grochar
{
if (!is_valid_expression_start())
return INVALID;
@@ -255,10 +264,13 @@ enum { OP_LEQ = 'L', OP_GEQ = 'G', OP_MAX = 'X', OP_MIN =
'N' };
static const string valid_scaling_units("icfPmnpuvMsz");
-static bool is_valid_term(units *u, int scaling_unit,
- bool is_parenthesized, bool is_mandatory);
+static bool is_valid_term(units * /* u */,
+ unsigned char /* scaling_unit */, // TODO: grochar
+ bool /* is_parenthesized */,
+ bool /* is_mandatory */);
-static bool is_valid_expression(units *u, int scaling_unit,
+static bool is_valid_expression(units *u,
+ unsigned char scaling_unit, // TODO: grochar
bool is_parenthesized,
bool is_mandatory)
{
@@ -387,8 +399,10 @@ static bool is_valid_expression(units *u, int scaling_unit,
return result;
}
-static bool is_valid_term(units *u, int scaling_unit,
- bool is_parenthesized, bool is_mandatory)
+static bool is_valid_term(units *u,
+ unsigned char scaling_unit, // TODO: grochar
+ bool is_parenthesized,
+ bool is_mandatory)
{
bool is_negative = false;
bool is_overflowing = false;
diff --git a/src/roff/troff/token.h b/src/roff/troff/token.h
index c9798a1fd..8ce39acd5 100644
--- a/src/roff/troff/token.h
+++ b/src/roff/troff/token.h
@@ -149,13 +149,14 @@ class hunits;
extern void read_title_parts(node **part, hunits *part_width);
extern bool read_measurement(units * /* result */,
- unsigned char /* scale indicator */,
+ unsigned char /* si */, // TODO: grochar
bool /* is_mandatory */ = false);
extern bool read_integer(int *result);
-extern bool read_measurement(units *result, unsigned char si,
- units prev_value);
-extern bool read_integer(int *result, int prev_value);
+extern bool read_measurement(units * /* result */,
+ unsigned char /* si */, // TODO: grochar
+ units /* prev_value */);
+extern bool read_integer(int * /* result */, int /* prev_value */);
extern void interpolate_register(symbol, int);
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit