[MLton-commit] r4458
Matthew Fluet
MLton@mlton.org
Thu, 4 May 2006 13:43:21 -0700
Casts
----------------------------------------------------------------------
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c
U mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
U mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c
----------------------------------------------------------------------
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Dirstream.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -5,7 +5,7 @@
}
C_Errno_t(C_DirP_t) Posix_FileSys_Dirstream_openDir (NullString8_t p) {
- DIR *res = opendir ((char *) p);
+ DIR *res = opendir ((const char *) p);
return (C_Errno_t(C_DirP_t))res;
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/Posix/FileSys/Stat.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -61,7 +61,7 @@
}
C_Errno_t(C_Int_t) Posix_FileSys_Stat_lstat (NullString8_t f) {
- return lstat ((char*)f, &statbuf);
+ return lstat ((const char*)f, &statbuf);
}
C_Errno_t(C_Int_t) Posix_FileSys_Stat_stat (NullString8_t f) {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawne.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -3,23 +3,23 @@
#if HAS_SPAWN
C_Errno_t(C_Int_t) MLton_Process_spawne (NullString8_t p, NullString8Array_t a, NullString8Array_t e) {
const char *path;
- char *asaved;
- char *esaved;
- char **args;
- char **env;
+ const char *asaved;
+ const char *esaved;
+ const char **args;
+ const char **env;
int an;
int en;
int res;
path = (const char *) p;
- args = (char **) a;
- env = (char **) e;
+ args = (const char **) a;
+ env = (const char **) e;
an = GC_arrayNumElements((pointer)a) - 1;
asaved = args[an];
en = GC_arrayNumElements((pointer)e) - 1;
esaved = env[en];
- args[an] = (char *) NULL;
- env[en] = (char *) NULL;
+ args[an] = (const char *) NULL;
+ env[en] = (const char *) NULL;
res = spawnve (SPAWN_MODE, path,
(const char * const *)args,
(const char * const *)env);
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/MLton/Process/spawnp.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -3,16 +3,16 @@
#if HAS_SPAWN
C_Errno_t(C_Int_t) MLton_Process_spawnp (NullString8_t p, NullString8Array_t a) {
const char *file;
- char *asaved;
- char **args;
+ const char *asaved;
+ const char **args;
int an;
int res;
path = (const char *) p;
- args = (char **) a;
+ args = (const char **) a;
an = GC_arrayNumElements((pointer)a) - 1;
asaved = args[an];
- args[an] = (char *) NULL;
+ args[an] = (const char *) NULL;
result = spawnvp (SPAWN_MODE, path,
(const char * const *)args);
args[an] = asaved;
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetProtDB.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -21,7 +21,7 @@
}
Bool_t NetProtDB_getByName(NullString8_t name) {
- protoent = getprotobyname((char*)name);
+ protoent = getprotobyname((const char*)name);
return (protoent != NULL and protoent->p_name != NULL);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/NetServDB.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -28,7 +28,7 @@
}
Bool_t NetServDB_getByName(NullString8_t name, NullString8_t proto) {
- servent = getservbyname((char*)name, (char*)proto);
+ servent = getservbyname((const char*)name, (const char*)proto);
return (servent != NULL and servent->s_name != NULL);
}
@@ -37,7 +37,7 @@
}
Bool_t NetServDB_getByPort(C_Int_t port, NullString8_t proto) {
- servent = getservbyport(port, (char*)proto);
+ servent = getservbyport(port, (const char*)proto);
return (servent != NULL and servent->s_name != NULL);
}
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Net/Socket/UnixSock.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -36,7 +36,7 @@
void Socket_UnixSock_fromAddr (Vector(Word8_t) addr, Array(Char8_t) path, C_Size_t pathlen) {
size_t i;
- struct sockaddr_un *sa = (struct sockaddr_un*)addr;
+ const struct sockaddr_un *sa = (const struct sockaddr_un*)addr;
assert (sa->sun_family == AF_UNIX);
for (i = 0; i < pathlen; i++) {
Modified: mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c 2006-05-04 20:24:20 UTC (rev 4457)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/basis/Real/strto.c 2006-05-04 20:43:20 UTC (rev 4458)
@@ -1,13 +1,13 @@
#include "platform.h"
-Real32_t gdtoa_strtof (char *s, char **endptr);
-Real64_t gdtoa_strtod (char *s, char **endptr);
+Real32_t gdtoa_strtof (const char *s, char **endptr);
+Real64_t gdtoa_strtod (const char *s, char **endptr);
Real32_t Real32_strto (NullString8_t s) {
char *endptr;
Real32_t res;
- res = gdtoa_strtof ((char*)s, &endptr);
+ res = gdtoa_strtof ((const char*)s, &endptr);
assert (NULL != endptr);
return res;
}
@@ -16,7 +16,7 @@
char *endptr;
Real64_t res;
- res = gdtoa_strtod ((char*)s, &endptr);
+ res = gdtoa_strtod ((const char*)s, &endptr);
assert (NULL != endptr);
return res;
}