gbranden pushed a commit to branch master
in repository groff.
commit d07c7b45fa4ab7e4738674782ef61044c44047a0
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 23 15:46:54 2026 -0600
src/roff/troff/env.cpp: Fix code style nit.
* src/roff/troff/env.cpp (font_size::font_size, font_size::to_units):
Parenthesize formally complex expressions.
---
ChangeLog | 6 ++++++
src/roff/troff/env.cpp | 5 +++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fca976ea4..13310f4d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-11-23 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/env.cpp (font_size::font_size)
+ (font_size::to_units): Fix code style nit. Parenthesize
+ formally complex expressions.
+
2026-11-23 G. Branden Robinson <[email protected]>
* src/roff/troff/env.{h,cpp}: Slightly refactor.
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index 00776ad59..ec10f15cf 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -308,7 +308,8 @@ font_size::font_size(int sp)
{
for (int i = 0; i < nranges; i++) {
if (sp < size_list[i].min) {
- if (i > 0 && size_list[i].min - sp >= sp - size_list[i - 1].max)
+ if ((i > 0)
+ && (size_list[i].min - sp) >= (sp - size_list[i - 1].max))
p = size_list[i - 1].max;
else
p = size_list[i].min;
@@ -324,7 +325,7 @@ font_size::font_size(int sp)
int font_size::to_units() const
{
- return scale(p, units_per_inch, sizescale*72);
+ return scale(p, units_per_inch, (sizescale * 72));
}
// we can't do this in a static constructor because various dictionaries
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit