Fix warnings occurring in various situations

This commit is contained in:
Kim Woelders 2020-01-13 19:22:06 +01:00
parent c40e0e4787
commit 8f1bfc4f53
7 changed files with 20 additions and 20 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2007 Kim Woelders
* Copyright (C) 2004-2020 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
@ -256,7 +256,7 @@ Estrdup(const char *s)
return NULL;
sz = strlen(s);
ss = EMALLOC(char, sz + 1);
strncpy(ss, s, sz + 1);
memcpy(ss, s, sz + 1);
return ss;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2018 Kim Woelders
* Copyright (C) 2004-2020 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
@ -440,10 +440,10 @@ gaussian(float r, float x, float y)
}
static conv *
make_gaussian_map(float r)
make_gaussian_map(int r)
{
conv *c;
int size = ((int)ceilf((r * 3)) + 1) & ~1;
int size = (r * 3 + 1) & ~1;
int center = size / 2;
int x, y;
float t, g;
@ -737,8 +737,7 @@ ECompMgrWinSetExtents(EObj * eo)
if (!gaussianMap)
{
gaussianMap =
make_gaussian_map((float)Conf_compmgr.shadows.blur.radius);
gaussianMap = make_gaussian_map(Conf_compmgr.shadows.blur.radius);
if (!gaussianMap)
goto skip_shadow;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2018 Kim Woelders
* Copyright (C) 2007-2020 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
@ -353,7 +353,7 @@ EGlTextureFromImage(EImage * im, int mode)
glBindTexture(et->target, et->texture);
EImageGetSize(im, &w, &h);
data = EImageGetData(im);
data = (unsigned char *)EImageGetData(im);
switch (mode)
{

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2007-2019 Kim Woelders
* Copyright (C) 2007-2020 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
@ -770,6 +770,8 @@ static const CfgItem GlwinCfgItems[] = {
/*
* Module descriptor
*/
extern const EModule ModGlwin;
const EModule ModGlwin = {
"glwin", NULL,
GlwinSighan,

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2005-2018 Kim Woelders
* Copyright (C) 2005-2020 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
@ -83,7 +83,7 @@ Estrdup(const char *s)
return NULL;
sz = strlen(s);
ss = EMALLOC(char, sz + 1);
strncpy(ss, s, sz + 1);
memcpy(ss, s, sz + 1);
return ss;
#endif
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2019 Kim Woelders
* Copyright (C) 2004-2020 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
@ -128,7 +128,7 @@ ThemePathName(const char *path)
static void
_append_merge_dir(char *dir, char ***list, int *count)
{
char ss[2048], s1[FILEPATH_LEN_MAX];
char ss[4000], s1[FILEPATH_LEN_MAX];
char **str, *s;
int i, num;
@ -213,7 +213,7 @@ ThemesList(int *number)
static char *
_ThemeExtract(const char *path)
{
char th[2048];
char th[4000];
FILE *f;
unsigned char buf[262];
size_t ret;
@ -274,7 +274,7 @@ ThemePathFind(const char *theme)
static const char *const default_themes[] = {
"DEFAULT", "winter", "BrushedMetal-Tigert", "ShinyMetal", NULL
};
char tpbuf[FILEPATH_LEN_MAX], *path;
char tpbuf[4000], *path;
char **lst;
int i, j, num;
@ -339,7 +339,7 @@ ThemePathFind(const char *theme)
void
ThemeFind(const char *theme)
{
char name[2048];
char name[4000];
char namx[FILEPATH_LEN_MAX];
const char *p;
char *path, *s;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2015 Kim Woelders
* Copyright (C) 2011-2020 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
@ -22,9 +22,8 @@
*/
#include "config.h"
#if USE_MONOTONIC_CLOCK
#include <time.h>
#else
#if !USE_MONOTONIC_CLOCK
#include <sys/time.h>
#endif