Index: trunk/i386/libsaio/acpi_patcher.c =================================================================== --- trunk/i386/libsaio/acpi_patcher.c (revision 1741) +++ trunk/i386/libsaio/acpi_patcher.c (revision 1742) @@ -819,7 +819,7 @@ sprintf(filename, i>0?"SSDT-%d.aml":"SSDT.aml", i); - if(new_ssdt[ssdt_count] = loadACPITable(filename)) + if ( (new_ssdt[ssdt_count] = loadACPITable(filename)) ) { ssdt_count++; } Index: trunk/i386/libsaio/gma.c =================================================================== --- trunk/i386/libsaio/gma.c (revision 1741) +++ trunk/i386/libsaio/gma.c (revision 1742) @@ -115,21 +115,21 @@ devprop_add_value(device, "model", (uint8_t*)model, (strlen(model) + 1)); devprop_add_value(device, "device_type", (uint8_t*)"display", 8); - if ((model == (char *)"Mobile GMA950") - || (model == (char *)"Mobile GMA3150")) + if ((strcmp("Mobile GMA950", model) == 0) || + (strcmp("Mobile GMA3150",model) == 0)) { devprop_add_value(device, "AAPL,HasPanel", reg_TRUE, 4); devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); } - else if ((model == (char *)"Desktop GMA950") - || (model == (char *)"Desktop GMA3150")) + else if ((strcmp("Desktop GMA950", model) == 0) || + (strcmp("Desktop GMA3150",model) == 0)) { BuiltIn = 0x01; devprop_add_value(device, "built-in", &BuiltIn, 1); devprop_add_value(device, "class-code", ClassFix, 4); } - else if (model == (char *)"GMAX3100") + else if (strcmp("GMAX3100",model) == 0) { devprop_add_value(device, "AAPL,HasPanel", GMAX3100_vals[0], 4); devprop_add_value(device, "AAPL,SelfRefreshSupported", GMAX3100_vals[1], 4); Index: trunk/i386/libsaio/usb.c =================================================================== --- trunk/i386/libsaio/usb.c (revision 1741) +++ trunk/i386/libsaio/usb.c (revision 1742) @@ -244,7 +244,7 @@ //We try soft reset first - some systems hang on reboot with hard reset // Definitely needed during reboot on 10.4.6 - isOwnershipConflict = ((legacy[3] & 1 != 0) && (legacy[2] & 1 != 0)); + isOwnershipConflict = (((legacy[3] & 1) != 0) && ((legacy[2] & 1) != 0)); if (!alwaysHardBIOSReset && isOwnershipConflict) { DBG("EHCI - Ownership conflict - attempting soft reset ...\n"); DBG("EHCI - toggle OS Ownership to 0\n"); Index: trunk/i386/libsaio/nvidia.c =================================================================== --- trunk/i386/libsaio/nvidia.c (revision 1741) +++ trunk/i386/libsaio/nvidia.c (revision 1742) @@ -1004,7 +1004,7 @@ channel1 |= ( 0x1 << entries[i].index); entries[i].type = TYPE_GROUPED; - if ((entries[i-1].type == 0x0)) + if ( entries[i-1].type == 0x0 ) { channel1 |= ( 0x1 << entries[i-1].index); entries[i-1].type = TYPE_GROUPED; @@ -1023,7 +1023,7 @@ channel2 |= ( 0x1 << entries[i].index); entries[i].type = TYPE_GROUPED; - if ((entries[i - 1].type == 0x0)) + if ( entries[i - 1].type == 0x0 ) { channel2 |= ( 0x1 << entries[i-1].index); entries[i-1].type = TYPE_GROUPED; Index: trunk/i386/libsaio/disk.c =================================================================== --- trunk/i386/libsaio/disk.c (revision 1741) +++ trunk/i386/libsaio/disk.c (revision 1742) @@ -1144,7 +1144,7 @@ result = FDISK_NTFS; else if (BeFSProbe(probeBuffer)) result = FDISK_BEFS; - else if (fatbits=MSDOSProbe(probeBuffer)) + else if ( (fatbits = MSDOSProbe(probeBuffer)) ) { switch (fatbits) { @@ -1185,7 +1185,7 @@ struct DiskBVMap * map = NULL; void *buffer = malloc(BPS); int error; - if ( error = readBytes( biosdev, /*secno*/0, 0, BPS, buffer ) != 0) { + if ( (error = readBytes( biosdev, /*secno*/0, 0, BPS, buffer )) != 0) { verbose("Failed to read boot sector from BIOS device %02xh. Error=%d\n", biosdev, error); goto scanErr; } Index: trunk/i386/libsaio/smbios_decode.c =================================================================== --- trunk/i386/libsaio/smbios_decode.c (revision 1741) +++ trunk/i386/libsaio/smbios_decode.c (revision 1742) @@ -23,6 +23,40 @@ extern char *getSMBStringForField(SMBStructHeader *structHeader, uint8_t field); +static const char * +SMBMemoryDeviceTypes[] = +{ + "RAM", /* 00h Undefined */ + "RAM", /* 01h Other */ + "RAM", /* 02h Unknown */ + "DRAM", /* 03h DRAM */ + "EDRAM", /* 04h EDRAM */ + "VRAM", /* 05h VRAM */ + "SRAM", /* 06h SRAM */ + "RAM", /* 07h RAM */ + "ROM", /* 08h ROM */ + "FLASH", /* 09h FLASH */ + "EEPROM", /* 0Ah EEPROM */ + "FEPROM", /* 0Bh FEPROM */ + "EPROM", /* 0Ch EPROM */ + "CDRAM", /* 0Dh CDRAM */ + "3DRAM", /* 0Eh 3DRAM */ + "SDRAM", /* 0Fh SDRAM */ + "SGRAM", /* 10h SGRAM */ + "RDRAM", /* 11h RDRAM */ + "DDR SDRAM", /* 12h DDR */ + "DDR2 SDRAM", /* 13h DDR2 */ + "DDR2 FB-DIMM", /* 14h DDR2 FB-DIMM */ + "RAM", /* 15h unused */ + "RAM", /* 16h unused */ + "RAM", /* 17h unused */ + "DDR3", /* 18h DDR3, chosen in [5776134] */ +}; + +static const int +kSMBMemoryDeviceTypeCount = sizeof(SMBMemoryDeviceTypes) / + sizeof(SMBMemoryDeviceTypes[0]); + //------------------------------------------------------------------------------------------------------------------------- // BIOSInformation //------------------------------------------------------------------------------------------------------------------------- Index: trunk/i386/libsaio/smbios.h =================================================================== --- trunk/i386/libsaio/smbios.h (revision 1741) +++ trunk/i386/libsaio/smbios.h (revision 1742) @@ -386,40 +386,6 @@ SMBWord Data[]; } __attribute__((packed)) SMBMemorySPD; -static const char * -SMBMemoryDeviceTypes[] = -{ - "RAM", /* 00h Undefined */ - "RAM", /* 01h Other */ - "RAM", /* 02h Unknown */ - "DRAM", /* 03h DRAM */ - "EDRAM", /* 04h EDRAM */ - "VRAM", /* 05h VRAM */ - "SRAM", /* 06h SRAM */ - "RAM", /* 07h RAM */ - "ROM", /* 08h ROM */ - "FLASH", /* 09h FLASH */ - "EEPROM", /* 0Ah EEPROM */ - "FEPROM", /* 0Bh FEPROM */ - "EPROM", /* 0Ch EPROM */ - "CDRAM", /* 0Dh CDRAM */ - "3DRAM", /* 0Eh 3DRAM */ - "SDRAM", /* 0Fh SDRAM */ - "SGRAM", /* 10h SGRAM */ - "RDRAM", /* 11h RDRAM */ - "DDR SDRAM", /* 12h DDR */ - "DDR2 SDRAM", /* 13h DDR2 */ - "DDR2 FB-DIMM", /* 14h DDR2 FB-DIMM */ - "RAM", /* 15h unused */ - "RAM", /* 16h unused */ - "RAM", /* 17h unused */ - "DDR3", /* 18h DDR3, chosen in [5776134] */ -}; - -static const int -kSMBMemoryDeviceTypeCount = sizeof(SMBMemoryDeviceTypes) / - sizeof(SMBMemoryDeviceTypes[0]); - // // OEM Processor Type (Apple Specific - Type 131) // Index: trunk/i386/libsaio/convert.c =================================================================== --- trunk/i386/libsaio/convert.c (revision 1741) +++ trunk/i386/libsaio/convert.c (revision 1742) @@ -94,9 +94,9 @@ hexNibble = hexStr[hexStrIdx]; // ignore all chars except valid hex numbers - if (hexNibble >= '0' && hexNibble <= '9' - || hexNibble >= 'A' && hexNibble <= 'F' - || hexNibble >= 'a' && hexNibble <= 'f') + if ( (hexNibble >= '0' && hexNibble <= '9') || + (hexNibble >= 'A' && hexNibble <= 'F') || + (hexNibble >= 'a' && hexNibble <= 'f') ) { hexByte[hexNibbleIdx++] = hexNibble; Index: trunk/i386/libsaio/pci.h =================================================================== --- trunk/i386/libsaio/pci.h (revision 1741) +++ trunk/i386/libsaio/pci.h (revision 1742) @@ -43,7 +43,7 @@ struct pci_dt_t *next; } pci_dt_t; -#define PCIADDR(bus, dev, func) (1 << 31) | (bus << 16) | (dev << 11) | (func << 8) +#define PCIADDR(bus, dev, func) ((1 << 31) | (bus << 16) | (dev << 11) | (func << 8)) #define PCI_ADDR_REG 0xcf8 #define PCI_DATA_REG 0xcfc Index: trunk/i386/libsaio/fake_efi.c =================================================================== --- trunk/i386/libsaio/fake_efi.c (revision 1741) +++ trunk/i386/libsaio/fake_efi.c (revision 1742) @@ -655,7 +655,7 @@ { // Check selected volume's Extra. sprintf(dirSpecSMBIOS, "/Extra/%s", filename); - if (err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig)) + if ( (err = loadConfigFile(dirSpecSMBIOS, &bootInfo->smbiosConfig)) ) { // Check booter volume/rdbt Extra. sprintf(dirSpecSMBIOS, "bt(0,0)/Extra/%s", filename); Index: trunk/i386/boot2/options.c =================================================================== --- trunk/i386/boot2/options.c (revision 1741) +++ trunk/i386/boot2/options.c (revision 1742) @@ -135,7 +135,7 @@ lasttime=time18(); } - if (ch = readKeyboardStatus()) + if ( (ch = readKeyboardStatus()) ) break; // Count can be interrupted by holding down shift, Index: trunk/i386/libsa/string.c =================================================================== --- trunk/i386/libsa/string.c (revision 1741) +++ trunk/i386/libsa/string.c (revision 1742) @@ -151,7 +151,7 @@ strcpy(char * s1, const char * s2) { register char *ret = s1; - while (*s1++ = *s2++) + while ((*s1++ = *s2++)) continue; return ret; } Index: trunk/i386/libsa/prf.c =================================================================== --- trunk/i386/libsa/prf.c (revision 1741) +++ trunk/i386/libsa/prf.c (revision 1742) @@ -151,7 +151,7 @@ break; case 's': s = (char *)*adx; - while (c = *s++) { + while ((c = *s++)) { (*putfn_p)(c, putfn_arg); width++; } Index: trunk/i386/libsa/strtol.c =================================================================== --- trunk/i386/libsa/strtol.c (revision 1741) +++ trunk/i386/libsa/strtol.c (revision 1742) @@ -148,7 +148,7 @@ break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; @@ -220,7 +220,7 @@ break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; @@ -291,7 +291,7 @@ break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1;