fix naming inconsistency with gotos

master
an 2019-12-07 11:26:29 -05:00
parent c5a4c2424a
commit 96b1ebca95
15 changed files with 74 additions and 74 deletions

View File

@ -1767,7 +1767,7 @@ static void COM_AddGameDirectory(const char *base, const char *dir)
path_id = com_searchpaths->path_id << 1; path_id = com_searchpaths->path_id << 1;
else path_id = 1U; else path_id = 1U;
_add_path: addpath:
// add the directory to the search path // add the directory to the search path
search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t)); search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
search->path_id = path_id; search->path_id = path_id;
@ -1796,7 +1796,7 @@ _add_path:
been_here = true; been_here = true;
q_strlcpy(com_gamedir, va("%s/%s", host_parms->userdir, dir), sizeof(com_gamedir)); q_strlcpy(com_gamedir, va("%s/%s", host_parms->userdir, dir), sizeof(com_gamedir));
Sys_mkdir(com_gamedir); Sys_mkdir(com_gamedir);
goto _add_path; goto addpath;
} }
} }
@ -1841,16 +1841,16 @@ static void COM_Game_f(void)
// rely on QuakeSpasm extension treating '-game missionpack' // rely on QuakeSpasm extension treating '-game missionpack'
// as '-missionpack', otherwise would be a mess // as '-missionpack', otherwise would be a mess
if(!q_strcasecmp(p, &p2[1])) if(!q_strcasecmp(p, &p2[1]))
goto _same; goto same;
Con_Printf("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]); Con_Printf("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]);
} }
else if(!*p2 && com_searchpaths->path_id > 2) else if(!*p2 && com_searchpaths->path_id > 2)
Con_Printf("reloading game \"%s\" without mission pack support\n", p); Con_Printf("reloading game \"%s\" without mission pack support\n", p);
else goto _same; else goto same;
} }
else else
{ {
_same: same:
Con_Printf("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir)); Con_Printf("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
return; return;
} }

View File

@ -797,7 +797,7 @@ void Mod_LoadEntities(lump_t *l)
uint32_t path_id; uint32_t path_id;
if(! external_ents.value) if(! external_ents.value)
goto _load_embedded; goto loadembedded;
q_strlcpy(entfilename, loadmodel->name, sizeof(entfilename)); q_strlcpy(entfilename, loadmodel->name, sizeof(entfilename));
COM_StripExtension(entfilename, entfilename, sizeof(entfilename)); COM_StripExtension(entfilename, entfilename, sizeof(entfilename));
@ -822,7 +822,7 @@ void Mod_LoadEntities(lump_t *l)
} }
} }
_load_embedded: loadembedded:
if(!l->filelen) if(!l->filelen)
{ {
loadmodel->entities = NULL; loadmodel->entities = NULL;

View File

@ -303,7 +303,7 @@ byte *Image_LoadTGA(FILE *fin, int32_t *width, int32_t *height)
if(row > 0) if(row > 0)
row--; row--;
else else
goto breakOut; goto breakout;
//johnfitz -- fix for upside-down targas //johnfitz -- fix for upside-down targas
realrow = upside_down ? row : rows - 1 - row; realrow = upside_down ? row : rows - 1 - row;
pixbuf = targa_rgba + realrow * columns * 4; pixbuf = targa_rgba + realrow * columns * 4;
@ -346,7 +346,7 @@ byte *Image_LoadTGA(FILE *fin, int32_t *width, int32_t *height)
if(row > 0) if(row > 0)
row--; row--;
else else
goto breakOut; goto breakout;
//johnfitz -- fix for upside-down targas //johnfitz -- fix for upside-down targas
realrow = upside_down ? row : rows - 1 - row; realrow = upside_down ? row : rows - 1 - row;
pixbuf = targa_rgba + realrow * columns * 4; pixbuf = targa_rgba + realrow * columns * 4;
@ -355,7 +355,7 @@ byte *Image_LoadTGA(FILE *fin, int32_t *width, int32_t *height)
} }
} }
} }
breakOut: breakout:
; ;
} }
} }

View File

@ -607,7 +607,7 @@ static void Test_f(void)
} }
} }
if(n < hostCacheCount) if(n < hostCacheCount)
goto JustDoIt; goto justdoit;
} }
for(net_landriverlevel = 0; net_landriverlevel < net_numlandrivers; net_landriverlevel++) for(net_landriverlevel = 0; net_landriverlevel < net_numlandrivers; net_landriverlevel++)
@ -626,7 +626,7 @@ static void Test_f(void)
return; return;
} }
JustDoIt: justdoit:
testSocket = dfunc.Open_Socket(0); testSocket = dfunc.Open_Socket(0);
if(testSocket == INVALID_SOCKET) if(testSocket == INVALID_SOCKET)
return; return;
@ -672,7 +672,7 @@ static void Test2_Poll(void *unused)
len = dfunc.Read(test2Socket, net_message.data, net_message.maxsize, &clientaddr); len = dfunc.Read(test2Socket, net_message.data, net_message.maxsize, &clientaddr);
if(len < (int32_t) sizeof(int32_t)) if(len < (int32_t) sizeof(int32_t))
goto Reschedule; goto reschedule;
net_message.cursize = len; net_message.cursize = len;
@ -680,18 +680,18 @@ static void Test2_Poll(void *unused)
control = BigLong(*((int32_t *)net_message.data)); control = BigLong(*((int32_t *)net_message.data));
MSG_ReadLong(); MSG_ReadLong();
if(control == -1) if(control == -1)
goto Error; goto error;
if((control & (~NETFLAG_LENGTH_MASK)) != (int32_t)NETFLAG_CTL) if((control & (~NETFLAG_LENGTH_MASK)) != (int32_t)NETFLAG_CTL)
goto Error; goto error;
if((control & NETFLAG_LENGTH_MASK) != len) if((control & NETFLAG_LENGTH_MASK) != len)
goto Error; goto error;
if(MSG_ReadByte() != CCREP_RULE_INFO) if(MSG_ReadByte() != CCREP_RULE_INFO)
goto Error; goto error;
Q_strcpy(name, MSG_ReadString()); Q_strcpy(name, MSG_ReadString());
if(name[0] == 0) if(name[0] == 0)
goto Done; goto done;
Q_strcpy(value, MSG_ReadString()); Q_strcpy(value, MSG_ReadString());
Con_Printf("%-16.16s %-16.16s\n", name, value); Con_Printf("%-16.16s %-16.16s\n", name, value);
@ -705,13 +705,13 @@ static void Test2_Poll(void *unused)
dfunc.Write(test2Socket, net_message.data, net_message.cursize, &clientaddr); dfunc.Write(test2Socket, net_message.data, net_message.cursize, &clientaddr);
SZ_Clear(&net_message); SZ_Clear(&net_message);
Reschedule: reschedule:
SchedulePollProcedure(&test2PollProcedure, 0.05); SchedulePollProcedure(&test2PollProcedure, 0.05);
return; return;
Error: error:
Con_Printf("Unexpected repsonse to Rule Info request\n"); Con_Printf("Unexpected repsonse to Rule Info request\n");
Done: done:
dfunc.Close_Socket(test2Socket); dfunc.Close_Socket(test2Socket);
test2InProgress = false; test2InProgress = false;
return; return;
@ -743,7 +743,7 @@ static void Test2_f(void)
} }
if(n < hostCacheCount) if(n < hostCacheCount)
goto JustDoIt; goto justdoit;
} }
for(net_landriverlevel = 0; net_landriverlevel < net_numlandrivers; net_landriverlevel++) for(net_landriverlevel = 0; net_landriverlevel < net_numlandrivers; net_landriverlevel++)
@ -762,7 +762,7 @@ static void Test2_f(void)
return; return;
} }
JustDoIt: justdoit:
test2Socket = dfunc.Open_Socket(0); test2Socket = dfunc.Open_Socket(0);
if(test2Socket == INVALID_SOCKET) if(test2Socket == INVALID_SOCKET)
return; return;
@ -1259,13 +1259,13 @@ static qsocket_t *_Datagram_Connect(const char *host)
sock = NET_NewQSocket(); sock = NET_NewQSocket();
if(sock == NULL) if(sock == NULL)
goto ErrorReturn2; goto error2;
sock->socket = newsock; sock->socket = newsock;
sock->landriver = net_landriverlevel; sock->landriver = net_landriverlevel;
// connect to the host // connect to the host
if(dfunc.Connect(newsock, &sendaddr) == -1) if(dfunc.Connect(newsock, &sendaddr) == -1)
goto ErrorReturn; goto error;
// send the connection request // send the connection request
Con_Printf("trying...\n"); Con_Printf("trying...\n");
@ -1343,15 +1343,15 @@ static qsocket_t *_Datagram_Connect(const char *host)
reason = "No Response"; reason = "No Response";
Con_Printf("%s\n", reason); Con_Printf("%s\n", reason);
Q_strcpy(m_return_reason, reason); Q_strcpy(m_return_reason, reason);
goto ErrorReturn; goto error;
} }
if(ret == -1) if(ret == -1)
{ {
reason = "Network Error"; reason = "Network error";
Con_Printf("%s\n", reason); Con_Printf("%s\n", reason);
Q_strcpy(m_return_reason, reason); Q_strcpy(m_return_reason, reason);
goto ErrorReturn; goto error;
} }
ret = MSG_ReadByte(); ret = MSG_ReadByte();
@ -1360,7 +1360,7 @@ static qsocket_t *_Datagram_Connect(const char *host)
reason = MSG_ReadString(); reason = MSG_ReadString();
Con_Printf("%s\n", reason); Con_Printf("%s\n", reason);
q_strlcpy(m_return_reason, reason, sizeof(m_return_reason)); q_strlcpy(m_return_reason, reason, sizeof(m_return_reason));
goto ErrorReturn; goto error;
} }
if(ret == CCREP_ACCEPT) if(ret == CCREP_ACCEPT)
@ -1373,7 +1373,7 @@ static qsocket_t *_Datagram_Connect(const char *host)
reason = "Bad Response"; reason = "Bad Response";
Con_Printf("%s\n", reason); Con_Printf("%s\n", reason);
Q_strcpy(m_return_reason, reason); Q_strcpy(m_return_reason, reason);
goto ErrorReturn; goto error;
} }
dfunc.GetNameFromAddr(&sendaddr, sock->address); dfunc.GetNameFromAddr(&sendaddr, sock->address);
@ -1387,15 +1387,15 @@ static qsocket_t *_Datagram_Connect(const char *host)
reason = "Connect to Game failed"; reason = "Connect to Game failed";
Con_Printf("%s\n", reason); Con_Printf("%s\n", reason);
Q_strcpy(m_return_reason, reason); Q_strcpy(m_return_reason, reason);
goto ErrorReturn; goto error;
} }
m_return_onerror = false; m_return_onerror = false;
return sock; return sock;
ErrorReturn: error:
NET_FreeQSocket(sock); NET_FreeQSocket(sock);
ErrorReturn2: error2:
dfunc.Close_Socket(newsock); dfunc.Close_Socket(newsock);
if(m_return_onerror) if(m_return_onerror)
{ {

View File

@ -429,7 +429,7 @@ qsocket_t *NET_Connect(const char *host)
if(q_strcasecmp(host, "local") == 0) if(q_strcasecmp(host, "local") == 0)
{ {
numdrivers = 1; numdrivers = 1;
goto JustDoIt; goto justdoit;
} }
if(hostCacheCount) if(hostCacheCount)
@ -441,7 +441,7 @@ qsocket_t *NET_Connect(const char *host)
break; break;
} }
if(n < hostCacheCount) if(n < hostCacheCount)
goto JustDoIt; goto justdoit;
} }
} }
@ -471,7 +471,7 @@ qsocket_t *NET_Connect(const char *host)
} }
} }
JustDoIt: justdoit:
for(net_driverlevel = 0; net_driverlevel < numdrivers; net_driverlevel++) for(net_driverlevel = 0; net_driverlevel < numdrivers; net_driverlevel++)
{ {
if(net_drivers[net_driverlevel].initialized == false) if(net_drivers[net_driverlevel].initialized == false)

View File

@ -256,7 +256,7 @@ eval_t *GetEdictFieldValue(edict_t *ed, const char *field)
if(!strcmp(field, gefvCache[i].field)) if(!strcmp(field, gefvCache[i].field))
{ {
def = gefvCache[i].pcache; def = gefvCache[i].pcache;
goto Done; goto done;
} }
} }
@ -269,7 +269,7 @@ eval_t *GetEdictFieldValue(edict_t *ed, const char *field)
rep ^= 1; rep ^= 1;
} }
Done: done:
if(!def) if(!def)
return NULL; return NULL;

View File

@ -255,7 +255,7 @@ static bool S_FLAC_CodecOpenStream(snd_stream_t *stream)
if(ff->decoder == NULL) if(ff->decoder == NULL)
{ {
Con_Printf("Unable to create fLaC decoder\n"); Con_Printf("Unable to create fLaC decoder\n");
goto _fail; goto fail;
} }
stream->priv = ff; stream->priv = ff;
@ -289,7 +289,7 @@ static bool S_FLAC_CodecOpenStream(snd_stream_t *stream)
if(rc != FLAC__STREAM_DECODER_INIT_STATUS_OK) /* unlikely */ if(rc != FLAC__STREAM_DECODER_INIT_STATUS_OK) /* unlikely */
{ {
Con_Printf("FLAC: decoder init error %" PRIi32 "\n", rc); Con_Printf("FLAC: decoder init error %" PRIi32 "\n", rc);
goto _fail; goto fail;
} }
rc = FLAC__stream_decoder_process_until_end_of_metadata(ff->decoder); rc = FLAC__stream_decoder_process_until_end_of_metadata(ff->decoder);
@ -298,29 +298,29 @@ static bool S_FLAC_CodecOpenStream(snd_stream_t *stream)
rc = FLAC__stream_decoder_get_state(ff->decoder); rc = FLAC__stream_decoder_get_state(ff->decoder);
Con_Printf("%s not a valid flac file? (decoder state %" PRIi32 ")\n", Con_Printf("%s not a valid flac file? (decoder state %" PRIi32 ")\n",
stream->name, rc); stream->name, rc);
goto _fail; goto fail;
} }
if(ff->info->dataofs < 0) if(ff->info->dataofs < 0)
{ {
Con_Printf("%s has no STREAMINFO\n", stream->name); Con_Printf("%s has no STREAMINFO\n", stream->name);
goto _fail; goto fail;
} }
if(ff->info->bits != 8 && ff->info->bits != 16) if(ff->info->bits != 8 && ff->info->bits != 16)
{ {
Con_Printf("%s is not 8 or 16 bit\n", stream->name); Con_Printf("%s is not 8 or 16 bit\n", stream->name);
goto _fail; goto fail;
} }
if(ff->info->channels != 1 && ff->info->channels != 2) if(ff->info->channels != 1 && ff->info->channels != 2)
{ {
Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
ff->info->channels, stream->name); ff->info->channels, stream->name);
goto _fail; goto fail;
} }
return true; return true;
_fail: fail:
if(ff->decoder) if(ff->decoder)
{ {
FLAC__stream_decoder_finish(ff->decoder); FLAC__stream_decoder_finish(ff->decoder);

View File

@ -98,7 +98,7 @@ static bool S_MP3_CodecOpenStream(snd_stream_t *stream)
if(priv->handle == NULL) if(priv->handle == NULL)
{ {
Con_Printf("Unable to allocate mpg123 handle\n"); Con_Printf("Unable to allocate mpg123 handle\n");
goto _fail; goto fail;
} }
priv->handle_newed = 1; priv->handle_newed = 1;
@ -106,14 +106,14 @@ static bool S_MP3_CodecOpenStream(snd_stream_t *stream)
mpg123_open_handle(priv->handle, &stream->fh) != MPG123_OK) mpg123_open_handle(priv->handle, &stream->fh) != MPG123_OK)
{ {
Con_Printf("Unable to open mpg123 handle\n"); Con_Printf("Unable to open mpg123 handle\n");
goto _fail; goto fail;
} }
priv->handle_opened = 1; priv->handle_opened = 1;
if(mpg123_getformat(priv->handle, &rate, &channels, &encoding) != MPG123_OK) if(mpg123_getformat(priv->handle, &rate, &channels, &encoding) != MPG123_OK)
{ {
Con_Printf("Unable to retrieve mpg123 format for %s\n", stream->name); Con_Printf("Unable to retrieve mpg123 format for %s\n", stream->name);
goto _fail; goto fail;
} }
switch(channels) switch(channels)
@ -126,7 +126,7 @@ static bool S_MP3_CodecOpenStream(snd_stream_t *stream)
break; break;
default: default:
Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", channels, stream->name); Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", channels, stream->name);
goto _fail; goto fail;
} }
stream->info.rate = rate; stream->info.rate = rate;
@ -158,13 +158,13 @@ static bool S_MP3_CodecOpenStream(snd_stream_t *stream)
if(mpg123_format_support(priv->handle, rate, encoding) == 0) if(mpg123_format_support(priv->handle, rate, encoding) == 0)
{ {
Con_Printf("Unsupported format for %s\n", stream->name); Con_Printf("Unsupported format for %s\n", stream->name);
goto _fail; goto fail;
} }
mpg123_format_none(priv->handle); mpg123_format_none(priv->handle);
mpg123_format(priv->handle, rate, channels, encoding); mpg123_format(priv->handle, rate, channels, encoding);
return true; return true;
_fail: fail:
if(priv) if(priv)
{ {
if(priv->handle_opened) if(priv->handle_opened)

View File

@ -94,7 +94,7 @@ static bool S_OPUS_CodecOpenStream(snd_stream_t *stream)
{ {
Con_Printf("%s is not a valid Opus file (error %" PRIi32 ").\n", Con_Printf("%s is not a valid Opus file (error %" PRIi32 ").\n",
stream->name, res); stream->name, res);
goto _fail; goto fail;
} }
stream->priv = opFile; stream->priv = opFile;
@ -102,14 +102,14 @@ static bool S_OPUS_CodecOpenStream(snd_stream_t *stream)
if(!op_seekable(opFile)) if(!op_seekable(opFile))
{ {
Con_Printf("Opus stream %s not seekable.\n", stream->name); Con_Printf("Opus stream %s not seekable.\n", stream->name);
goto _fail; goto fail;
} }
op_info = op_head(opFile, -1); op_info = op_head(opFile, -1);
if(!op_info) if(!op_info)
{ {
Con_Printf("Unable to get stream information for %s.\n", stream->name); Con_Printf("Unable to get stream information for %s.\n", stream->name);
goto _fail; goto fail;
} }
/* FIXME: handle section changes */ /* FIXME: handle section changes */
@ -118,14 +118,14 @@ static bool S_OPUS_CodecOpenStream(snd_stream_t *stream)
{ {
Con_Printf("More than one (%" PRIi64 ") stream in %s\n", Con_Printf("More than one (%" PRIi64 ") stream in %s\n",
(long)op_info->stream_count, stream->name); (long)op_info->stream_count, stream->name);
goto _fail; goto fail;
} }
if(op_info->channel_count != 1 && op_info->channel_count != 2) if(op_info->channel_count != 1 && op_info->channel_count != 2)
{ {
Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
op_info->channel_count, stream->name); op_info->channel_count, stream->name);
goto _fail; goto fail;
} }
/* All Opus audio is coded at 48 kHz, and should also be decoded /* All Opus audio is coded at 48 kHz, and should also be decoded
@ -139,7 +139,7 @@ static bool S_OPUS_CodecOpenStream(snd_stream_t *stream)
stream->info.width = 2; stream->info.width = 2;
return true; return true;
_fail: fail:
if(opFile) if(opFile)
op_free(opFile); op_free(opFile);
return false; return false;

View File

@ -131,7 +131,7 @@ static fci_t get_fci(const char *in, int32_t *pos)
static int32_t get_objtype(fshandle_t *f, int32_t ofs, int32_t type) static int32_t get_objtype(fshandle_t *f, int32_t ofs, int32_t type)
{ {
char sig[16]; char sig[16];
_retry: retry:
FS_fseek(f, ofs, SEEK_SET); FS_fseek(f, ofs, SEEK_SET);
FS_fread(sig, 16, 1, f); FS_fread(sig, 16, 1, f);
if(type == UMUSIC_IT) if(type == UMUSIC_IT)
@ -175,7 +175,7 @@ _retry:
/* SpaceMarines.umx and Starseek.umx from Return to NaPali /* SpaceMarines.umx and Starseek.umx from Return to NaPali
* report as "s3m" whereas the actual music format is "it" */ * report as "s3m" whereas the actual music format is "it" */
type = UMUSIC_IT; type = UMUSIC_IT;
goto _retry; goto retry;
} }
FS_fseek(f, ofs + 1080, SEEK_SET); FS_fseek(f, ofs + 1080, SEEK_SET);

View File

@ -91,20 +91,20 @@ static bool S_VORBIS_CodecOpenStream(snd_stream_t *stream)
{ {
Con_Printf("%s is not a valid Ogg Vorbis file (error %" PRIi32 ").\n", Con_Printf("%s is not a valid Ogg Vorbis file (error %" PRIi32 ").\n",
stream->name, res); stream->name, res);
goto _fail; goto fail;
} }
if(!ov_seekable(ovFile)) if(!ov_seekable(ovFile))
{ {
Con_Printf("Stream %s not seekable.\n", stream->name); Con_Printf("Stream %s not seekable.\n", stream->name);
goto _fail; goto fail;
} }
ovf_info = ov_info(ovFile, 0); ovf_info = ov_info(ovFile, 0);
if(!ovf_info) if(!ovf_info)
{ {
Con_Printf("Unable to get stream info for %s.\n", stream->name); Con_Printf("Unable to get stream info for %s.\n", stream->name);
goto _fail; goto fail;
} }
/* FIXME: handle section changes */ /* FIXME: handle section changes */
@ -113,14 +113,14 @@ static bool S_VORBIS_CodecOpenStream(snd_stream_t *stream)
{ {
Con_Printf("More than one (%" PRIi64 ") stream in %s.\n", Con_Printf("More than one (%" PRIi64 ") stream in %s.\n",
numstreams, stream->name); numstreams, stream->name);
goto _fail; goto fail;
} }
if(ovf_info->channels != 1 && ovf_info->channels != 2) if(ovf_info->channels != 1 && ovf_info->channels != 2)
{ {
Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n", Con_Printf("Unsupported number of channels %" PRIi32 " in %s\n",
ovf_info->channels, stream->name); ovf_info->channels, stream->name);
goto _fail; goto fail;
} }
stream->info.rate = ovf_info->rate; stream->info.rate = ovf_info->rate;
@ -129,7 +129,7 @@ static bool S_VORBIS_CodecOpenStream(snd_stream_t *stream)
stream->info.width = VORBIS_SAMPLEWIDTH; stream->info.width = VORBIS_SAMPLEWIDTH;
return true; return true;
_fail: fail:
if(res == 0) if(res == 0)
ov_clear(ovFile); ov_clear(ovFile);
Z_Free(ovFile); Z_Free(ovFile);

View File

@ -151,7 +151,7 @@ sys_socket_t UDP_OpenSocket(int32_t port)
} }
if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR) if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR)
goto ErrorReturn; goto error;
memset(&address, 0, sizeof(struct sockaddr_in)); memset(&address, 0, sizeof(struct sockaddr_in));
address.sin_family = AF_INET; address.sin_family = AF_INET;
@ -160,7 +160,7 @@ sys_socket_t UDP_OpenSocket(int32_t port)
if(bind(newsocket, (struct sockaddr *)&address, sizeof(address)) == 0) if(bind(newsocket, (struct sockaddr *)&address, sizeof(address)) == 0)
return newsocket; return newsocket;
ErrorReturn: error:
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err)); Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
UDP_CloseSocket(newsocket); UDP_CloseSocket(newsocket);

View File

@ -269,13 +269,13 @@ static void Sys_GetBasedir(char *argv0, char *dst, size_t dstsize)
{ {
perror("realpath"); perror("realpath");
if(getcwd(dst, dstsize - 1) == NULL) if(getcwd(dst, dstsize - 1) == NULL)
_fail: fail:
Sys_Error("Couldn't determine current directory"); Sys_Error("Couldn't determine current directory");
} }
else else
{ {
/* strip off the binary name */ /* strip off the binary name */
if(!(tmp = strdup(dst))) goto _fail; if(!(tmp = strdup(dst))) goto fail;
q_strlcpy(dst, dirname(tmp), dstsize); q_strlcpy(dst, dirname(tmp), dstsize);
free(tmp); free(tmp);
} }

View File

@ -230,7 +230,7 @@ sys_socket_t WINS_OpenSocket(int32_t port)
} }
if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR) if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR)
goto ErrorReturn; goto error;
memset(&address, 0, sizeof(struct sockaddr_in)); memset(&address, 0, sizeof(struct sockaddr_in));
address.sin_family = AF_INET; address.sin_family = AF_INET;
@ -249,7 +249,7 @@ sys_socket_t WINS_OpenSocket(int32_t port)
} }
/* else: we are still in init phase, no need to error */ /* else: we are still in init phase, no need to error */
ErrorReturn: error:
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("WINS_OpenSocket: %s\n", socketerror(err)); Con_SafePrintf("WINS_OpenSocket: %s\n", socketerror(err));
closesocket(newsocket); closesocket(newsocket);

View File

@ -166,11 +166,11 @@ sys_socket_t WIPX_OpenSocket(int32_t port)
} }
if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR) if(ioctlsocket(newsocket, FIONBIO, &_true) == SOCKET_ERROR)
goto ErrorReturn; goto error;
if(setsockopt(newsocket, SOL_SOCKET, SO_BROADCAST, (char *)&_true, sizeof(_true)) if(setsockopt(newsocket, SOL_SOCKET, SO_BROADCAST, (char *)&_true, sizeof(_true))
== SOCKET_ERROR) == SOCKET_ERROR)
goto ErrorReturn; goto error;
address.sa_family = AF_IPX; address.sa_family = AF_IPX;
memset(address.sa_netnum, 0, 4); memset(address.sa_netnum, 0, 4);
@ -191,7 +191,7 @@ sys_socket_t WIPX_OpenSocket(int32_t port)
} }
/* else: we are still in init phase, no need to error */ /* else: we are still in init phase, no need to error */
ErrorReturn: error:
err = SOCKETERRNO; err = SOCKETERRNO;
Con_SafePrintf("WIPX_OpenSocket: %s\n", socketerror(err)); Con_SafePrintf("WIPX_OpenSocket: %s\n", socketerror(err));
closesocket(newsocket); closesocket(newsocket);