[MLton-commit] r4532

Matthew Fluet MLton@mlton.org
Sat, 13 May 2006 08:50:25 -0700


Exposed a few more coercions in INTEGER_EXTRA to accommodate different
signedness in C system types.


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

U   mlton/branches/on-20050822-x86_64-branch/basis-library/integer/integer.sig
U   mlton/branches/on-20050822-x86_64-branch/basis-library/posix/file-sys.sml
U   mlton/branches/on-20050822-x86_64-branch/basis-library/posix/proc-env.sml

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

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/integer/integer.sig
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/integer/integer.sig	2006-05-13 15:49:28 UTC (rev 4531)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/integer/integer.sig	2006-05-13 15:50:25 UTC (rev 4532)
@@ -69,6 +69,8 @@
       val gtu: int * int -> bool
       val geu: int * int -> bool
 
+      val toLargeInt: int -> LargeInt.int
+      val fromLargeInt: LargeInt.int -> int
       val fromSysWord: SysWord.word -> int
       val toSysWord: int -> SysWord.word
    end
@@ -118,6 +120,8 @@
       val gtu: int * int -> bool
       val geu: int * int -> bool
 
+      val toLargeInt: int -> LargeInt.int
+      val fromLargeInt: LargeInt.int -> int
       val fromSysWord: SysWord.word -> int
       val toSysWord: int -> SysWord.word
    end

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/posix/file-sys.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/posix/file-sys.sml	2006-05-13 15:49:28 UTC (rev 4531)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/posix/file-sys.sml	2006-05-13 15:50:25 UTC (rev 4532)
@@ -283,12 +283,12 @@
       end
 
       type dev = C_Dev.t
-      val wordToDev = C_Dev.fromLargeWord o SysWord.toLargeWord
-      val devToWord = SysWord.fromLargeWord o C_Dev.toLargeWord
+      val wordToDev = C_Dev.fromSysWord
+      val devToWord = C_Dev.toSysWord
 
       type ino = C_INo.t
-      val wordToIno = C_INo.fromLargeWord o SysWord.toLargeWord
-      val inoToWord = SysWord.fromLargeWord o C_INo.toLargeWord
+      val wordToIno = C_INo.fromSysWord
+      val inoToWord = C_INo.toSysWord
 
       structure ST =
          struct

Modified: mlton/branches/on-20050822-x86_64-branch/basis-library/posix/proc-env.sml
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/basis-library/posix/proc-env.sml	2006-05-13 15:49:28 UTC (rev 4531)
+++ mlton/branches/on-20050822-x86_64-branch/basis-library/posix/proc-env.sml	2006-05-13 15:50:25 UTC (rev 4532)
@@ -35,10 +35,10 @@
 
       fun setsid () = SysCall.simpleResult (Prim.setsid)
 
-      val uidToWord = SysWord.fromLarge o C_UId.toLarge
-      val wordToUid = C_UId.fromLarge o SysWord.toLarge
-      val gidToWord = SysWord.fromLarge o C_GId.toLarge
-      val wordToGid = C_GId.fromLarge o SysWord.toLarge
+      val uidToWord = C_UId.toSysWord
+      val wordToUid = C_UId.fromSysWord
+      val gidToWord = C_GId.toSysWord
+      val wordToGid = C_GId.fromSysWord
 
       fun getgroups () =
          SysCall.syscall
@@ -228,7 +228,7 @@
 
          fun cvt (ticks: C_Clock.t) =
             Time.fromTicks (LargeInt.quot
-                            (LargeInt.* (C_Clock.toLarge ticks,
+                            (LargeInt.* (C_Clock.toLargeInt ticks,
                                          Time.ticksPerSecond),
                              ticksPerSec))
       in