From 85cf397ec18ecfde36433fb65e5d91ecd325b76e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 4 Nov 2016 20:46:22 -0400 Subject: [PATCH] src/gtx/curseswindows.c: Fix misleading indentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes these warnings (errors with --enable-checking) from GCC 6.2: curseswindows.c: In function ‘gator_cursesgwin_drawchar’: curseswindows.c:574:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (params->highlight) ^~ curseswindows.c:576:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (code) ^~ curseswindows.c:579:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (params->highlight) ^~ curseswindows.c:581:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (code) ^~ curseswindows.c: In function ‘gator_cursesgwin_drawstring’: curseswindows.c:628:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (params->highlight) ^~ curseswindows.c:630:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (code) ^~ curseswindows.c:633:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (params->highlight) ^~ curseswindows.c:635:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ if (code) ^~ Change-Id: Ib53eb5755eebb5e22a5414ced8a2540825b41e15 Reviewed-on: https://gerrit.openafs.org/12439 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/gtx/curseswindows.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gtx/curseswindows.c b/src/gtx/curseswindows.c index d184f6d15..ecd6d8b83 100644 --- a/src/gtx/curseswindows.c +++ b/src/gtx/curseswindows.c @@ -571,15 +571,17 @@ gator_cursesgwin_drawchar(struct gwin *gwp, struct gwin_charparams *params) mn, rn, params->c, cwp->wp, params->x, params->y, curses_y, curses_x, (params->highlight ? ", using standout mode" : "")); wmove(cwp->wp, curses_y, curses_x); - if (params->highlight) + if (params->highlight) { code=wstandout(cwp->wp); if (code) return (code); + } waddch(cwp->wp, params->c); - if (params->highlight) + if (params->highlight) { code=wstandend(cwp->wp); if (code) return (code); + } return (0); @@ -625,15 +627,17 @@ gator_cursesgwin_drawstring(struct gwin *gwp, struct gwin_strparams *params) mn, rn, params->s, cwp->wp, params->x, params->y, curses_y, curses_x, (params->highlight ? ", using standout mode" : "")); wmove(cwp->wp, curses_y, curses_x); - if (params->highlight) + if (params->highlight) { code=wstandout(cwp->wp); if (code) return (code); + } waddstr(cwp->wp, params->s); - if (params->highlight) + if (params->highlight) { code=wstandend(cwp->wp); if (code) return (code); + } return (code); -- 2.39.5