Remove void* arithmetic in the USB_GetNextDescriptor() static inline function, to make the header file C++ compatible once again. Implement workaround for an obscure GCC bug which can cause incorrect code generation under some circumstances when the void* is re-cast.

This commit is contained in:
Dean Camera 2010-05-31 06:55:23 +00:00
parent 152b2764c3
commit f606afefff
3 changed files with 62 additions and 51 deletions

View file

@ -114,13 +114,13 @@ void USB_GetNextDescriptorOfTypeAfter(uint16_t* const BytesRem,
USB_GetNextDescriptorOfType(BytesRem, CurrConfigLoc, Type);
}
uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine)
uint8_t USB_GetNextDescriptorComp(uint16_t* BytesRem, void** const CurrConfigLoc, ConfigComparatorPtr_t const ComparatorRoutine)
{
uint8_t ErrorCode;
while (*BytesRem)
{
void* PrevDescLoc = *CurrConfigLoc;
uint8_t* PrevDescLoc = *CurrConfigLoc;
uint16_t PrevBytesRem = *BytesRem;
USB_GetNextDescriptor(BytesRem, CurrConfigLoc);