diff options
author | Francis Rowe <info@gluglug.org.uk> | 2015-01-10 23:07:56 +0000 |
---|---|---|
committer | Francis Rowe <info@gluglug.org.uk> | 2015-01-10 23:07:56 +0000 |
commit | f6da483213c5a9ad026c2740eeff120414492a40 (patch) | |
tree | 72c62f49cc617a15a023134c26679c30133aacab /resources/utilities/ich9deblob/src/common/x86compatibility.c | |
parent | 74adfa0f8c41754d1a74006b6ca5f923fd2af503 (diff) | |
download | librebootfr-f6da483213c5a9ad026c2740eeff120414492a40.tar.gz librebootfr-f6da483213c5a9ad026c2740eeff120414492a40.zip |
ich9deblob/ich9gen: use portable data types
For those integers that need to be a certain byte size.
Diffstat (limited to 'resources/utilities/ich9deblob/src/common/x86compatibility.c')
-rw-r--r-- | resources/utilities/ich9deblob/src/common/x86compatibility.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/resources/utilities/ich9deblob/src/common/x86compatibility.c b/resources/utilities/ich9deblob/src/common/x86compatibility.c index 505a37d9..aaf31733 100644 --- a/resources/utilities/ich9deblob/src/common/x86compatibility.c +++ b/resources/utilities/ich9deblob/src/common/x86compatibility.c @@ -51,10 +51,10 @@ int structSizesIncorrect(struct DESCRIPTORREGIONRECORD descriptorDummy, struct G /* endianness check. big endian forced to fail */ int systemIsBigEndian() { - unsigned short steak = 0xBEEF; - unsigned char *grill = (unsigned char*)&steak; + uint16_t steak = 0xBEEF; + uint8_t *grill = (uint8_t*)&steak; - if (*grill==0xBE) { + if (*grill!=0xEF) { printf("\nunsigned short 0xBEEF: first byte should be EF, but it's BE. Your system is big endian, and unsupported (only little endian is tested)\n"); return 1; } @@ -66,7 +66,7 @@ int structMembersWrongOrder() { int i; struct DESCRIPTORREGIONRECORD descriptorDummy; - unsigned char *meVsccTablePtr = (unsigned char*)&descriptorDummy.meVsccTable; + uint8_t *meVsccTablePtr = (uint8_t*)&descriptorDummy.meVsccTable; /* These do not use bitfields. */ descriptorDummy.meVsccTable.jid0 = 0x01020304; /* unsigned int 32-bit */ @@ -124,7 +124,7 @@ int structBitfieldWrongOrder() { int i; struct DESCRIPTORREGIONRECORD descriptorDummy; - unsigned char *flMap0Ptr = (unsigned char*)&descriptorDummy.flMaps.flMap0; + uint8_t *flMap0Ptr = (uint8_t*)&descriptorDummy.flMaps.flMap0; descriptorDummy.flMaps.flMap0.FCBA = 0xA2; /* :8 --> 10100010 */ descriptorDummy.flMaps.flMap0.NC = 0x02; /* :2 --> 10 */ |