summaryrefslogtreecommitdiff
path: root/src/iconmgr.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2020-06-18 18:34:59 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2020-06-18 18:34:59 -0400
commita9d6701d977700b18e31a70cc7982431bc702095 (patch)
treeeb24677e90094a95c1461243b56e83309a47742b /src/iconmgr.c
parentd2b4f0598086d4dd5caf3cdc218d0f97c37229ac (diff)
fix the cppcheck style- and format-warnings
also bump version to 1.0.11.1, reflecting ongoing work since release Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/iconmgr.c')
-rw-r--r--src/iconmgr.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/iconmgr.c b/src/iconmgr.c
index e59f849..dcf0881 100644
--- a/src/iconmgr.c
+++ b/src/iconmgr.c
@@ -57,7 +57,6 @@ void
CreateIconManagers(void)
{
IconMgr *p;
- int mask;
char str[100];
char str1[100];
Pixel background;
@@ -74,9 +73,9 @@ CreateIconManagers(void)
}
for (p = &Scr->iconmgr; p != NULL; p = p->next) {
- mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
- (unsigned int *) &p->width,
- (unsigned int *) &p->height);
+ int mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
+ (unsigned int *) &p->width,
+ (unsigned int *) &p->height);
if (mask & XNegative)
JunkX = Scr->MyDisplayWidth - p->width -
@@ -129,7 +128,7 @@ AllocateIconManager(char *name, char *icon_name, char *geom, int columns)
#ifdef DEBUG_ICONMGR
fprintf(stderr, "AllocateIconManager\n");
fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
- name, icon_name, geom, columns);
+ name, icon_name ? icon_name : "<null>", geom, columns);
#endif
if (Scr->NoIconManagers)
@@ -290,8 +289,6 @@ JumpIconManager(int dir)
{
IconMgr *ip, *tmp_ip = NULL;
int got_it = FALSE;
- ScreenInfo *sp;
- int screen;
if (!Active)
return;
@@ -309,8 +306,11 @@ JumpIconManager(int dir)
if (!got_it) {
int origscreen = ip->scr->screen;
int inc = (dir == F_NEXTICONMGR ? 1 : -1);
+ int screen;
for (screen = origscreen + inc;; screen += inc) {
+ ScreenInfo *sp;
+
if (screen >= NumScreens)
screen = 0;
else if (screen < 0)
@@ -461,8 +461,8 @@ InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
{
WList *tmp1;
int added;
- int (*compar) (const char *, const char *)
- = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
+ int (*compar)(const char *, const char *)
+ =(Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
added = FALSE;
if (ip->first == NULL) {
@@ -594,8 +594,8 @@ SortIconManager(IconMgr *ip)
{
WList *tmp1, *tmp2;
int done;
- int (*compar) (const char *, const char *)
- = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
+ int (*compar)(const char *, const char *)
+ =(Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
if (ip == NULL)
ip = Active->iconmgr;
@@ -629,7 +629,6 @@ void
PackIconManager(IconMgr *ip)
{
int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth;
- int new_x, new_y;
int savewidth;
WList *tmp;
@@ -645,7 +644,10 @@ PackIconManager(IconMgr *ip)
row = 0;
col = ip->columns;
maxcol = 0;
+
for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next) {
+ int new_x, new_y;
+
tmp->me = i;
if (++col >= ip->columns) {
col = 0;