[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: src: Resolve -Wmisleading-indentation warnings.
From: |
G. Branden Robinson |
Subject: |
[groff] 01/01: src: Resolve -Wmisleading-indentation warnings. |
Date: |
Sat, 11 Nov 2017 17:32:06 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 21b07d7b641d4572c4916d04069e18c8feba91cc
Author: G. Branden Robinson <address@hidden>
Date: Sat Nov 11 17:23:32 2017 -0500
src: Resolve -Wmisleading-indentation warnings.
Fix bug https://savannah.gnu.org/bugs/?51483.
* src/devices/grolbp/lbp.cpp (lbp_printer::setfillmode): No change in
operation; code was wrongly indented but appeared to do what was
intended.
* src/roff/troff/mtsm.cpp (mtsm::push_state, mtsm::pop_state): Only
flush standard error if we just wrote to it, not unconditionally.
Signed-off-by: Bjarni Ingi Gislason <address@hidden>
Signed-off-by: G. Branden Robinson <address@hidden>
The current version of the GNU Coding Standards doesn't actually
instruct people to omit braces around a one-statement body of a
for/if/while structure, but such an omission is the prevailing code
style. So I made Bjarni's patch conform, with a big red "goto fail;"
flashing in my head.
Signed-off-by: G. Branden Robinson <address@hidden>
---
ChangeLog | 11 +++++++++++
src/devices/grolbp/lbp.cpp | 7 ++++---
src/roff/troff/mtsm.cpp | 12 ++++++++----
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b0e9398..5474774 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-11-11 Bjarni Ingi Gislason <address@hidden>
+
+ * src/devices/grolbp/lbp.cpp (lbp_printer::setfillmode): Address
+ misleading indentation warning.
+
+ * src/roff/troff/mtsm.cpp (mtsm::push_state, mtsm::pop_state):
+ Same. Only flush standard error if we just wrote to it,
+ instead of unconditionally.
+
+ Fix bug https://savannah.gnu.org/bugs/?51483.
+
2017-11-11 G. Branden Robinson <address@hidden>
src/utils/xtotroff/xtotroff.c: Mark private function static.
diff --git a/src/devices/grolbp/lbp.cpp b/src/devices/grolbp/lbp.cpp
index 05324f3..93de202 100644
--- a/src/devices/grolbp/lbp.cpp
+++ b/src/devices/grolbp/lbp.cpp
@@ -388,9 +388,10 @@ inline void lbp_printer::setfillmode(int mode)
if (mode != 1)
vdmsetfillmode(mode, 1, 0);
else
- vdmsetfillmode(mode, 1, 1); // To get black we must use white
- // inverted
- fill_mode = mode;
+ // To get black, we must use white inverted.
+ vdmsetfillmode(mode, 1, 1);
+
+ fill_mode = mode;
}
}
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index 630957e..b4e02c4 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -374,8 +374,10 @@ void mtsm::push_state(statem *n)
{
if (is_html) {
#if defined(DEBUGGING)
- if (debug_state)
- fprintf(stderr, "--> state %d pushed\n", n->issue_no) ; fflush(stderr);
+ if (debug_state) {
+ fprintf(stderr, "--> state %d pushed\n", n->issue_no);
+ fflush(stderr);
+ }
#endif
sp = new stack(n, sp);
}
@@ -385,8 +387,10 @@ void mtsm::pop_state()
{
if (is_html) {
#if defined(DEBUGGING)
- if (debug_state)
- fprintf(stderr, "--> state popped\n") ; fflush(stderr);
+ if (debug_state) {
+ fprintf(stderr, "--> state popped\n");
+ fflush(stderr);
+ }
#endif
if (sp == 0)
fatal("empty state machine stack");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: src: Resolve -Wmisleading-indentation warnings.,
G. Branden Robinson <=