* Remove a few superfluous spaces

* Style fixes as per Axel
* Reintroduce removed OF_FAIL checks


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42460 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV
2011-07-21 01:44:45 +00:00
parent 372fe617b2
commit 75f0db355c
+23 -18
View File
@@ -62,28 +62,33 @@ determine_machine(void)
int root = of_finddevice("/"); int root = of_finddevice("/");
char buffer[64]; char buffer[64];
int length;
// TODO : Probe other OpenFirmware platforms and set gMachine as needed // TODO : Probe other OpenFirmware platforms and set gMachine as needed
int length = of_getprop(root, "device_type", buffer, sizeof(buffer) - 1); if ((length = of_getprop(root, "device_type", buffer, sizeof(buffer) - 1))
buffer[length] = '\0'; != OF_FAILED) {
buffer[length] = '\0';
if (!strcasecmp("chrp", buffer)) if (!strcasecmp("chrp", buffer))
gMachine = MACHINE_CHRP; gMachine = MACHINE_CHRP;
else //(bootrom) + QEMU else if (!strcasecmp("bootrom", buffer))
gMachine = MACHINE_MAC;
} else
gMachine = MACHINE_MAC; gMachine = MACHINE_MAC;
length = of_getprop(root, "model", buffer, sizeof(buffer) - 1); if ((length = of_getprop(root, "model", buffer, sizeof(buffer) - 1))
buffer[length] = '\0'; != OF_FAILED) {
buffer[length] = '\0';
if (!strcasecmp("pegasos", buffer))
gMachine |= MACHINE_PEGASOS;
}
if (!strcasecmp("pegasos", buffer)) if ((length = of_getprop(root, "name", buffer, sizeof(buffer) - 1))
gMachine |= MACHINE_PEGASOS; != OF_FAILED) {
buffer[length] = '\0';
length = of_getprop(root, "name", buffer, sizeof(buffer) - 1); if (!strcasecmp("openbiosteam,openbios", buffer))
buffer[length] = '\0'; gMachine |= MACHINE_QEMU;
}
if (!strcasecmp("openbiosteam,openbios", buffer))
gMachine |= MACHINE_QEMU;
} }
@@ -159,9 +164,9 @@ start(void *openFirmwareEntry)
determine_machine(); determine_machine();
console_init(); console_init();
if (gMachine & MACHINE_QEMU) if ((gMachine & MACHINE_QEMU) != 0)
dprintf("OpenBIOS (QEMU?) OpenFirmware machine detected\n"); dprintf("OpenBIOS (QEMU?) OpenFirmware machine detected\n");
else if (gMachine & MACHINE_PEGASOS) else if ((gMachine & MACHINE_PEGASOS) != 0)
dprintf("Pegasos PowerPC machine detected\n"); dprintf("Pegasos PowerPC machine detected\n");
else else
dprintf("Apple PowerPC machine assumed\n"); dprintf("Apple PowerPC machine assumed\n");