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) 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -256,7 +256,7 @@ Estrdup(const char *s)
return NULL; return NULL;
sz = strlen(s); sz = strlen(s);
ss = EMALLOC(char, sz + 1); ss = EMALLOC(char, sz + 1);
strncpy(ss, s, sz + 1); memcpy(ss, s, sz + 1);
return ss; 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -440,10 +440,10 @@ gaussian(float r, float x, float y)
} }
static conv * static conv *
make_gaussian_map(float r) make_gaussian_map(int r)
{ {
conv *c; conv *c;
int size = ((int)ceilf((r * 3)) + 1) & ~1; int size = (r * 3 + 1) & ~1;
int center = size / 2; int center = size / 2;
int x, y; int x, y;
float t, g; float t, g;
@ -737,8 +737,7 @@ ECompMgrWinSetExtents(EObj * eo)
if (!gaussianMap) if (!gaussianMap)
{ {
gaussianMap = gaussianMap = make_gaussian_map(Conf_compmgr.shadows.blur.radius);
make_gaussian_map((float)Conf_compmgr.shadows.blur.radius);
if (!gaussianMap) if (!gaussianMap)
goto skip_shadow; 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -353,7 +353,7 @@ EGlTextureFromImage(EImage * im, int mode)
glBindTexture(et->target, et->texture); glBindTexture(et->target, et->texture);
EImageGetSize(im, &w, &h); EImageGetSize(im, &w, &h);
data = EImageGetData(im); data = (unsigned char *)EImageGetData(im);
switch (mode) 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -770,6 +770,8 @@ static const CfgItem GlwinCfgItems[] = {
/* /*
* Module descriptor * Module descriptor
*/ */
extern const EModule ModGlwin;
const EModule ModGlwin = { const EModule ModGlwin = {
"glwin", NULL, "glwin", NULL,
GlwinSighan, GlwinSighan,

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors * 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -83,7 +83,7 @@ Estrdup(const char *s)
return NULL; return NULL;
sz = strlen(s); sz = strlen(s);
ss = EMALLOC(char, sz + 1); ss = EMALLOC(char, sz + 1);
strncpy(ss, s, sz + 1); memcpy(ss, s, sz + 1);
return ss; return ss;
#endif #endif
} }

View File

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors * 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -128,7 +128,7 @@ ThemePathName(const char *path)
static void static void
_append_merge_dir(char *dir, char ***list, int *count) _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; char **str, *s;
int i, num; int i, num;
@ -213,7 +213,7 @@ ThemesList(int *number)
static char * static char *
_ThemeExtract(const char *path) _ThemeExtract(const char *path)
{ {
char th[2048]; char th[4000];
FILE *f; FILE *f;
unsigned char buf[262]; unsigned char buf[262];
size_t ret; size_t ret;
@ -274,7 +274,7 @@ ThemePathFind(const char *theme)
static const char *const default_themes[] = { static const char *const default_themes[] = {
"DEFAULT", "winter", "BrushedMetal-Tigert", "ShinyMetal", NULL "DEFAULT", "winter", "BrushedMetal-Tigert", "ShinyMetal", NULL
}; };
char tpbuf[FILEPATH_LEN_MAX], *path; char tpbuf[4000], *path;
char **lst; char **lst;
int i, j, num; int i, j, num;
@ -339,7 +339,7 @@ ThemePathFind(const char *theme)
void void
ThemeFind(const char *theme) ThemeFind(const char *theme)
{ {
char name[2048]; char name[4000];
char namx[FILEPATH_LEN_MAX]; char namx[FILEPATH_LEN_MAX];
const char *p; const char *p;
char *path, *s; 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 * Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to * of this software and associated documentation files (the "Software"), to
@ -22,9 +22,8 @@
*/ */
#include "config.h" #include "config.h"
#if USE_MONOTONIC_CLOCK
#include <time.h> #include <time.h>
#else #if !USE_MONOTONIC_CLOCK
#include <sys/time.h> #include <sys/time.h>
#endif #endif