|
From: <ljs...@us...> - 2007-08-04 02:42:39
|
Revision: 432
http://cadcdev.svn.sourceforge.net/cadcdev/?rev=432&view=rev
Author: ljsebald
Date: 2007-08-03 19:42:38 -0700 (Fri, 03 Aug 2007)
Log Message:
-----------
No more cast expressions as lvalues...
Modified Paths:
--------------
kos/kernel/arch/dreamcast/kernel/exec.c
kos/kernel/arch/dreamcast/kernel/init.c
Modified: kos/kernel/arch/dreamcast/kernel/exec.c
===================================================================
--- kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-03 04:26:06 UTC (rev 431)
+++ kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-04 02:42:38 UTC (rev 432)
@@ -85,7 +85,7 @@
/* Jump to the trampoline */
{
void (*trampoline)() __noreturn;
- ((uint32 *)trampoline) = buffer;
+ *((uint32 *) &trampoline) = (uint32)buffer;
trampoline();
}
}
Modified: kos/kernel/arch/dreamcast/kernel/init.c
===================================================================
--- kos/kernel/arch/dreamcast/kernel/init.c 2007-08-03 04:26:06 UTC (rev 431)
+++ kos/kernel/arch/dreamcast/kernel/init.c 2007-08-04 02:42:38 UTC (rev 432)
@@ -23,6 +23,8 @@
extern int _bss_start, end;
+void _atexit_call_all();
+
/* Ditto */
int main(int argc, char **argv);
@@ -251,13 +253,15 @@
/* Called to jump back to the BIOS menu; assumes a normal shutdown is possible */
void arch_menu() {
+ void (*menu)(int) __noreturn;
+
/* Shut down */
arch_shutdown();
/* Jump to the menus */
dbglog(DBG_CRITICAL, "arch: exiting the system to the BIOS menu\n");
-
- { void (*menu)(int) __noreturn; ((uint32 *)menu) = *((uint32 *)0x8c0000e0); menu(1); }
+ *((uint32 *) &menu) = *((uint32 *) 0x8c0000e0);
+ menu(1);
}
/* Called to shut down non-gracefully; assume the system is in peril
@@ -287,11 +291,14 @@
/* Called to reboot the system; assume the system is in peril and don't
try to call the dtors */
void arch_reboot() {
+ void (*rb)() __noreturn;
+
dbglog(DBG_CRITICAL, "arch: rebooting the system\n");
/* Ensure that interrupts are disabled */
irq_disable();
/* Reboot */
- { void (*rb)() __noreturn; ((uint32*)rb) = (uint32 *)0xa0000000; rb(); }
+ *((uint32 *) &rb) = 0xa0000000;
+ rb();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|