fix C compiler warnings and bug introduced by commit 13436

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13437 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2013-03-22 18:36:22 +00:00
parent 8d921d62a3
commit af0796ea30
4 changed files with 9 additions and 5 deletions

View File

@ -15,6 +15,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "alloc.h"
#include "backtrace.h"
#include "memory.h"

View File

@ -17,10 +17,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#ifdef HAS_UNISTD
#include <unistd.h>
#endif
#include "config.h"
#include "mlvalues.h"
#include "alloc.h"
#include "io.h"

View File

@ -194,7 +194,7 @@ caml_trace_value_file (value v, code_t prog, int proglen, FILE * f)
int l = 0;
switch (tg) {
case Closure_tag:
fprintf (f, "=closure[s%ld,cod%ld]", s, (code_t) (Code_val (v)) - prog);
fprintf (f, "=closure[s%d,cod%ld]", s, (code_t) (Code_val (v)) - prog);
goto displayfields;
case String_tag:
l = caml_string_length (v);
@ -249,11 +249,11 @@ caml_trace_accu_sp_file (value accu, value * sp, code_t prog, int proglen,
value *p;
fprintf (f, "accu=");
caml_trace_value_file (accu, prog, proglen, f);
fprintf (f, "\n sp=%#" ARCH_INTNAT_PRINTF_FORMAT "x @%d:",
fprintf (f, "\n sp=%#" ARCH_INTNAT_PRINTF_FORMAT "x @%ld:",
(intnat) sp, caml_stack_high - sp);
for (p = sp, i = 0; i < 12 + (1 << caml_trace_flag) && p < caml_stack_high;
p++, i++) {
fprintf (f, "\n[%d] ", caml_stack_high - p);
fprintf (f, "\n[%ld] ", caml_stack_high - p);
caml_trace_value_file (*p, prog, proglen, f);
};
putc ('\n', f);

View File

@ -1122,7 +1122,7 @@ value caml_interprete(code_t prog, asize_t prog_size)
#else
caml_fatal_error_arg("Fatal error: bad opcode (%"
ARCH_INTNAT_PRINTF_FORMAT "x)\n",
*(pc-1));
(char *) (intnat) *(pc-1));
#endif
}
}