lalitmetkar / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

duplicate branches for if and else in src/gui_xmebw.c #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
cppcheck static analyzer gives this warning:

[gui_xmebw.c:381] -> [gui_xmebw.c:378]: (style) Found duplicate branches for if 
and else.

Code looks like this:

src/gui_xmebw.c:

 286     static void
 287 set_pixmap(XmEnhancedButtonWidget eb)
 ...
 378     if (eb->enhancedbutton.label_location == (int)XmTOP
 379             || eb->enhancedbutton.label_location == (int)XmBOTTOM)
 380         shift = eb->primitive.shadow_thickness / 2;
 381     else
 382         shift = eb->primitive.shadow_thickness / 2;

Surely something else was intended here, or the if statement
is useless since both branches do the exact same thing.

I could not tell what was intended.

Original issue reported on code.google.com by dominiqu...@gmail.com on 24 Jun 2012 at 6:16

GoogleCodeExporter commented 9 years ago
Patch 7.3.572 removes the duplicate and adds a TODO to figure out the right 
solution.

Original comment by brammool...@gmail.com on 29 Jun 2012 at 11:17