1
0
mirror of https://github.com/solemnwarning/directplay-lite synced 2024-12-30 16:45:37 +01:00

Fix a few compiler warnings.

This commit is contained in:
Daniel Collins 2023-12-11 22:45:20 +00:00
parent 6f9a8d32e3
commit 2d5651350c
4 changed files with 14 additions and 12 deletions

@ -1,5 +1,5 @@
/* DirectPlay Lite
* Copyright (C) 2018 Daniel Collins <solemnwarning@solemnwarning.net>
* Copyright (C) 2018-2023 Daniel Collins <solemnwarning@solemnwarning.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -497,7 +497,7 @@ HRESULT DirectPlay8Peer::Connect(CONST DPN_APPLICATION_DESC* CONST pdnAppDesc, I
log_printf("port = %d", (int)(port_value));
r_port = port_value;
r_port = (uint16_t)(port_value);
}
else{
return DPNERR_INVALIDHOSTADDRESS;
@ -3146,7 +3146,7 @@ void DirectPlay8Peer::handle_udp_socket_event()
try {
pd.reset(new PacketDeserialiser(recv_buf, r));
}
catch(const PacketDeserialiser::Error &e)
catch(const PacketDeserialiser::Error &)
{
/* Malformed packet received */
return;
@ -3197,7 +3197,7 @@ void DirectPlay8Peer::handle_other_socket_event()
try {
pd.reset(new PacketDeserialiser(recv_buf, r));
}
catch(const PacketDeserialiser::Error &e)
catch(const PacketDeserialiser::Error &)
{
/* Malformed packet received */
return;

@ -1,5 +1,5 @@
/* DirectPlay Lite
* Copyright (C) 2018 Daniel Collins <solemnwarning@solemnwarning.net>
* Copyright (C) 2018-2023 Daniel Collins <solemnwarning@solemnwarning.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -133,7 +133,7 @@ HostEnumerator::HostEnumerator(
throw COMAPIException(DPNERR_INVALIDHOSTADDRESS);
}
send_addr.sin_port = htons(port_value);
send_addr.sin_port = htons((uint16_t)(port_value));
}
}
@ -284,7 +284,7 @@ void HostEnumerator::handle_packet(const void *data, size_t size, struct sockadd
try {
pd.reset(new PacketDeserialiser(data, size));
}
catch(const PacketDeserialiser::Error &e)
catch(const PacketDeserialiser::Error &)
{
/* Malformed packet received */
return;
@ -333,7 +333,7 @@ void HostEnumerator::handle_packet(const void *data, size_t size, struct sockadd
request_tick_count = pd->get_dword(8);
}
catch(const PacketDeserialiser::Error &e)
catch(const PacketDeserialiser::Error &)
{
/* Malformed packet received */
return;

@ -1,5 +1,5 @@
/* DirectPlay Lite
* Copyright (C) 2018 Daniel Collins <solemnwarning@solemnwarning.net>
* Copyright (C) 2018-2023 Daniel Collins <solemnwarning@solemnwarning.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -31,6 +31,8 @@ struct TLVChunk
{
uint32_t type;
uint32_t value_length;
#pragma warning(suppress: 4200)
unsigned char value[0];
};

@ -1,5 +1,5 @@
/* DirectPlay Lite
* Copyright (C) 2018 Daniel Collins <solemnwarning@solemnwarning.net>
* Copyright (C) 2018-2023 Daniel Collins <solemnwarning@solemnwarning.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -28,6 +28,8 @@
#include "../src/DirectPlay8Address.hpp"
#include "../src/DirectPlay8Peer.hpp"
#pragma warning(disable: 4065) /* switch statement contains 'default' but no 'case' labels */
// #define INSTANTIATE_FROM_COM
#define PORT 42895
@ -9163,8 +9165,6 @@ TEST(DirectPlay8Peer, DestroyGroupBeforeJoin)
TestPeer peer1("peer1");
DPNID p1_cg_dpnidGroup;
peer1.expect_begin();
peer1.expect_push([&host](DWORD dwMessageType, PVOID pMessage)
{