File fix-gcc15.patch of Package alienarena
commit ab6d5a02bdc74e233e48cc07dd1f7a2a9c6c79ac
Author: Bernhard M. Wiedemann <bernhard+gitcommit lsmod.de>
Date: Mon Dec 8 14:39:07 2025 +0100
Fix compilation with gcc-15
I'm not sure with the typecasts
and the snprintf should be double-checked as well
diff --git a/source/client/cl_updates.c b/source/client/cl_updates.c
index 03f22bb..0970362 100644
--- a/source/client/cl_updates.c
+++ b/source/client/cl_updates.c
@@ -250,14 +250,14 @@ void CL_GetLatestGameVersion( void )
easyhandle = curl_easy_init();
// Set Http version to 1.1, somehow this seems to be needed for the multi-download
- if (curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION, (long) CURL_HTTP_VERSION_1_1) != CURLE_OK) return false;
+ if (curl_easy_setopt(easyhandle, CURLOPT_HTTP_VERSION, (long) CURL_HTTP_VERSION_1_1) != CURLE_OK) return;
// Follow redirects to https - but this doesn't seem to be working
- if (curl_easy_setopt(easyhandle, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) return false;
- if (curl_easy_setopt(easyhandle, CURLOPT_MAXREDIRS, 3L) != CURLE_OK) return false;
+ if (curl_easy_setopt(easyhandle, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK) return;
+ if (curl_easy_setopt(easyhandle, CURLOPT_MAXREDIRS, 3L) != CURLE_OK) return;
// Don't verify that the host matches the certificate
- if (curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 0L) != CURLE_OK) return false;
+ if (curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 0L) != CURLE_OK) return;
Com_sprintf(url, sizeof(url), "%s", cl_latest_game_version_url->string);
diff --git a/source/client/menu.c b/source/client/menu.c
index e0df18b..5b19e96 100755
--- a/source/client/menu.c
+++ b/source/client/menu.c
@@ -4193,7 +4193,7 @@ static void ServerInfo_SubmenuInit (void)
#endif
#if STATS_ENABLED
- char *contents[2*rows+1] = {
+ const char *contents[2*rows+1] = {
"Map:", mservers[serverindex].szMapName,
"Skill:", mservers[serverindex].skill,
"Admin:", mservers[serverindex].szAdmin,
@@ -4204,7 +4204,7 @@ static void ServerInfo_SubmenuInit (void)
"Gameplay:"
};
#else
- char *contents[2*rows+1] = {
+ const char *contents[2*rows+1] = {
"Map:", mservers[serverindex].szMapName,
"Admin:", mservers[serverindex].szAdmin,
"Website:", mservers[serverindex].szWebsite,
@@ -4280,7 +4280,7 @@ static void PlayerList_SubmenuInit (void)
int i, j;
//qboolean is_team_server = false;
- char *local_player_info_ptrs[MAX_PLAYERS*SVDATA_PLAYERINFO];
+ const char *local_player_info_ptrs[MAX_PLAYERS*SVDATA_PLAYERINFO];
size_t sizes[SVDATA_PLAYERINFO]
= {sizeof(menutxt_s), sizeof(menutxt_s), sizeof(menutxt_s), sizeof(menutxt_s)};
@@ -5739,7 +5739,9 @@ static void StartServerActionFunc (UNUSED void *self)
Cvar_ForceSet("dedicated", "0");
#endif
Cvar_Set("sv_maplist", startmap);
- Cbuf_AddText (sprintf("setmaster %s %s\n", DEFAULT_MASTER_1, DEFAULT_MASTER_2));
+ char buf[1000];
+ snprintf(buf, sizeof(buf), "setmaster %s %s\n", DEFAULT_MASTER_1, DEFAULT_MASTER_2);
+ Cbuf_AddText (buf);
}
Cvar_SetValue( "skill", s_skill_box.curvalue );
Cvar_SetValue( "g_antilagprojectiles", s_antilagprojectiles_box.curvalue);
@@ -7147,7 +7149,7 @@ static void Slider_CheckSlide (menuslider_s *s)
s->curvalue = s->minvalue;
//TO DO - this generates a scary warning - incompatible menuslider_s vs menuitem_s * - there are several similar instances in the menu code.
- Menu_ActivateItem (s);
+ Menu_ActivateItem ((menuitem_s *)s);
}
static void Menu_DragSlideItem (void)
diff --git a/source/client/qmenu.c b/source/client/qmenu.c
index d4dab82..6803f1a 100755
--- a/source/client/qmenu.c
+++ b/source/client/qmenu.c
@@ -185,7 +185,7 @@ qboolean Field_Key (int key)
menufield_s *f;
extern int keydown[];
- f = cursor.menuitem;
+ f = (menufield_s *)cursor.menuitem;
if (f == NULL || f->generic.type != MTYPE_FIELD)
return false;
@@ -1001,7 +1001,7 @@ void Menu_AssignCursor (menuframework_s *menu)
if (menu->maxheight != 0 && CHASELINK(menu->height) > menu->maxheight && cursor.x > right)
{
// select the scrollbar
- item = &menu->vertical_scrollbar;
+ item = (menuitem_s *) &menu->vertical_scrollbar;
Cursor_MouseSelectItem (item);
}
else for ( i = 0; i < menu->nitems; i++ )
@@ -1464,7 +1464,7 @@ void Menu_SetStatusBar( menuframework_s *m, const char *string )
void Menu_SlideItem (int dir)
{
- menucommon_s *item = cursor.menuitem;
+ menucommon_s *item = (menucommon_s *)(cursor.menuitem);
if ( item )
{
@@ -1512,7 +1512,7 @@ void Slider_DoSlide( menuslider_s *s, int dir )
else if ( s->curvalue < s->minvalue )
s->curvalue = s->minvalue;
- Menu_ActivateItem (s);
+ Menu_ActivateItem ((menuitem_s *)s);
}
void Slider_Draw (menuslider_s *s, FNT_font_t font)
@@ -1571,7 +1571,7 @@ void SpinControl_DoSlide( menulist_s *s, int dir )
s->curvalue--;
}
- Menu_ActivateItem (s);
+ Menu_ActivateItem ((menuitem_s *)s);
}
void SpinControl_Draw (menulist_s *s, FNT_font_t font)
diff --git a/source/unix/minizip/crypt.h b/source/unix/minizip/crypt.h
index a01d08d..1e9e820 100755
--- a/source/unix/minizip/crypt.h
+++ b/source/unix/minizip/crypt.h
@@ -32,7 +32,7 @@
/***********************************************************************
* Return the next byte in the pseudo-random sequence
*/
-static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
+static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
{
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
* unpredictable manner on 16-bit systems; not a problem
@@ -45,7 +45,7 @@ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
/***********************************************************************
* Update the encryption keys with the next byte of plain text
*/
-static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
+static int update_keys(unsigned long* pkeys,const z_crc_t* pcrc_32_tab,int c)
{
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
@@ -62,7 +62,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
* Initialize the encryption keys and the random header according to
* the given password.
*/
-static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
+static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t* pcrc_32_tab)
{
*(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L;
@@ -91,7 +91,7 @@ static int crypthead(const char* passwd, /* password string */
unsigned char* buf, /* where to write header */
int bufSize,
unsigned long* pkeys,
- const unsigned long* pcrc_32_tab,
+ const z_crc_t* pcrc_32_tab,
unsigned long crcForCrypting)
{
int n; /* index in random header */