[gimp/soc-2011-seamless-clone2] Applied changes from SVN version 95 of official version of TinyScheme Added missing "const" in schem
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2011-seamless-clone2] Applied changes from SVN version 95 of official version of TinyScheme Added missing "const" in schem
- Date: Wed, 8 May 2013 15:09:22 +0000 (UTC)
commit df667a0719197113f0afbb2e52813008c3638037
Author: Kevin Cozens <kevin ve3syb ca>
Date: Sun Mar 31 14:55:11 2013 -0400
Applied changes from SVN version 95 of official version of TinyScheme
Added missing "const" in scheme_registerable structure.
plug-ins/script-fu/tinyscheme/scheme.c | 21 ++++++++++++---------
plug-ins/script-fu/tinyscheme/scheme.h | 2 +-
2 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c
index b2120c4..81d4da5 100644
--- a/plug-ins/script-fu/tinyscheme/scheme.c
+++ b/plug-ins/script-fu/tinyscheme/scheme.c
@@ -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
}
diff --git a/plug-ins/script-fu/tinyscheme/scheme.h b/plug-ins/script-fu/tinyscheme/scheme.h
index 5b60dff..198182c 100644
--- a/plug-ins/script-fu/tinyscheme/scheme.h
+++ b/plug-ins/script-fu/tinyscheme/scheme.h
@@ -249,7 +249,7 @@ struct scheme_interface {
typedef struct scheme_registerable
{
foreign_func f;
- char * name;
+ const char * name;
}
scheme_registerable;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]