else
{
/* Read the next EEPROM byte into the endpoint */
- WriteNextResponseByte(eeprom_read_byte((uint8_t*)(uint16_t)(CurrAddress >> 1)));
+ WriteNextResponseByte(eeprom_read_byte((uint8_t*)(intptr_t)(CurrAddress >> 1)));
/* Increment the address counter after use */
CurrAddress += 2;
else
{
/* Write the next EEPROM byte from the endpoint */
- eeprom_write_byte((uint8_t*)(uint16_t)(CurrAddress >> 1), FetchNextCommandByte());
+ eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address counter after use */
CurrAddress += 2;
else if (Command == 'D')
{
/* Read the byte from the endpoint and write it to the EEPROM */
- eeprom_write_byte((uint8_t*)((uint16_t)(CurrAddress >> 1)), FetchNextCommandByte());
+ eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte());
/* Increment the address after use */
CurrAddress += 2;
else if (Command == 'd')
{
/* Read the EEPROM byte and write it to the endpoint */
- WriteNextResponseByte(eeprom_read_byte((uint8_t*)((uint16_t)(CurrAddress >> 1))));
+ WriteNextResponseByte(eeprom_read_byte((uint8_t*)((intptr_t)(CurrAddress >> 1))));
/* Increment the address after use */
CurrAddress += 2;
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
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)));
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
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)));