fix new compiler warnings from new gcc version

just throw const at everything :blobthumbsup:
This commit is contained in:
Alug committed 2026-02-11 17:47:58 +01:00
1 parent 7bf6779595
commit c976699230
7 files changed
+28 -29

No files matched your search

+1 -1
View File
@@ -2132,7 +2132,7 @@ void D_SRB2Main(void)
if (M_CheckProtoParam("replay"))
{
const char *replayurl = M_GetProtoParam();
char *replayname = strrchr(replayurl, '/');
const char *replayname = strrchr(replayurl, '/');
if (!replayname || !replayurl)
I_Error("REPLAY: Invalid URL.");
+1 -1
View File
@@ -68,7 +68,7 @@ extern "C" {
#define strnicmp(x,y,n) strncasecmp(x,y,n)
#endif
char *nongnu_strcasestr(const char *in, const char *what);
const char *nongnu_strcasestr(const char *in, const char *what);
#ifndef _GNU_SOURCE
#define strcasestr nongnu_strcasestr
#endif
+3 -3
View File
@@ -4161,7 +4161,7 @@ static void measurekeywords(mapsearchfreq_t *fr,
const char *s, const char *q, boolean wanttable)
{
char *qp;
char *sp;
const char *sp;
if (wanttable)
(*dimp) = Z_Realloc((*dimp), 255 * sizeof (struct searchdim),
PU_STATIC, NULL);
@@ -4206,9 +4206,9 @@ INT32 G_FindMap(const char *mapname, char **foundmapnamep,
size_t mapnamelen;
char *realmapname = NULL;
char *newmapname = NULL;
char *newmapname = NULL;
char *apromapname = NULL;
char *aprop = NULL;
const char *aprop = NULL;
mapsearchfreq_t *freq;
boolean wanttable;
+1 -1
View File
@@ -112,7 +112,7 @@ boolean HWR_InitShaders(void)
// returns INT32_MAX if not found
static INT32 strstr_int(const char *str1, const char *str2)
{
char *location = strstr(str1, str2);
const char *location = strstr(str1, str2);
if (location)
return location - str1;
else
+3 -3
View File
@@ -1387,19 +1387,19 @@ void GL_Flush(void)
// -----------------+
INT32 GL_isExtAvailable(const char *extension, const GLubyte *start)
{
GLubyte *where, *terminator;
const GLubyte *where, *terminator;
if (!extension || !start)
return 0;
where = (GLubyte *) strchr(extension, ' ');
where = (const GLubyte *)strchr(extension, ' ');
if (where || *extension == '\0')
return 0;
for (;;)
{
where = (GLubyte *) strstr((const char *) start, extension);
where = (const GLubyte *)strstr((const char *) start, extension);
if (!where)
break;
+1 -1
View File
@@ -1454,7 +1454,7 @@ INT32 axtoi(const char *hexStg)
void CopyCaretColors(char *p, const char *s, int n)
{
char *t;
const char *t;
int m;
int c;
+18 -19
View File
@@ -28,10 +28,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stddef.h>
static inline int
trycmp (char **pp, char *cp,
trycmp (const char **pp, const char *cp,
const char *q, size_t qn)
{
char *p;
const char *p;
p = (*pp);
if (strncasecmp(p, q, qn) == 0)
return 0;
@@ -40,10 +40,10 @@ trycmp (char **pp, char *cp,
}
static inline void
swapp (char ***ppap, char ***ppbp, char **cpap, char **cpbp)
swapp (const char ***ppap, const char ***ppbp, const char **cpap, const char **cpbp)
{
char **pp;
char *p;
const char **pp;
const char *p;
pp = *ppap;
*ppap = *ppbp;
@@ -54,28 +54,27 @@ swapp (char ***ppap, char ***ppbp, char **cpap, char **cpbp)
*cpbp = p;
}
char *
nongnu_strcasestr (const char *s, const char *q)
const char *nongnu_strcasestr(const char *in, const char *what)
{
size_t qn;
char uc;
char lc;
char *up;
char *lp;
const char *up;
const char *lp;
char **ppa;
char **ppb;
const char **ppa;
const char **ppb;
char *cpa;
char *cpb;
const char *cpa;
const char *cpb;
uc = toupper(*q);
lc = tolower(*q);
uc = toupper(*what);
lc = tolower(*what);
up = strchr(s, uc);
lp = strchr(s, lc);
up = strchr(in, uc);
lp = strchr(in, lc);
if (up == NULL && lp == NULL)
return NULL;
@@ -97,11 +96,11 @@ nongnu_strcasestr (const char *s, const char *q)
cpb = &uc;
}
qn = strlen(q);
qn = strlen(what);
for (;;)
{
if (trycmp(ppa, cpa, q, qn) == 0)
if (trycmp(ppa, cpa, what, qn) == 0)
return (*ppa);
if (up == NULL && lp == NULL)