B
Ben Nguyen
Im trying to port a hard drive driver that was originally for a different
compiler than the one Im using now. The line that doesnt compile with the new
compiler is:
ActualPartRecord = *((struct partrecord *)
((struct partsector *) SectorArray) -> psPart);
where partsector is a 512 byte structure that contains a 64 byte field 'psPart'
that is being forced into a 16 byte structure (ActualPartRecord is of type
partrecord)
How can 64 bytes (-> psPart) get squeezed into 16? Is this why the compiler is
complaining?
The actual error message is:
"pointer to structure or union required on left side of '->'"
struct partrecord
{
__uchar8 isActive;
__uchar8 startHead;
__uint16 startCylSect;
__uchar8 partType;
__uchar8 endHead;
__uint16 endCylSect;
__ulong32 startLBA;
__ulong32 size;
};
struct partsector
{
__char8 psPartCode[446];
__uchar8 psPart[64];
__uchar8 psBootSectSig0;
__uchar8 psBootSectSig1;
};
Also
SectorArray is declared as:
__uchar8 tempArray[512];
__uchar8 *SectorBuffer =(__uchar8 *) tempArray;
Any suggestions?
Ben
compiler than the one Im using now. The line that doesnt compile with the new
compiler is:
ActualPartRecord = *((struct partrecord *)
((struct partsector *) SectorArray) -> psPart);
where partsector is a 512 byte structure that contains a 64 byte field 'psPart'
that is being forced into a 16 byte structure (ActualPartRecord is of type
partrecord)
How can 64 bytes (-> psPart) get squeezed into 16? Is this why the compiler is
complaining?
The actual error message is:
"pointer to structure or union required on left side of '->'"
struct partrecord
{
__uchar8 isActive;
__uchar8 startHead;
__uint16 startCylSect;
__uchar8 partType;
__uchar8 endHead;
__uint16 endCylSect;
__ulong32 startLBA;
__ulong32 size;
};
struct partsector
{
__char8 psPartCode[446];
__uchar8 psPart[64];
__uchar8 psBootSectSig0;
__uchar8 psBootSectSig1;
};
Also
SectorArray is declared as:
__uchar8 tempArray[512];
__uchar8 *SectorBuffer =(__uchar8 *) tempArray;
Any suggestions?
Ben