fix build errors

This commit is contained in:
Yuichi Nishiwaki 2016-02-25 21:10:29 +09:00
parent 8a9a1200d8
commit 22d339c2f7
4 changed files with 6 additions and 8 deletions

View File

@ -38,11 +38,9 @@ pic_get_backtrace(pic_state *pic)
#if PIC_USE_WRITE
void
pic_print_error(pic_state *pic, xFILE *file)
pic_print_error(pic_state *pic, xFILE *file, pic_value err)
{
pic_value err = pic_err(pic), port = pic_open_port(pic, file);
assert(! pic_invalid_p(pic, err));
pic_value port = pic_open_port(pic, file);
if (! pic_error_p(pic, err)) {
pic_fprintf(pic, port, "raise: ~s", err);

View File

@ -98,7 +98,7 @@ xFILE *xfopen_null(pic_state *, const char *mode);
void pic_warnf(pic_state *, const char *, ...);
pic_value pic_get_backtrace(pic_state *);
#if PIC_USE_WRITE
void pic_print_error(pic_state *, xFILE *);
void pic_print_error(pic_state *, xFILE *, pic_value err);
#endif
#if defined(__cplusplus)

View File

@ -255,7 +255,7 @@ pic_number_string_to_number(pic_state *pic)
int radix = 10;
long num;
char *eptr;
pic_value flo, e;
pic_value flo = pic_false_value(pic), e;
pic_get_args(pic, "z|i", &str, &radix);
@ -271,7 +271,7 @@ pic_number_string_to_number(pic_state *pic)
}
pic_catch(e) {
/* swallow error */
flo = pic_false_value(pic);
(void)e;
}
if (pic_int_p(pic, flo) || pic_float_p(pic, flo)) {

View File

@ -45,7 +45,7 @@ main(int argc, char *argv[], char **envp)
status = 0;
}
pic_catch(e) {
pic_print_error(pic, xstderr);
pic_print_error(pic, xstderr, e);
status = 1;
}