mirror of
https://github.com/chocolate-doom/chocolate-doom.git
synced 2025-05-30 08:31:55 +00:00
Style fixes
This commit is contained in:
parent
e6260bfe98
commit
f09202ec5a
2 changed files with 28 additions and 36 deletions
|
@ -107,9 +107,10 @@ static void FreePipes()
|
|||
//
|
||||
static boolean UsingNativeMidi()
|
||||
{
|
||||
int i;
|
||||
int decoders = Mix_GetNumMusicDecoders();
|
||||
|
||||
for (int i = 0;i < decoders;i++)
|
||||
for (i = 0; i < decoders; i++)
|
||||
{
|
||||
if (strcmp(Mix_GetMusicDecoder(i), "NATIVEMIDI") == 0)
|
||||
{
|
||||
|
@ -131,12 +132,7 @@ static boolean WritePipe(net_packet_t *packet)
|
|||
BOOL ok = WriteFile(midi_process_in_writer, packet->data, packet->len,
|
||||
&bytes_written, NULL);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return ok;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -169,7 +165,7 @@ static boolean ExpectPipe(net_packet_t *packet)
|
|||
&pipe_buffer_read, NULL);
|
||||
if (!ok)
|
||||
{
|
||||
goto fail;
|
||||
break;
|
||||
}
|
||||
else if (pipe_buffer_read < packet->len)
|
||||
{
|
||||
|
@ -182,13 +178,13 @@ static boolean ExpectPipe(net_packet_t *packet)
|
|||
&pipe_buffer_read, NULL);
|
||||
if (!ok || pipe_buffer_read != packet->len)
|
||||
{
|
||||
goto fail;
|
||||
break;
|
||||
}
|
||||
|
||||
// Compare our data buffer to the packet.
|
||||
if (memcmp(packet->data, pipe_buffer, packet->len) != 0)
|
||||
{
|
||||
goto fail;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -196,7 +192,6 @@ static boolean ExpectPipe(net_packet_t *packet)
|
|||
// Continue looping as long as we don't exceed our maximum wait time.
|
||||
} while (I_GetTimeMS() - start <= MIDIPIPE_MAX_WAIT);
|
||||
|
||||
fail:
|
||||
// TODO: Deal with the wedged process?
|
||||
return false;
|
||||
}
|
||||
|
@ -458,7 +453,10 @@ boolean I_MidiPipe_InitServer()
|
|||
|
||||
if (!ok)
|
||||
{
|
||||
goto fail;
|
||||
FreePipes();
|
||||
free(cmdline);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Since the server has these handles, we don't need them anymore.
|
||||
|
@ -469,12 +467,6 @@ boolean I_MidiPipe_InitServer()
|
|||
|
||||
midi_server_initialized = true;
|
||||
return true;
|
||||
|
||||
fail:
|
||||
FreePipes();
|
||||
free(cmdline);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue