Introduction
Introduction Statistics Contact Development Disclaimer Help
fix 2 false-positive warnings with gcc 10.2+ and -Wall -O2 - sfeed_curses - sfe…
git clone git://git.codemadness.org/sfeed_curses
Log
Files
Refs
README
LICENSE
---
commit 61c48746013c47d77b47c0b7606882983b185b6d
parent f0a76e0f90e04147b1199a9187c97c4727d240c4
Author: Hiltjo Posthuma <[email protected]>
Date: Wed, 7 Apr 2021 20:29:28 +0200
fix 2 false-positive warnings with gcc 10.2+ and -Wall -O2
These conditions cannot happen though.
Noticed in the package for Oasis Linux:
https://github.com/oasislinux/oasis/blob/master/pkg/sfeed_curses/gen.lua
Thanks Michael Forney.
Diffstat:
M sfeed_curses.c | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
---
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -1483,7 +1483,7 @@ void
feeds_reloadall(void)
{
struct pane *p;
- struct feed *f;
+ struct feed *f = NULL;
struct row *row;
off_t pos;
@@ -1502,7 +1502,7 @@ feeds_reloadall(void)
updatetitle();
/* try to find the same feed in the pane */
- if (row && f && (pos = feeds_row_get(p, f)) != -1)
+ if (f && (pos = feeds_row_get(p, f)) != -1)
pane_setpos(p, pos);
else
pane_setpos(p, 0);
@@ -1644,7 +1644,7 @@ updatesidebar(void)
struct row *row;
struct feed *feed;
size_t i, nrows;
- int oldvalue, newvalue;
+ int oldvalue = 0, newvalue = 0;
p = &panes[PaneFeeds];
if (!p->rows)
@@ -1678,18 +1678,10 @@ updatesidebar(void)
}
p->nrows = nrows;
- switch (layout) {
- case LayoutVertical:
- case LayoutHorizontal:
- if (oldvalue != newvalue)
- updategeom();
- else
- p->dirty = 1;
- break;
- default:
+ if (oldvalue != newvalue)
+ updategeom();
+ else
p->dirty = 1;
- break;
- }
if (!p->nrows)
p->pos = 0;
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.