Commit 1e85ae98 authored by Kevin Cozens's avatar Kevin Cozens

Applied changes from SVN version 95 of official version of TinyScheme

Added missing "const" in scheme_registerable structure.
parent 229ab7ca
......@@ -1949,7 +1949,8 @@ static INLINE int skipspace(scheme *sc) {
/* record it */
#if SHOW_ERROR_LINE
sc->load_stack[sc->file_i].rep.stdio.curr_line += curr_line;
if (sc->load_stack[sc->file_i].kind & port_file)
sc->load_stack[sc->file_i].rep.stdio.curr_line += curr_line;
#endif
if(c!=EOF) {
......@@ -1988,7 +1989,7 @@ static int token(scheme *sc) {
;
#if SHOW_ERROR_LINE
if(c == '\n')
if(c == '\n' && sc->load_stack[sc->file_i].kind & port_file)
sc->load_stack[sc->file_i].rep.stdio.curr_line++;
#endif
......@@ -2021,7 +2022,7 @@ static int token(scheme *sc) {
;
#if SHOW_ERROR_LINE
if(c == '\n')
if(c == '\n' && sc->load_stack[sc->file_i].kind & port_file)
sc->load_stack[sc->file_i].rep.stdio.curr_line++;
#endif
......@@ -2497,7 +2498,8 @@ static pointer _Error_1(scheme *sc, const char *s, pointer a) {
char sbuf[STRBUFFSIZE];
/* make sure error is not in REPL */
if(sc->load_stack[sc->file_i].rep.stdio.file != stdin) {
if (sc->load_stack[sc->file_i].kind & port_file &&
sc->load_stack[sc->file_i].rep.stdio.file != stdin) {
int ln = sc->load_stack[sc->file_i].rep.stdio.curr_line;
const char *fname = sc->load_stack[sc->file_i].rep.stdio.filename;
......@@ -4431,7 +4433,7 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
if (c != '\n')
backchar(sc,c);
#if SHOW_ERROR_LINE
else
else if (sc->load_stack[sc->file_i].kind & port_file)
sc->load_stack[sc->file_i].rep.stdio.curr_line++;
#endif
sc->nesting_stack[sc->file_i]--;
......@@ -5082,11 +5084,12 @@ void scheme_deinit(scheme *sc) {
}
#if SHOW_ERROR_LINE
fname = sc->load_stack[i].rep.stdio.filename;
for(i=0; i<sc->file_i; i++) {
if(fname)
sc->free(fname);
if (sc->load_stack[sc->file_i].kind & port_file) {
fname = sc->load_stack[i].rep.stdio.filename;
if(fname)
sc->free(fname);
}
}
#endif
}
......
......@@ -249,7 +249,7 @@ struct scheme_interface {
typedef struct scheme_registerable
{
foreign_func f;
char * name;
const char * name;
}
scheme_registerable;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment