Skip to content

Commit

Permalink
Server: Fix compiler warnings/errors w/ GCC 13-14
Browse files Browse the repository at this point in the history
Closes #415
  • Loading branch information
dcommander committed Jun 28, 2024
1 parent 0c1edfa commit 2be5bce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions unix/Xvnc/extras/Mesa/src/util/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <errno.h>
#include <string.h>
#include "debug.h"
#include <stdlib.h>
#if 0 /* TURBOVNC */
#include "u_string.h"
#endif /* TURBOVNC */
Expand Down
7 changes: 4 additions & 3 deletions unix/Xvnc/extras/Mesa/turbovnc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ index 10d4faf..cbce7d9 100644
#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
diff --git a/mesa-20.3.5/src/util/debug.c b/Mesa/src/util/debug.c
index 89ae613..ebe9060 100644
index 89ae613..de919e9 100644
--- a/mesa-20.3.5/src/util/debug.c
+++ b/Mesa/src/util/debug.c
@@ -24,8 +24,11 @@
@@ -24,8 +24,12 @@
#include <errno.h>
#include <string.h>
#include "debug.h"
+#include <stdlib.h>
+#if 0 /* TURBOVNC */
#include "u_string.h"
+#endif /* TURBOVNC */
Expand All @@ -80,7 +81,7 @@ index 89ae613..ebe9060 100644
uint64_t
parse_debug_string(const char *debug,
const struct debug_control *control)
@@ -66,6 +69,7 @@ comma_separated_list_contains(const char *list, const char *s)
@@ -66,6 +70,7 @@ comma_separated_list_contains(const char *list, const char *s)

return false;
}
Expand Down
10 changes: 5 additions & 5 deletions unix/Xvnc/programs/Xserver/hw/vnc/kbdptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
*/

/* Copyright (C) 2014-2016, 2019, 2021-2022 D. R. Commander.
* All Rights Reserved.
/* Copyright (C) 2014-2016, 2019, 2021-2022, 2024 D. R. Commander.
* All Rights Reserved.
* Copyright (C) 2013, 2017-2018 Pierre Ossman for Cendio AB.
* All Rights Reserved.
* Copyright (C) 2009 Red Hat, Inc. All Rights Reserved.
Expand Down Expand Up @@ -548,13 +548,13 @@ void PtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
}


char *stristr(const char *s1, const char *s2)
Bool stristr(const char *s1, const char *s2)
{
char *str1, *str2, *ret;
int i;

if (!s1 || !s2 || strlen(s1) < 1 || strlen(s2) < 1)
return NULL;
return FALSE;

str1 = strdup(s1);
for (i = 0; i < strlen(str1); i++)
Expand All @@ -565,7 +565,7 @@ char *stristr(const char *s1, const char *s2)

ret = strstr(str1, str2);
free(str1); free(str2);
return ret;
return ret != NULL;
}


Expand Down
4 changes: 2 additions & 2 deletions unix/Xvnc/programs/Xserver/hw/vnc/rfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* rfb.h - header file for RFB DDX implementation.
*/

/* Copyright (C) 2010-2022 D. R. Commander. All Rights Reserved.
/* Copyright (C) 2010-2022, 2024 D. R. Commander. All Rights Reserved.
* Copyright (C) 2011, 2015 Pierre Ossman for Cendio AB. All Rights Reserved.
* Copyright (C) 2011 Joel Martin
* Copyright (C) 2011 Gernot Tenchio
Expand Down Expand Up @@ -897,7 +897,7 @@ extern void KeyEvent(KeySym keySym, Bool down);
extern void KbdReleaseAllKeys(void);
extern void QEMUExtKeyboardEventInit(void);

extern char *stristr(const char *s1, const char *s2);
extern Bool stristr(const char *s1, const char *s2);


/* nvctrlext.c */
Expand Down

0 comments on commit 2be5bce

Please sign in to comment.