mirror of
https://github.com/morgant/mlvwm.git
synced 2025-02-21 01:29:12 +00:00
Cleaned up several 'dead assignment' detected by clang scan-build. Issue #48
This commit is contained in:
parent
962f6de8bf
commit
edb8ed9bea
@ -113,14 +113,12 @@ void SetUpFrame( MlvwmWindow *t, int x, int y, int w, int h, Bool sendEvent )
|
||||
{
|
||||
XWindowChanges xwcv;
|
||||
unsigned long xwcm;
|
||||
int title_height, sbar_v, sbar_h, resize_r;
|
||||
int title_height, sbar_v, sbar_h;
|
||||
int sbar_vh, sbar_hw;
|
||||
|
||||
title_height = t->flags & TITLE ? TITLE_HEIGHT : 0;
|
||||
sbar_v = t->flags & SBARV ? SBAR_WH : 0;
|
||||
sbar_h = t->flags & SBARH ? SBAR_WH : 0;
|
||||
resize_r = t->flags & RESIZER ?
|
||||
SBAR_WH : ( sbar_v!=0 && sbar_h!=0 ? SBAR_WH : 0 );
|
||||
|
||||
if( t->flags&TITLE )
|
||||
XResizeWindow( dpy, t->title_w,
|
||||
@ -600,7 +598,6 @@ void DrawSbarAnk( MlvwmWindow *t, int context, Bool on_off )
|
||||
}
|
||||
attributes.background_pixel = xgcv.foreground;
|
||||
attributes.cursor = Scr.MlvwmCursors[DEFAULT];
|
||||
valuemask = CWBackPixel | CWCursor;
|
||||
|
||||
valuemask = CWBackPixel;
|
||||
XChangeWindowAttributes( dpy, win, valuemask, &attributes );
|
||||
@ -712,7 +709,6 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
|
||||
DrawArrow( win, context, fill, outline);
|
||||
}
|
||||
else{
|
||||
mask = GCForeground;
|
||||
attributes.background_pixel = WhitePixel( dpy, Scr.screen );
|
||||
attributes.cursor = Scr.MlvwmCursors[DEFAULT];
|
||||
valuemask = CWBackPixel | CWCursor;
|
||||
@ -820,7 +816,6 @@ void DrawSbarBar( MlvwmWindow *t, int context, Bool on_off )
|
||||
}
|
||||
}
|
||||
else{
|
||||
mask = GCForeground;
|
||||
attributes.background_pixel = WhitePixel( dpy, Scr.screen );
|
||||
attributes.cursor = Scr.MlvwmCursors[DEFAULT];
|
||||
valuemask = CWBackPixel | CWCursor;
|
||||
|
@ -1198,7 +1198,7 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
||||
unsigned int JunkMask;
|
||||
int *check_axis, *anker_check, timeout=1;
|
||||
struct timeval tp, current;
|
||||
Window JunkRoot, JunkChild, bar, anker;
|
||||
Window JunkRoot, JunkChild, anker;
|
||||
XWindowAttributes winattrs, winattrs_a;
|
||||
int ignore=1;
|
||||
XEvent ev;
|
||||
@ -1216,7 +1216,6 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
||||
tmp_win->scroll_h[pushd]!=pressedwin; pushd++ );
|
||||
if( pushd==1 ) direction = C_SBAR_LEFT;
|
||||
if( pushd==2 ) direction = C_SBAR_RIGHT;
|
||||
bar = tmp_win->scroll_h[0];
|
||||
if (tmp_win->hints.flags & PResizeInc)
|
||||
inc = tmp_win->hints.width_inc;
|
||||
inc_view = winattrs.width;
|
||||
@ -1232,7 +1231,6 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
|
||||
tmp_win->scroll_v[pushd]!=pressedwin; pushd++ );
|
||||
if( pushd==1 ) direction = C_SBAR_UP;
|
||||
if( pushd==2 ) direction = C_SBAR_DOWN;
|
||||
bar = tmp_win->scroll_v[0];
|
||||
if( tmp_win->hints.flags & PResizeInc )
|
||||
inc = tmp_win->hints.height_inc;
|
||||
inc_view = winattrs.height;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
void RedrawMenu( MenuLabel *m, Bool onoroff )
|
||||
{
|
||||
GC tmp_f_GC, tmp_b_GC;
|
||||
GC tmp_f_GC;
|
||||
int width, offset;
|
||||
unsigned long gcm;
|
||||
XGCValues gcv;
|
||||
@ -60,14 +60,10 @@ void RedrawMenu( MenuLabel *m, Bool onoroff )
|
||||
StrWidthHeight( MENUBARFONT, &width, NULL, &offset,
|
||||
m->LabelStr, strlen(m->LabelStr));
|
||||
|
||||
if( onoroff ){
|
||||
if( onoroff )
|
||||
tmp_f_GC = Scr.WhiteGC;
|
||||
tmp_b_GC = Scr.BlackGC;
|
||||
}
|
||||
else{
|
||||
else
|
||||
tmp_f_GC = Scr.BlackGC;
|
||||
tmp_b_GC = Scr.WhiteGC;
|
||||
}
|
||||
if( !(m->flags&ACTIVE) && Scr.d_depth>1 )
|
||||
tmp_f_GC = Scr.Gray3GC;
|
||||
if( !m->xpm ){
|
||||
@ -1222,7 +1218,7 @@ void SetMenu( char *line, FILE *fp )
|
||||
|
||||
void SetMenuBar( char *line, FILE *fp )
|
||||
{
|
||||
char str[256], *top, tmp[8];
|
||||
char str[256], tmp[8];
|
||||
Menu *tmp_m, *last_m;
|
||||
MenuLink **tmp_link;
|
||||
MenuLabel *tmp_l;
|
||||
@ -1236,13 +1232,9 @@ void SetMenuBar( char *line, FILE *fp )
|
||||
last_m=last_m->next );
|
||||
last_m->next = tmp_m;
|
||||
}
|
||||
if( (top = strchr( line, ',' ))!=NULL )
|
||||
*top = '\0';
|
||||
tmp_m->name = calloc( strlen(line)-7, 1 );
|
||||
sscanf( line, "%s%s", tmp, tmp_m->name );
|
||||
|
||||
if( top ) top++;
|
||||
else top = line+strlen( line );
|
||||
tmp_link = &tmp_m->link;
|
||||
|
||||
for( tmp_l=Scr.MenuLabelRoot; tmp_l; tmp_l=tmp_l->next ){
|
||||
|
Loading…
x
Reference in New Issue
Block a user