diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-05-26 12:24:44 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-05-26 12:24:44 +0000 |
commit | 54e69dbee146182a60c258076b8d26e8f5ac752a (patch) | |
tree | 03616ce525bc41ec30c269c0b208c5440c720f54 /Demos/Device | |
parent | 670413603f528259ade457f27fe97c70736ca754 (diff) | |
download | lufa-54e69dbee146182a60c258076b8d26e8f5ac752a.tar.gz lufa-54e69dbee146182a60c258076b8d26e8f5ac752a.tar.bz2 lufa-54e69dbee146182a60c258076b8d26e8f5ac752a.zip |
Switch to using the correct intptr_t type use where a pointer must be cast to an integer type.
Diffstat (limited to 'Demos/Device')
4 files changed, 10 insertions, 10 deletions
diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c index e6377af52..761c6adf1 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c @@ -69,7 +69,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, v DHCPHeaderOUT->ElapsedSeconds = 0; DHCPHeaderOUT->Flags = DHCPHeaderIN->Flags; DHCPHeaderOUT->YourIP = ClientIPAddress; - memcpy(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t)); + memmove(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t)); DHCPHeaderOUT->Cookie = SwapEndian_32(DHCP_MAGIC_COOKIE); /* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c index 2d8183746..fa1a651e6 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c @@ -63,12 +63,12 @@ int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart ICMPHeaderOUT->Id = ICMPHeaderIN->Id; ICMPHeaderOUT->Sequence = ICMPHeaderIN->Sequence; - uint16_t DataSize = FrameIN->FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN->FrameData)); + intptr_t DataSize = FrameIN->FrameLength - ((((intptr_t)InDataStart + sizeof(ICMP_Header_t)) - (intptr_t)FrameIN->FrameData)); /* Copy the remaining payload to the response - echo requests should echo back any sent data */ - memcpy(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], - &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], - DataSize); + memmove(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], + &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], + DataSize); ICMPHeaderOUT->Checksum = Ethernet_Checksum16(ICMPHeaderOUT, (DataSize + sizeof(ICMP_Header_t))); diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c index d3bffe996..eeed88491 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c @@ -69,7 +69,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, v DHCPHeaderOUT->ElapsedSeconds = 0; DHCPHeaderOUT->Flags = DHCPHeaderIN->Flags; DHCPHeaderOUT->YourIP = ClientIPAddress; - memcpy(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t)); + memmove(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t)); DHCPHeaderOUT->Cookie = SwapEndian_32(DHCP_MAGIC_COOKIE); /* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c index 02a401f6a..a43ffca54 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c @@ -62,12 +62,12 @@ int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart) ICMPHeaderOUT->Id = ICMPHeaderIN->Id; ICMPHeaderOUT->Sequence = ICMPHeaderIN->Sequence; - uint16_t DataSize = FrameIN.FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN.FrameData)); + intptr_t DataSize = FrameIN.FrameLength - ((((intptr_t)InDataStart + sizeof(ICMP_Header_t)) - (intptr_t)FrameIN.FrameData)); /* Copy the remaining payload to the response - echo requests should echo back any sent data */ - memcpy(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], - &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], - DataSize); + memmove(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], + &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], + DataSize); ICMPHeaderOUT->Checksum = Ethernet_Checksum16(ICMPHeaderOUT, (DataSize + sizeof(ICMP_Header_t))); |