[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 26/34: [libgroff]: Demote `need_space` to Boolean.
From: |
G. Branden Robinson |
Subject: |
[groff] 26/34: [libgroff]: Demote `need_space` to Boolean. |
Date: |
Thu, 2 Sep 2021 02:48:39 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit d617afdc974f92973f39ea7349dcfb565c8ac13f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 28 20:43:31 2021 +1000
[libgroff]: Demote `need_space` to Boolean.
* src/libs/libgroff/error.cpp (do_error_with_file_and_line): Demote
local integer `need_space` and its assignments to `bool`.
---
ChangeLog | 7 +++++++
src/libs/libgroff/error.cpp | 6 +++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9728a50..f9554d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2021-08-28 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [libgroff]: Demote `need_space` to Boolean.
+
+ * src/libs/libgroff/error.cpp (do_error_with_file_and_line):
+ Demote local integer `need_space` and its assignments to `bool`.
+
+2021-08-28 G. Branden Robinson <g.branden.robinson@gmail.com>
+
[libgroff]: Boolify `font::load()` and `font::load_desc()`
return values.
diff --git a/src/libs/libgroff/error.cpp b/src/libs/libgroff/error.cpp
index fb76783..1a54589 100644
--- a/src/libs/libgroff/error.cpp
+++ b/src/libs/libgroff/error.cpp
@@ -40,10 +40,10 @@ static void do_error_with_file_and_line(const char
*filename,
const errarg &arg2,
const errarg &arg3)
{
- int need_space = 0;
+ bool need_space = false;
if (program_name) {
fprintf(stderr, "%s:", program_name);
- need_space = 1;
+ need_space = true;
}
if (lineno >= 0 && filename != 0) {
if (strcmp(filename, "-") == 0)
@@ -52,7 +52,7 @@ static void do_error_with_file_and_line(const char *filename,
fprintf(stderr, "%s (%s):%d:", filename, source_filename, lineno);
else
fprintf(stderr, "%s:%d:", filename, lineno);
- need_space = 1;
+ need_space = true;
}
if (need_space)
fputc(' ', stderr);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 26/34: [libgroff]: Demote `need_space` to Boolean.,
G. Branden Robinson <=