summaryrefslogtreecommitdiffstats
path: root/byterun/startup.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/startup.c')
-rw-r--r--byterun/startup.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/byterun/startup.c b/byterun/startup.c
index 80ffe90b5..ab926efe2 100644
--- a/byterun/startup.c
+++ b/byterun/startup.c
@@ -79,7 +79,7 @@ static void init_atoms(void)
/* Read the trailer of a bytecode file */
-static void fixup_endianness_trailer(uint32 * p)
+static void fixup_endianness_trailer(uint32_t * p)
{
#ifndef ARCH_BIG_ENDIAN
Reverse_32(p, p);
@@ -153,7 +153,7 @@ void caml_read_section_descriptors(int fd, struct exec_trailer *trail)
Return the length of the section data in bytes, or -1 if no section
found with that name. */
-int32 caml_seek_optional_section(int fd, struct exec_trailer *trail, char *name)
+int32_t caml_seek_optional_section(int fd, struct exec_trailer *trail, char *name)
{
long ofs;
int i;
@@ -172,9 +172,9 @@ int32 caml_seek_optional_section(int fd, struct exec_trailer *trail, char *name)
/* Position fd at the beginning of the section having the given name.
Return the length of the section data in bytes. */
-int32 caml_seek_section(int fd, struct exec_trailer *trail, char *name)
+int32_t caml_seek_section(int fd, struct exec_trailer *trail, char *name)
{
- int32 len = caml_seek_optional_section(fd, trail, name);
+ int32_t len = caml_seek_optional_section(fd, trail, name);
if (len == -1)
caml_fatal_error_arg("Fatal_error: section `%s' is missing\n", name);
return len;
@@ -185,7 +185,7 @@ int32 caml_seek_section(int fd, struct exec_trailer *trail, char *name)
static char * read_section(int fd, struct exec_trailer *trail, char *name)
{
- int32 len;
+ int32_t len;
char * data;
len = caml_seek_optional_section(fd, trail, name);
@@ -246,10 +246,10 @@ static int parse_command_line(char **argv)
#endif
case 'v':
if (!strcmp (argv[i], "-version")){
- printf ("The OCaml runtime, version " OCAML_VERSION "\n");
+ printf ("The OCaml runtime, version " OCAML_VERSION_STRING "\n");
exit (0);
}else if (!strcmp (argv[i], "-vnum")){
- printf (OCAML_VERSION "\n");
+ printf (OCAML_VERSION_STRING "\n");
exit (0);
}else{
caml_verb_gc = 0x001+0x004+0x008+0x010+0x020;
@@ -374,7 +374,8 @@ CAMLexport void caml_main(char **argv)
/* Should we really do that at all? The current executable is ocamlrun
itself, it's never a bytecode program. */
- if (fd < 0 && caml_executable_name(proc_self_exe, sizeof(proc_self_exe)) == 0) {
+ if (fd < 0
+ && caml_executable_name(proc_self_exe, sizeof(proc_self_exe)) == 0) {
exe_name = proc_self_exe;
fd = caml_attempt_open(&exe_name, &trail, 0);
}
@@ -458,7 +459,7 @@ CAMLexport void caml_startup_code(
char **argv)
{
value res;
- char* cds_file;
+ char * cds_file;
char * exe_name;
static char proc_self_exe[256];
@@ -472,8 +473,7 @@ CAMLexport void caml_startup_code(
#endif
cds_file = getenv("CAML_DEBUG_FILE");
if (cds_file != NULL) {
- caml_cds_file = caml_stat_alloc(strlen(cds_file) + 1);
- strcpy(caml_cds_file, cds_file);
+ caml_cds_file = caml_strdup(cds_file);
}
parse_camlrunparam();
exe_name = argv[0];