After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 746030 - src/sj-main.c:494: bad if ?
src/sj-main.c:494: bad if ?
Status: RESOLVED FIXED
Product: sound-juicer
Classification: Applications
Component: general
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: Sound Juicer Maintainers
Sound Juicer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-11 13:10 UTC by dcb
Modified: 2016-10-10 10:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simplify conditional (988 bytes, patch)
2016-10-07 17:46 UTC, Phillip Wood
committed Details | Review

Description dcb 2015-03-11 13:10:52 UTC
src/sj-main.c:494:66: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]

 if (!sj_str_is_empty (((TrackDetails*) (l->data))->composer) == TRUE) {

Maybe

 if (sj_str_is_empty (((TrackDetails*) (l->data))->composer) != TRUE) {

might be better code.
Comment 1 Phillip Wood 2015-03-11 16:41:19 UTC
(In reply to dcb from comment #0)
> src/sj-main.c:494:66: warning: logical not is only applied to the left hand
> side of comparison [-Wlogical-not-parentheses]
> 
>  if (!sj_str_is_empty (((TrackDetails*) (l->data))->composer) == TRUE) {

I don't know what I was thinking of when I wrote that 

> Maybe
> 
>  if (sj_str_is_empty (((TrackDetails*) (l->data))->composer) != TRUE) {
> 
> might be better code.

I think
(!sj_str_is_empty (((TrackDetails*) (l->data))->composer))
would be clearest
Comment 2 Phillip Wood 2016-10-07 17:46:48 UTC
Created attachment 337189 [details] [review]
Simplify conditional

Testing for ‘== TRUE’ is confusing, thanks to dcb for reporting this.
Comment 3 Phillip Wood 2016-10-10 10:35:07 UTC
Attachment 337189 [details] pushed as 3648a04 - Simplify conditional