mirror of
https://github.com/libretro/libretro-tyrquake.git
synced 2025-04-01 10:11:49 +00:00
[PATCH] Mark Host_Error and Host_Endgame with noreturn attribute
Host_Error and Host_Endgame never return, so mark them as such and cleanup a few unnecessary statements previously used to quiet compiler warnings. Signed-off-by: Tyrann <tyrann@disenchant.net>
This commit is contained in:
parent
440d9d3d17
commit
7b6a5da600
@ -45,8 +45,10 @@ void Host_ServerFrame(void);
|
||||
void Host_InitCommands(void);
|
||||
void Host_Init(quakeparms_t *parms);
|
||||
void Host_Shutdown(void);
|
||||
void Host_Error(const char *error, ...) __attribute__((format(printf,1,2)));
|
||||
void Host_EndGame(const char *message, ...) __attribute__((format(printf,1,2)));
|
||||
void Host_Error(const char *error, ...)
|
||||
__attribute__((noreturn, format(printf,1,2)));
|
||||
void Host_EndGame(const char *message, ...)
|
||||
__attribute__((noreturn, format(printf,1,2)));
|
||||
void Host_Frame(float time);
|
||||
void Host_Quit_f(void);
|
||||
void Host_ClientCommands(const char *fmt, ...)
|
||||
|
@ -237,10 +237,8 @@ FlushEntityPacket(void)
|
||||
// read it all, but ignore it
|
||||
while (1) {
|
||||
word = (unsigned short)MSG_ReadShort();
|
||||
if (msg_badread) { // something didn't parse right...
|
||||
if (msg_badread)
|
||||
Host_EndGame("msg_badread in packetentities");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!word)
|
||||
break; // done
|
||||
@ -302,10 +300,8 @@ CL_ParsePacketEntities(qboolean delta)
|
||||
|
||||
while (1) {
|
||||
word = (unsigned short)MSG_ReadShort();
|
||||
if (msg_badread) { // something didn't parse right...
|
||||
if (msg_badread)
|
||||
Host_EndGame("msg_badread in packetentities");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!word) {
|
||||
while (oldindex < oldp->num_entities) { // copy all the rest of the entities from the old packet
|
||||
|
@ -934,7 +934,6 @@ CL_ConnectionlessPacket(void)
|
||||
Con_Printf("disconnect\n");
|
||||
|
||||
Host_EndGame("Server disconnected");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1143,10 +1143,8 @@ CL_ParseServerMessage(void)
|
||||
// parse the message
|
||||
//
|
||||
while (1) {
|
||||
if (msg_badread) {
|
||||
if (msg_badread)
|
||||
Host_EndGame("%s: Bad server message", __func__);
|
||||
break;
|
||||
}
|
||||
|
||||
cmd = MSG_ReadByte();
|
||||
|
||||
|
@ -85,8 +85,10 @@ void Host_ServerFrame(void);
|
||||
void Host_InitCommands(void);
|
||||
void Host_Init(quakeparms_t *parms);
|
||||
void Host_Shutdown(void);
|
||||
void Host_Error(const char *error, ...) __attribute__((format(printf,1,2)));
|
||||
void Host_EndGame(const char *message, ...) __attribute__((format(printf,1,2)));
|
||||
void Host_Error(const char *error, ...)
|
||||
__attribute__((noreturn, format(printf,1,2)));
|
||||
void Host_EndGame(const char *message, ...)
|
||||
__attribute__((noreturn, format(printf,1,2)));
|
||||
qboolean Host_SimulationTime(float time);
|
||||
void Host_Frame(float time);
|
||||
void Host_Quit_f(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user