Skip to content

Commit

Permalink
clang: fix compiler warnings
Browse files Browse the repository at this point in the history
This keeps clang happy by fixing some of its suggestions.
  • Loading branch information
ThomasAdam committed Apr 11, 2024
1 parent 49fefa4 commit 8aac73d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions fvwm/style.c
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,7 @@ static int style_set_border_colorset(window_style *ps, char *rest, int type)
this_many = BP_SIZE;
}

if (this_many < 2 && this_many > 8)
if (this_many < 2 || this_many > 8)
return 1;

for (upto = 0; upto < this_many; upto++) {
Expand Down Expand Up @@ -5454,4 +5454,4 @@ void CMD_DestroyWindowStyle(F_CMD_ARGS)
/* Do it */
style_destroy_style(s_id);
return;
}
}
2 changes: 1 addition & 1 deletion libs/System.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ int fvwm_mkstemp (char *template)
gettimeofday (&tv, NULL);
value = ((unsigned long) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();

for (count = 0; count < TMP_MAX; value = 7777, count)
for (count = 0; count < TMP_MAX; value = 7777)
{
unsigned long v = value;

Expand Down
7 changes: 4 additions & 3 deletions modules/FvwmIconMan/FvwmIconMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <assert.h>
#include <stdio.h>
#include <stdbool.h>

#include "libs/ftime.h"

Expand Down Expand Up @@ -190,8 +191,8 @@ typedef struct win_data {
window_flags flags;
struct win_data *win_prev, *win_next;
struct win_manager *manager;
int app_id_set : 1;
int geometry_set : 1;
bool app_id_set;
bool geometry_set;
Uchar complete;

/* this data must be freed */
Expand Down Expand Up @@ -413,4 +414,4 @@ extern WinManager *find_windows_manager (Window win);
extern int win_in_viewport (WinData *win);
extern WinData *id_to_win(Ulong id);

#endif /* IN_FVWMICONMAN_H */
#endif /* IN_FVWMICONMAN_H */
4 changes: 2 additions & 2 deletions modules/FvwmScript/FvwmScript.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void Xinit(int IsFather)

if (IsFather)
{
size_t len = strlen("FvwmScript") + 5;
size_t len = strlen("FvwmScript") + 10;
name = fxcalloc(sizeof(char), len);
do
{
Expand Down Expand Up @@ -1476,4 +1476,4 @@ int main (int argc, char **argv)

MainLoop();
return 0;
}
}

0 comments on commit 8aac73d

Please sign in to comment.