From 7fd4f7a71d462d93f267ab6ed2dc5d00a4d3835a Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Wed, 24 Oct 2012 17:20:38 +0000 Subject: [PATCH] Cosmetics. SVN revision: 78407 --- src/aclass.c | 2 +- src/arrange.c | 1 - src/backgrounds.c | 4 ++-- src/buttons.c | 4 ++-- src/comms.c | 2 +- src/container.c | 13 ++++++------- src/desktops.c | 20 ++++++++++---------- src/draw.c | 2 +- src/e16-ecore_hints.c | 2 +- src/e16-ecore_list.c | 11 ++++++----- src/econfig.c | 6 ------ src/edbus.c | 6 +++--- src/events.c | 4 ++-- src/ewin-ops.c | 17 ++++++++--------- src/ewins.c | 4 ++-- src/grabs.c | 2 +- src/groups.c | 2 +- src/hints.c | 2 +- src/icccm.c | 2 +- src/ipc.c | 1 - src/settings.c | 2 +- src/snaps.c | 2 +- src/theme.c | 2 +- src/tooltips.c | 1 - src/zoom.c | 2 +- 25 files changed, 53 insertions(+), 63 deletions(-) diff --git a/src/aclass.c b/src/aclass.c index 71980350..8bd4d4bf 100644 --- a/src/aclass.c +++ b/src/aclass.c @@ -653,7 +653,7 @@ ActionEncode(Action * aa, char *buf, int len) if (aa->anybutton) strcpy(btn, "*"); else - sprintf(btn, "%u", aa->button); + sprintf(btn, "%d", aa->button); len = Esnprintf(buf, len, "%-11s %4s %s %s\n", event, mod, btn, (aa->action->params) ? aa->action->params : ""); break; diff --git a/src/arrange.c b/src/arrange.c index 197e420e..fad472e2 100644 --- a/src/arrange.c +++ b/src/arrange.c @@ -856,7 +856,6 @@ ArrangeEwinXY(EWin * ewin, int *px, int *py) RectBox *fixed, *ret, newrect; fixed = NULL; - ret = NULL; EwinListGetAll(&num); if (num <= 1) diff --git a/src/backgrounds.c b/src/backgrounds.c index 12c335d4..1a5e1bba 100644 --- a/src/backgrounds.c +++ b/src/backgrounds.c @@ -102,7 +102,7 @@ _BackgroundGetFgFile(Background * bg) char * BackgroundGetUniqueString(Background * bg) { - static const char *chmap = + static const char chmap[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; char s[256], *f; int r, g, b; @@ -1307,7 +1307,7 @@ BackgroundsConfigSave(void) for (j = 0; j < N_BG_ASSIGNED; j++) { if (bg == bg_assigned[j]) - fprintf(fs, "%d %d\n", BG_DESKNUM, j); + fprintf(fs, "%d %u\n", BG_DESKNUM, j); } fprintf(fs, "1000\n"); diff --git a/src/buttons.c b/src/buttons.c index 6f20c6be..4069f5eb 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -876,9 +876,9 @@ ButtonsConfigSave(void) fprintf(fs, "536 %i\n", b->geom.ysizerel); fprintf(fs, "537 %i\n", b->geom.ysizeabs); fprintf(fs, "538 %i\n", b->geom.size_from_image); - fprintf(fs, "539 %i\n", EoGetDeskNum(b)); + fprintf(fs, "539 %u\n", EoGetDeskNum(b)); fprintf(fs, "540 %i\n", EoIsSticky(b)); - fprintf(fs, "542 %i\n", EoIsShown(b)); + fprintf(fs, "542 %u\n", EoIsShown(b)); if (b->flags) { diff --git a/src/comms.c b/src/comms.c index 45e7fb48..2afd1554 100644 --- a/src/comms.c +++ b/src/comms.c @@ -324,7 +324,7 @@ CommsDoSend(Window win, const char *s) { ss[8 + j] = s[i + j]; if (!s[i + j]) - j = 12; + break; } ss[20] = 0; for (k = 0; k < 20; k++) diff --git a/src/container.c b/src/container.c index 17d03332..f07e596f 100644 --- a/src/container.c +++ b/src/container.c @@ -382,7 +382,7 @@ ContainerLayoutImageWin(Container * ct) int i, xo, yo; int item_pad, padl, padr, padt, padb; ContainerObject *cto; - EImageBorder *pad, *pad_base; + EImageBorder *pad; if (ct->orientation) ct->ic_box = ImageclassFind("ICONBOX_VERTICAL", 0); @@ -404,17 +404,16 @@ ContainerLayoutImageWin(Container * ct) if (ct->draw_icon_base) { - pad_base = ImageclassGetPadding(ct->ic_item_base); - padl = pad_base->left; - padr = pad_base->right; - padt = pad_base->top; - padb = pad_base->bottom; + pad = ImageclassGetPadding(ct->ic_item_base); + padl = pad->left; + padr = pad->right; + padt = pad->top; + padb = pad->bottom; item_pad = 0; } else { - pad_base = NULL; padl = padr = padt = padb = 0; item_pad = 2; diff --git a/src/desktops.c b/src/desktops.c index 8d3ee62e..d7e1439a 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -282,12 +282,12 @@ DeskControlsCreate(Desk * dsk) if (Conf.desks.dragbar_width > 0) { - b = ButtonCreate("_DESKTOP_DRAG_CONTROL", 1, ic2, ac2, NULL, NULL, - -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[0], 0, - y[0], 0, 0, w[0], 0, h[0], 0, dsk->num, 0); - b = ButtonCreate("_DESKTOP_DRAG_CONTROL", 1, ic3, ac3, NULL, NULL, - -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[1], 0, - y[1], 0, 0, w[1], 0, h[1], 0, dsk->num, 0); + ButtonCreate("_DESKTOP_DRAG_CONTROL", 1, ic2, ac2, NULL, NULL, + -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[0], 0, + y[0], 0, 0, w[0], 0, h[0], 0, dsk->num, 0); + ButtonCreate("_DESKTOP_DRAG_CONTROL", 1, ic3, ac3, NULL, NULL, + -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[1], 0, + y[1], 0, 0, w[1], 0, h[1], 0, dsk->num, 0); b = ButtonCreate("_DESKTOP_DRAG_CONTROL", 1, ic1, ac1, NULL, NULL, -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[2], 0, y[2], 0, 0, w[2], 0, h[2], 0, dsk->num, 0); @@ -2719,7 +2719,7 @@ DesksIpcDesk(const char *params) } else if (!strncmp(cmd, "set", 3)) { - sscanf(prm, "%i", &desk); + sscanf(prm, "%u", &desk); ChangeNumberOfDesktops(desk); } else if (!strncmp(cmd, "list", 2)) @@ -2738,7 +2738,7 @@ DesksIpcDesk(const char *params) } else if (!strncmp(cmd, "goto", 2)) { - sscanf(prm, "%i", &desk); + sscanf(prm, "%u", &desk); DeskOpGoto(desk); } else if (!strncmp(cmd, "next", 2)) @@ -2759,13 +2759,13 @@ DesksIpcDesk(const char *params) } else if (!strncmp(cmd, "raise", 2)) { - sscanf(prm, "%i", &desk); + sscanf(prm, "%u", &desk); SoundPlay(SOUND_DESKTOP_RAISE); DeskRaise(desk); } else if (!strncmp(cmd, "lower", 2)) { - sscanf(prm, "%i", &desk); + sscanf(prm, "%u", &desk); SoundPlay(SOUND_DESKTOP_LOWER); DeskLower(desk); } diff --git a/src/draw.c b/src/draw.c index d6d40cb9..721aa5b2 100644 --- a/src/draw.c +++ b/src/draw.c @@ -397,7 +397,7 @@ void DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, int firstlast, int seqno) { - static ShapeData sd, *psd = &sd; + static ShapeData sd, *const psd = &sd; Window root = WinGetXwin(VROOT); int dx, dy; diff --git a/src/e16-ecore_hints.c b/src/e16-ecore_hints.c index 1d0bb810..a901fcd3 100644 --- a/src/e16-ecore_hints.c +++ b/src/e16-ecore_hints.c @@ -895,7 +895,7 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root, const char **names, if (!s) { /* Default to "Desk-" */ - sprintf(ss, "Desk-%d", i); + sprintf(ss, "Desk-%u", i); s = ss; } diff --git a/src/e16-ecore_list.c b/src/e16-ecore_list.c index fc66351a..2bed6bdd 100644 --- a/src/e16-ecore_list.c +++ b/src/e16-ecore_list.c @@ -333,7 +333,7 @@ Functions that remove nodes from an Ecore_List. EAPI void * ecore_list_remove(Ecore_List * list) { - void *ret = NULL; + void *ret; Ecore_List_Node *old; if (ecore_list_empty_is(list)) @@ -396,7 +396,7 @@ ecore_list_remove_destroy(Ecore_List * list) EAPI void * ecore_list_first_remove(Ecore_List * list) { - void *ret = NULL; + void *ret; Ecore_List_Node *old; if (ecore_list_empty_is(list)) @@ -432,7 +432,7 @@ ecore_list_first_remove(Ecore_List * list) EAPI void * ecore_list_last_remove(Ecore_List * list) { - void *ret = NULL; + void *ret; Ecore_List_Node *old, *prev; if (ecore_list_empty_is(list)) @@ -708,7 +708,7 @@ _ecore_list_node_new(void) * @return @c TRUE. * @ingroup Ecore_Data_List_Node_Group */ -EAPI int +static int _ecore_list_node_destroy(Ecore_List_Node * node, Ecore_Free_Cb free_func) { if (free_func && node->data) @@ -750,7 +750,8 @@ ecore_list_items_get(Ecore_List * list, int *pnum) if (!lst) return NULL; - for (i = 0, ecore_list_first_goto(list); (b = ecore_list_next(list));) + for (i = 0, ecore_list_first_goto(list); + (b = ecore_list_next(list)) != NULL;) lst[i++] = b; *pnum = num; diff --git a/src/econfig.c b/src/econfig.c index b1394a08..0ff69d90 100644 --- a/src/econfig.c +++ b/src/econfig.c @@ -129,11 +129,6 @@ e16_db_close(ECfgFile * ecf) Efree(ecf); } -static void -e16_db_flush(void) -{ -} - static const char * ECfgFileFindValue(ECfgFile * ecf, const char *key) { @@ -272,7 +267,6 @@ ConfigurationSave(void) MODULE_LIST_FREE(pml); e16_db_close(ecf); - e16_db_flush(); } const CfgItem * diff --git a/src/edbus.c b/src/edbus.c index 63110263..1794bb74 100644 --- a/src/edbus.c +++ b/src/edbus.c @@ -305,9 +305,9 @@ DbusInit(void) if (!dbus_connection_add_filter(dbus_data.conn, DbusMsgHandler, NULL, NULL)) return; - err = dbus_connection_set_watch_functions(dbus_data.conn, - DbusWatchAdd, DbusWatchRemove, - DbusWatchToggle, NULL, NULL); + dbus_connection_set_watch_functions(dbus_data.conn, + DbusWatchAdd, DbusWatchRemove, + DbusWatchToggle, NULL, NULL); /* Handle pending D-Bus stuff */ DbusHandleFd(); diff --git a/src/events.c b/src/events.c index 479d65b4..f4ec029e 100644 --- a/src/events.c +++ b/src/events.c @@ -671,8 +671,7 @@ EventsCompress(XEvent * evq, int count) ev->xdestroywindow.window) continue; ev2->type = EX_EVENT_CREATE_GONE; - j = -1; /* Break for() */ - break; + goto loop_quit_DestroyNotify; case DestroyNotify: break; case UnmapNotify: @@ -709,6 +708,7 @@ EventsCompress(XEvent * evq, int count) break; } } + loop_quit_DestroyNotify: break; case Expose: diff --git a/src/ewin-ops.c b/src/ewin-ops.c index 1b004f0d..1fe04b9f 100644 --- a/src/ewin-ops.c +++ b/src/ewin-ops.c @@ -1453,7 +1453,7 @@ EwinOpKill(EWin * ewin, int source __UNUSED__) void EwinOpRaise(EWin * ewin, int source __UNUSED__) { - EWin **gwins = NULL; + EWin **gwins; int i, num; SoundPlay(SOUND_RAISE); @@ -1467,7 +1467,7 @@ EwinOpRaise(EWin * ewin, int source __UNUSED__) void EwinOpLower(EWin * ewin, int source __UNUSED__) { - EWin **gwins = NULL; + EWin **gwins; int i, num; SoundPlay(SOUND_LOWER); @@ -1481,7 +1481,7 @@ EwinOpLower(EWin * ewin, int source __UNUSED__) void EwinOpStick(EWin * ewin, int source __UNUSED__, int on) { - EWin **gwins = NULL; + EWin **gwins; int i, num; gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_STICK, @@ -1553,7 +1553,7 @@ EwinOpNeverFocus(EWin * ewin, int on) void EwinOpIconify(EWin * ewin, int source __UNUSED__, int on) { - EWin **gwins = NULL; + EWin **gwins; int i, num; gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_ICONIFY, @@ -1571,7 +1571,7 @@ EwinOpIconify(EWin * ewin, int source __UNUSED__, int on) void EwinOpShade(EWin * ewin, int source __UNUSED__, int on) { - EWin **gwins = NULL; + EWin **gwins; int i, num; gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_SHADE, @@ -1607,7 +1607,7 @@ EwinOpSetLayer(EWin * ewin, int source __UNUSED__, int layer) void EwinOpSetBorder(EWin * ewin, int source __UNUSED__, const char *name) { - EWin **gwins = NULL; + EWin **gwins; int i, num; char has_shaded; Border *b; @@ -1618,9 +1618,8 @@ EwinOpSetBorder(EWin * ewin, int source __UNUSED__, const char *name) return; has_shaded = 0; - gwins = - ListWinGroupMembersForEwin(ewin, GROUP_ACTION_SET_WINDOW_BORDER, - Mode.nogroup, &num); + gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_SET_WINDOW_BORDER, + Mode.nogroup, &num); for (i = 0; i < num; i++) { if (gwins[i]->state.shaded) diff --git a/src/ewins.c b/src/ewins.c index 887d061b..0d6d11d2 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -2021,14 +2021,14 @@ EwinChange(EWin * ewin __UNUSED__, unsigned int flag) EWinChanges.flags |= flag; } -void +static void EwinChangesStart(EWin * ewin) { EWinChanges.flags = 0; EWinChanges.desk = EoGetDesk(ewin); } -void +static void EwinChangesProcess(EWin * ewin) { if (!EWinChanges.flags) diff --git a/src/grabs.c b/src/grabs.c index ab143adc..f9d2a711 100644 --- a/src/grabs.c +++ b/src/grabs.c @@ -57,7 +57,7 @@ GrabKeyboardRelease(void) int GrabPointerSet(Win win, unsigned int csr, int confine) { - int ret = -1; + int ret; Window confine_to = (confine) ? WinGetXwin(VROOT) : None; ret = XGrabPointer(disp, WinGetXwin(win), False, diff --git a/src/groups.c b/src/groups.c index 5adb8c8c..e425b7d0 100644 --- a/src/groups.c +++ b/src/groups.c @@ -355,7 +355,7 @@ EwinsInGroup(const EWin * ewin1, const EWin * ewin2) return NULL; } -void +static void RemoveEwinFromGroup(EWin * ewin, Group * g) { int i, j, k, i2; diff --git a/src/hints.c b/src/hints.c index 3f8936d2..eefc3de6 100644 --- a/src/hints.c +++ b/src/hints.c @@ -366,7 +366,7 @@ typedef union { unsigned docked:1; unsigned iconified:1; } b; - int all:32; + unsigned all:32; } EWinInfoFlags; #define ENL_DATA_ITEMS 12 diff --git a/src/icccm.c b/src/icccm.c index a7d4ab1b..fa501f55 100644 --- a/src/icccm.c +++ b/src/icccm.c @@ -779,7 +779,7 @@ ICCCM_GetHints(EWin * ewin) ICCCM_GetWmClientLeader(ewin); } -void +static void ICCCM_SetIconSizes(void) { XIconSize *is; diff --git a/src/ipc.c b/src/ipc.c index 81c61c55..0d2faf64 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -833,7 +833,6 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm) case EWIN_OP_NO_REDIRECT: on = EoGetNoRedirect(ewin); - on = ewin->o.noredir; if (SetEwinBoolean(wop->name, &on, param1, 1)) EoSetNoRedirect(ewin, on); break; diff --git a/src/settings.c b/src/settings.c index 33cea816..747c2a89 100644 --- a/src/settings.c +++ b/src/settings.c @@ -778,7 +778,7 @@ const DialogDef DlgComposite = { * Combined configuration dialog */ -static const DialogDef *dialogs[] = { +static const DialogDef *const dialogs[] = { &DlgFocus, &DlgMoveResize, &DlgPlacement, diff --git a/src/snaps.c b/src/snaps.c index 1fd1d089..2c64a59b 100644 --- a/src/snaps.c +++ b/src/snaps.c @@ -384,7 +384,7 @@ _SnapUpdateEwinCmd(Snapshot * sn, const EWin * ewin) static void _SnapUpdateEwinGroups(Snapshot * sn, const EWin * ewin, char onoff) { - EWin **gwins = NULL; + EWin **gwins; Group *const *groups; int i, j, num, num_groups; diff --git a/src/theme.c b/src/theme.c index 22e80c2f..a20f3b37 100644 --- a/src/theme.c +++ b/src/theme.c @@ -92,7 +92,7 @@ static void append_merge_dir(char *dir, char ***list, int *count) { char ss[FILEPATH_LEN_MAX], s1[FILEPATH_LEN_MAX]; - char **str = NULL, *s; + char **str, *s; int i, num; str = E_ls(dir, &num); diff --git a/src/tooltips.c b/src/tooltips.c index d803d3d5..0932fd98 100644 --- a/src/tooltips.c +++ b/src/tooltips.c @@ -306,7 +306,6 @@ TooltipShow(ToolTip * tt, const char *text, ActionClass * ac, int x, int y) 17); if (temp_w > labels_width) labels_width = temp_w; - temp_w = 0; if (ActionGetEvent(aa) == EVENT_DOUBLE_DOWN) { diff --git a/src/zoom.c b/src/zoom.c index beedbced..8ee4c639 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -209,7 +209,7 @@ SetMode(XRRScreenResources * xsr, RRCrtc crtc, RRMode mode, Rotation rot) static void SetPanning(XRRScreenResources * xsr, RRCrtc crtc, int on) { - XRRPanning *xpa = NULL; + XRRPanning *xpa; xpa = XRRGetPanning(disp, xsr, crtc); if (!xpa)