Fix compiler warnings

This commit is contained in:
Alex
2023-04-23 07:02:24 +03:00
parent a73a49094c
commit fcbb298077
50 changed files with 232 additions and 192 deletions

View File

@ -55,9 +55,16 @@ namespace NetworkEthernet
public:
FrameType GetFrameType() { return FType; }
virtual void OnEthernetPacketSent(EthernetPacket *Packet) { netdbg("Event not handled. [%p]", Packet); }
virtual void OnEthernetPacketSent(EthernetPacket *Packet)
{
UNUSED(Packet);
netdbg("Event not handled. [%p]", Packet);
}
virtual bool OnEthernetPacketReceived(uint8_t *Data, uint64_t Length)
{
UNUSED(Data);
UNUSED(Length);
netdbg("Event not handled. [%p, %d]", Data, Length);
return false;
}

View File

@ -124,6 +124,10 @@ namespace NetworkIPv4
virtual bool OnIPv4PacketReceived(InternetProtocol SourceIP, InternetProtocol DestinationIP, uint8_t *Data, uint64_t Length)
{
UNUSED(SourceIP);
UNUSED(DestinationIP);
UNUSED(Data);
UNUSED(Length);
warn("Not implemented.");
return false;
}

View File

@ -52,11 +52,39 @@ namespace NetworkInterfaceManager
~Events();
public:
virtual void OnInterfaceAdded(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); }
virtual void OnInterfaceRemoved(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); }
virtual void OnInterfaceChanged(DeviceInterface *Interface) { netdbg("Event for %s not handled.", Interface->Name); }
virtual void OnInterfaceReceived(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) { netdbg("Event for %s not handled.", Interface->Name); }
virtual void OnInterfaceSent(DeviceInterface *Interface, uint8_t *Data, uint64_t Length) { netdbg("Event for %s not handled.", Interface->Name); }
virtual void OnInterfaceAdded(DeviceInterface *Interface)
{
UNUSED(Interface);
netdbg("Event for %s not handled.", Interface->Name);
}
virtual void OnInterfaceRemoved(DeviceInterface *Interface)
{
UNUSED(Interface);
netdbg("Event for %s not handled.", Interface->Name);
}
virtual void OnInterfaceChanged(DeviceInterface *Interface)
{
UNUSED(Interface);
netdbg("Event for %s not handled.", Interface->Name);
}
virtual void OnInterfaceReceived(DeviceInterface *Interface, uint8_t *Data, uint64_t Length)
{
UNUSED(Interface);
UNUSED(Data);
UNUSED(Length);
netdbg("Event for %s not handled.", Interface->Name);
}
virtual void OnInterfaceSent(DeviceInterface *Interface, uint8_t *Data, uint64_t Length)
{
UNUSED(Interface);
UNUSED(Data);
UNUSED(Length);
netdbg("Event for %s not handled.", Interface->Name);
}
};
class NetworkInterface

View File

@ -30,7 +30,13 @@ void DbgDumpData(const char *Description, void *Address, unsigned long Length);
#else
#define netdbg(m, ...)
static inline void DbgNetwork() { return; }
static inline void DbgDumpData(const char *Description, void *Address, unsigned long Length) { return; }
static inline void DbgDumpData(const char *Description, void *Address, unsigned long Length)
{
UNUSED(Description);
UNUSED(Address);
UNUSED(Length);
return;
}
#endif
enum Endianness

View File

@ -50,6 +50,9 @@ namespace NetworkUDP
public:
virtual void OnUDPPacketReceived(Socket *Socket, uint8_t *Data, uint64_t Length)
{
UNUSED(Socket);
UNUSED(Data);
UNUSED(Length);
warn("Not implemented.");
}
};