File kajaani-kombat-gcc11.patch of Package kajaani-kombat
These SDL_* return NULL on error, and gcc11/clang won't allow this.
https://bugs.gentoo.org/739086
Index: kajaani-kombat-0.7/client_net.cpp
===================================================================
--- kajaani-kombat-0.7.orig/client_net.cpp
+++ kajaani-kombat-0.7/client_net.cpp
@@ -31,13 +31,13 @@ client_tcpnet::client_tcpnet(IPaddress *
assert (ret != -1);
cond = SDL_CreateCond();
- if (cond <0)
+ if (!cond)
{
fprintf (stderr, "Error creating cond variable\n");
exit(2);
}
mutex = SDL_CreateMutex();
- if (mutex < 0)
+ if (!mutex)
{
fprintf (stderr, "Error creating mutex\n");
exit(2);
@@ -45,13 +45,13 @@ client_tcpnet::client_tcpnet(IPaddress *
active = true;
trans_th = SDL_CreateThread (&client_tcpnet::transf_func, (void *) this);
- if (trans_th < 0)
+ if (!trans_th)
{
fprintf(stderr, "Error starting thread: %s\n", SDL_GetError());
exit(2);
}
input_th = SDL_CreateThread (&client_tcpnet::input_func, (void *) this);
- if (input_th < 0)
+ if (!input_th)
{
fprintf(stderr, "Error starting thread: %s\n", SDL_GetError());
exit(2);
Index: kajaani-kombat-0.7/game_server.cpp
===================================================================
--- kajaani-kombat-0.7.orig/game_server.cpp
+++ kajaani-kombat-0.7/game_server.cpp
@@ -64,7 +64,7 @@ void game_server::init_net()
// OK, init server thread to listen to clients
con_th = SDL_CreateThread (&game_server::connection_accepter, (void *) this);
- if (con_th < 0)
+ if (!con_th)
{
fprintf (stderr, "[SRV] Error starting thread: %s\n", SDL_GetError());
exit(2);