kwo pushed a commit to branch master.
commit 307d86f555ec0dcb676bc94231c10913d8da7982
Author: Kim Woelders <[email protected]>
Date: Wed Jun 5 22:41:36 2013 +0200
Cosmetics - paving the way for other changes.
---
src/aclass.c | 22 +++++++++++-----------
src/backgrounds.c | 6 ++----
src/desktops.c | 6 ++----
src/iconify.c | 8 ++------
src/menus.c | 3 +--
src/pager.c | 6 ++----
src/snaps.c | 5 ++---
7 files changed, 22 insertions(+), 34 deletions(-)
diff --git a/src/aclass.c b/src/aclass.c
index 704c3de..9d86746 100644
--- a/src/aclass.c
+++ b/src/aclass.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various
contributors
- * Copyright (C) 2004-2012 Kim Woelders
+ * Copyright (C) 2004-2013 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -54,7 +54,7 @@ struct _action {
struct _actionclass {
char *name;
int num;
- Action **list;
+ Action **actions;
char *tooltipstring;
unsigned int ref_count;
char global;
@@ -167,8 +167,8 @@ ActionclassAddAction(ActionClass * ac, Action * aa)
if (!ac || !aa)
return;
ac->num++;
- ac->list = EREALLOC(Action *, ac->list, ac->num);
- ac->list[ac->num - 1] = aa;
+ ac->actions = EREALLOC(Action *, ac->actions, ac->num);
+ ac->actions[ac->num - 1] = aa;
}
ActionClass *
@@ -204,9 +204,9 @@ ActionclassEmpty(ActionClass * ac)
int i;
for (i = 0; i < ac->num; i++)
- ActionDestroy(ac->list[i]);
+ ActionDestroy(ac->actions[i]);
ac->num = 0;
- _EFREE(ac->list);
+ _EFREE(ac->actions);
_EFREE(ac->tooltipstring);
}
@@ -833,7 +833,7 @@ AclassConfigWrite(const ActionClass * ac, void (*prf)
(const char *fmt, ...))
}
for (i = 0; i < ac->num; i++)
{
- aa = ac->list[i];
+ aa = ac->actions[i];
len = ActionEncode(aa, s, sizeof(s));
if (len <= 0)
continue;
@@ -934,7 +934,7 @@ ActionclassGetActionCount(ActionClass * ac)
Action *
ActionclassGetAction(ActionClass * ac, int ix)
{
- return (ac && ix < ac->num) ? ac->list[ix] : NULL;
+ return (ac && ix < ac->num) ? ac->actions[ix] : NULL;
}
const char *
@@ -1071,7 +1071,7 @@ ActionclassEvent(ActionClass * ac, XEvent * ev, EWin *
ewin)
{
if (!mode_action_destroy)
{
- aa = ac->list[i];
+ aa = ac->actions[i];
ok = 0;
if ((aa->event == type) && (aa->action))
{
@@ -1283,7 +1283,7 @@ GrabButtonGrabs(Win win)
ac->ref_count++;
for (j = 0; j < ac->num; j++)
{
- aa = ac->list[j];
+ aa = ac->actions[j];
if ((!aa) || ((aa->event != EVENT_MOUSE_DOWN) &&
(aa->event != EVENT_MOUSE_UP)))
continue;
@@ -1311,7 +1311,7 @@ UnGrabButtonGrabs(Win win)
ac->ref_count--;
for (j = 0; j < ac->num; j++)
{
- aa = ac->list[j];
+ aa = ac->actions[j];
if ((!aa) || ((aa->event != EVENT_MOUSE_DOWN)
&& (aa->event != EVENT_MOUSE_UP)))
continue;
diff --git a/src/backgrounds.c b/src/backgrounds.c
index b6baf3d..90401b0 100644
--- a/src/backgrounds.c
+++ b/src/backgrounds.c
@@ -1489,7 +1489,7 @@ CB_DesktopMiniDisplayRedraw(Dialog * d __UNUSED__, int
val __UNUSED__,
Background *bg;
Pixmap pmap;
int w, h;
- DItem *di;
+ DItem *di = (DItem *) data;
Win win;
unsigned int color;
const char *fbg, *ffg;
@@ -1497,7 +1497,6 @@ CB_DesktopMiniDisplayRedraw(Dialog * d __UNUSED__, int
val __UNUSED__,
if (!tmp_bg)
return;
- di = (DItem *) data;
win = DialogItemAreaGetWindow(di);
DialogItemAreaGetSize(di, &w, &h);
@@ -1804,10 +1803,9 @@ CB_BGAreaEvent(DItem * di, int val __UNUSED__, void
*data)
static void
CB_DesktopTimeout(Dialog * d __UNUSED__, int val __UNUSED__, void *data)
{
- DItem *di;
+ DItem *di = (DItem *) data;
char s[256];
- di = (DItem *) data;
Esnprintf(s, sizeof(s), _("Unused backgrounds freed after %2i:%02i:%02i"),
tmp_bg_timeout / 3600,
(tmp_bg_timeout / 60) - (60 * (tmp_bg_timeout / 3600)),
diff --git a/src/desktops.c b/src/desktops.c
index f937bb4..d827cfb 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -2377,7 +2377,7 @@ static void
CB_DesktopDisplayRedraw(Dialog * d, int val, void *data)
{
DeskDlgData *dd = DLG_DATA_GET(d, DeskDlgData);
- DItem *di;
+ DItem *di = (DItem *) data;
int i;
int w, h;
Win win;
@@ -2388,7 +2388,6 @@ CB_DesktopDisplayRedraw(Dialog * d, int val, void *data)
return;
dd->prev_desktops = dd->desktops;
- di = (DItem *) data;
win = DialogItemAreaGetWindow(di);
DialogItemAreaGetSize(di, &w, &h);
@@ -2617,8 +2616,8 @@ static void
CB_AreaDisplayRedraw(Dialog * d, int val, void *data)
{
AreaDlgData *dd = DLG_DATA_GET(d, AreaDlgData);
+ DItem *di = (DItem *) data;
char s[64];
- DItem *di;
Win win;
int w, h, ww, hh;
@@ -2628,7 +2627,6 @@ CB_AreaDisplayRedraw(Dialog * d, int val, void *data)
dd->prev_ax = dd->area_x;
dd->prev_ay = dd->area_y;
- di = (DItem *) data;
win = DialogItemAreaGetWindow(di);
DialogItemAreaGetSize(di, &w, &h);
diff --git a/src/iconify.c b/src/iconify.c
index cd5144c..1b6af3e 100644
--- a/src/iconify.c
+++ b/src/iconify.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various
contributors
- * Copyright (C) 2004-2011 Kim Woelders
+ * Copyright (C) 2004-2013 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -488,25 +488,21 @@ IconboxExit(Container * ct, int wm_exit)
static void
IconboxSighan(Container * ct __UNUSED__, int sig, void *prm)
{
- EWin *ewin;
+ EWin *ewin = (EWin *) prm;
switch (sig)
{
case ESIGNAL_EWIN_ICONIFY:
- ewin = (EWin *) prm;
IconboxesEwinIconify(ewin);
break;
case ESIGNAL_EWIN_DEICONIFY:
- ewin = (EWin *) prm;
IconboxesEwinDeIconify(ewin);
break;
case ESIGNAL_EWIN_DESTROY:
- ewin = (EWin *) prm;
if (ewin->state.iconified)
RemoveMiniIcon(ewin);
break;
case ESIGNAL_EWIN_CHANGE_ICON:
- ewin = (EWin *) prm;
if (ewin->state.iconified)
IconboxesUpdateEwinIcon(ewin, 1);
break;
diff --git a/src/menus.c b/src/menus.c
index 71f8569..4043364 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -1514,14 +1514,13 @@ _MenusSlide(Menu * m, int xdist, int ydist)
static int
SubmenuShowTimeout(void *data)
{
- Menu *m;
+ Menu *m = (Menu *) data;
MenuItem *mi;
EWin *ewin, *ewin2;
int xo, yo, mw, mh, xdist, ydist;
menu_timer_submenu = NULL;
- m = (Menu *) data;
if (!ecore_list_goto(menu_list, m))
goto done;
ewin = m->ewin;
diff --git a/src/pager.c b/src/pager.c
index 906b7eb..2029d05 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various
contributors
- * Copyright (C) 2004-2012 Kim Woelders
+ * Copyright (C) 2004-2013 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@@ -183,14 +183,12 @@ PagerScanCancel(Pager * p)
static int
PagerScanTimeout(void *data)
{
- Pager *p;
+ Pager *p = (Pager *) data;
EWin *ewin;
int y, y2, phase, cx, cy, ww, hh, xx, yy;
static int offsets[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
int pager_mode = PagersGetMode();
- p = (Pager *) data;
-
if (pager_mode != PAGER_MODE_SNAP)
goto nomore;
diff --git a/src/snaps.c b/src/snaps.c
index 731b117..d58225a 100644
--- a/src/snaps.c
+++ b/src/snaps.c
@@ -976,12 +976,11 @@ CB_ApplyRemember(Dialog * d __UNUSED__, int val, void
*data __UNUSED__)
static void
CB_RememberWindowSettings(Dialog * d __UNUSED__, int val __UNUSED__, void
*data)
{
- RememberWinList *rd;
+ RememberWinList *rd = (RememberWinList *) data;
Snapshot *sn;
- if (!data)
+ if (!rd)
return;
- rd = (RememberWinList *) data;
/* Make sure its still there */
sn = (Snapshot *) ecore_list_goto(ss_list, rd->snap);
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev