gbranden pushed a commit to branch master
in repository groff.
commit 953664bfe57a01bef987316729122713b56b65b7
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Jul 13 09:41:59 2026 -0500
src/preproc/eqn/text.cpp: Fix code style nits.
* src/preproc/eqn/text.cpp: Rationalize header file inclusions. Arrange
C standard library header file names in alphabetical order.
(special_char_box::output): Spell null pointer constant the idiomatic
C++98 way (`0`) instead of as `NULL`.
---
ChangeLog | 8 ++++++++
src/preproc/eqn/text.cpp | 12 ++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index deb77b9a8..4edf36938 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-07-13 G. Branden Robinson <[email protected]>
+
+ * src/preproc/eqn/text.cpp: Fix code style nits. Rationalize
+ header file inclusions. Arrange C standard library header file
+ names in alphabetical order.
+ (special_char_box::output): Spell null pointer constant the
+ idiomatic C++98 way (`0`) instead of as `NULL`.
+
2026-07-08 Nguyễn Gia Phong <[email protected]>
* src/preproc/eqn/text.cpp: Drop dead static data
diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp
index 3a412e85d..e9084080b 100644
--- a/src/preproc/eqn/text.cpp
+++ b/src/preproc/eqn/text.cpp
@@ -21,10 +21,10 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#include <config.h>
#endif
-#include <stdcountof.h>
-
#include <ctype.h>
+#include <stdcountof.h>
#include <stdlib.h>
+
#include "eqn.h"
#include "pbox.h"
#include "ptable.h"
@@ -241,18 +241,21 @@ void char_box::output()
}
}
+// TODO: boolify
int char_box::left_is_italic()
{
int font_type = char_table[c].font_type;
return font_type == LETTER_TYPE;
}
+// TODO: boolify
int char_box::right_is_italic()
{
int font_type = char_table[c].font_type;
return font_type == LETTER_TYPE;
}
+// TODO: boolify
int char_box::is_char()
{
return 1;
@@ -291,15 +294,16 @@ void special_char_box::output()
}
else if (output_format == mathml) {
const char *unicode_code_point = valid_unicode_code_sequence(s);
- if (unicode_code_point == NULL)
+ if (0 /* nullptr */ == unicode_code_point)
unicode_code_point = glyph_name_to_unicode(s);
- if (unicode_code_point != NULL)
+ if (unicode_code_point != 0 /* nullptr */)
printf("<mo>&#x%s;</mo>", unicode_code_point);
else
printf("<merror>unknown eqn/troff special char %s</merror>", s);
}
}
+// TODO: boolify
int special_char_box::is_char()
{
return 1;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit