[MLton-commit] r7396

Matthew Fluet fluet at mlton.org
Tue Jan 19 10:58:39 PST 2010


Perform casts within function, rather than by casting function prototype.
----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/darwin.c
U   mlton/trunk/runtime/platform/freebsd.c
U   mlton/trunk/runtime/platform/hpux.c
U   mlton/trunk/runtime/platform/linux.c
U   mlton/trunk/runtime/platform/mingw.c
U   mlton/trunk/runtime/platform/netbsd.c
U   mlton/trunk/runtime/platform/openbsd.c
U   mlton/trunk/runtime/platform/solaris.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/darwin.c
===================================================================
--- mlton/trunk/runtime/platform/darwin.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/darwin.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -17,9 +17,10 @@
         (void)system (buffer);
 }
 
-static void catcher (__attribute__ ((unused)) int sig,  
-                     __attribute__ ((unused)) siginfo_t *sip, 
-                     ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
 #if (defined(__powerpc__) || defined(__ppc__))
 #if __DARWIN_UNIX03
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext->__ss.__srr0);

Modified: mlton/trunk/runtime/platform/freebsd.c
===================================================================
--- mlton/trunk/runtime/platform/freebsd.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/freebsd.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -14,9 +14,10 @@
         (void)system (buffer);
 }
 
-static void catcher (__attribute__ ((unused)) int sig,
-                     __attribute__ ((unused)) siginfo_t *sip,
-                     ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
 #if (defined (__x86_64__))
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.mc_rip);
 #elif (defined (__i386__))

Modified: mlton/trunk/runtime/platform/hpux.c
===================================================================
--- mlton/trunk/runtime/platform/hpux.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/hpux.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -82,10 +82,10 @@
 }
 
 
-static void catcher (__attribute__ ((unused)) int sig,
-                     __attribute__ ((unused)) siginfo_t* sip,
-                     void* mystery) {
-        ucontext_t* ucp = (ucontext_t*)mystery;
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) (ucp->uc_link));
 }
 

Modified: mlton/trunk/runtime/platform/linux.c
===================================================================
--- mlton/trunk/runtime/platform/linux.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/linux.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -13,50 +13,50 @@
 #define EIP     14
 #endif
 
-static void catcher (__attribute__ ((unused)) int sig, 
-                     __attribute__ ((unused)) siginfo_t* sip, 
-                     void* mystery) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
 #if (defined (__x86_64__))
 #define REG_INDEX(NAME) (offsetof(struct sigcontext, NAME) / sizeof(greg_t))
 #ifndef REG_RIP
 #define REG_RIP REG_INDEX(rip) /* seems to be 16 */
 #endif
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.gregs[REG_RIP]);
 #elif (defined (__alpha__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) (ucp->uc_mcontext.sc_pc));
 #elif (defined (__hppa__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) (ucp->uc_mcontext.sc_iaoq[0] & ~0x3UL));
 #elif (defined(__ia64__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->_u._mc.sc_ip);
 #elif (defined (__ppc__)) || (defined (__powerpc__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.regs->nip);
 #elif (defined (__sparc__))
-        struct sigcontext* scp = (struct sigcontext*)mystery;
+        struct sigcontext* scp = (struct sigcontext*)context;
 #if __WORDSIZE == 64
         GC_handleSigProf ((code_pointer) scp->sigc_regs.tpc);
 #else
         GC_handleSigProf ((code_pointer) scp->si_regs.pc);
 #endif
 #elif (defined (__mips__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
 #ifdef __UCLIBC__
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.gpregs[CTX_EPC]);
 #else
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.pc);
 #endif
 #elif (defined (__i386__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.gregs[EIP]);
 #elif (defined (__arm__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.arm_pc);
 #elif (defined (__s390__))
-        ucontext_t* ucp = (ucontext_t*)mystery;
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.psw.addr);
 #else
 #error Profiling handler is missing for this architecture

Modified: mlton/trunk/runtime/platform/mingw.c
===================================================================
--- mlton/trunk/runtime/platform/mingw.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/mingw.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -330,7 +330,7 @@
 
 }
 
-static void catcher(__attribute__ ((unused)) int sig) {
+static void catcher(__attribute__ ((unused)) int signo) {
         CONTEXT context;
         context.ContextFlags = CONTEXT_CONTROL;
 

Modified: mlton/trunk/runtime/platform/netbsd.c
===================================================================
--- mlton/trunk/runtime/platform/netbsd.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/netbsd.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -8,9 +8,10 @@
 #include "sysctl.c"
 #include "use-mmap.c"
 
-static void catcher (__attribute__ ((unused)) int sig,
-                     __attribute__ ((unused)) siginfo_t *sip, 
-                     ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.__gregs[_REG_EIP]);
 }
 

Modified: mlton/trunk/runtime/platform/openbsd.c
===================================================================
--- mlton/trunk/runtime/platform/openbsd.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/openbsd.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -8,9 +8,10 @@
 #include "sysctl.c"
 #include "use-mmap.c"
 
-static void catcher (__attribute__ ((unused)) int sig,
-                     __attribute__ ((unused)) siginfo_t *sip,
-                     ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->sc_eip);
 }
 

Modified: mlton/trunk/runtime/platform/solaris.c
===================================================================
--- mlton/trunk/runtime/platform/solaris.c	2010-01-19 18:58:30 UTC (rev 7395)
+++ mlton/trunk/runtime/platform/solaris.c	2010-01-19 18:58:33 UTC (rev 7396)
@@ -76,9 +76,10 @@
         system (buffer);
 }
 
-static void catcher (__attribute__ ((unused)) int sig,
-                     __attribute__ ((unused)) siginfo_t *sip,
-                     ucontext_t *ucp) {
+static void catcher (__attribute__ ((unused)) int signo,
+                     __attribute__ ((unused)) siginfo_t* info,
+                     void* context) {
+        ucontext_t* ucp = (ucontext_t*)context;
         GC_handleSigProf ((code_pointer) ucp->uc_mcontext.gregs[REG_PC]);
 }
 




More information about the MLton-commit mailing list