[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #40701] layout.C: 2 * bad if test ?
From: |
David Binderman |
Subject: |
[bug #40701] layout.C: 2 * bad if test ? |
Date: |
Mon, 25 Nov 2013 15:08:32 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 |
URL:
<http://savannah.gnu.org/bugs/?40701>
Summary: layout.C: 2 * bad if test ?
Project: DDD
Submitted by: dcb314
Submitted on: Mon 25 Nov 2013 15:08:31 GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Release: None
_______________________________________________________
Details:
I just ran the static analyser cppcheck over the source
code of ddd-3.3.12. It said
1.
[layout.C:1338] -> [layout.C:1338]: (style) Same expression on both sides of
'&&'.
Source code is
if (node->hashprev && node->hashprev) {
node->hashprev->hashnext = node->hashnext;
node->hashnext->hashprev = node->hashprev;
I think
if (node->hashprev && node->hashnext) {
node->hashprev->hashnext = node->hashnext;
node->hashnext->hashprev = node->hashprev;
might be better code.
2.
[layout.C:1796] -> [layout.C:1796]: (style) Same expression on both sides of
'&&'.
if (graph->hashprev && graph->hashprev) {
graph->hashprev->hashnext = graph->hashnext;
graph->hashnext->hashprev = graph->hashprev;
Duplicate.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?40701>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #40701] layout.C: 2 * bad if test ?,
David Binderman <=