Applied changes from official version of TinyScheme which adds tests for
2008-09-14 Kevin Cozens <kcozens@cvs.gnome.org> * plug-ins/script-fu/tinyscheme/scheme.c (mk_vector), (opexe_2): Applied changes from official version of TinyScheme which adds tests for when mk_vector is out of memory. Can't rely on sc->sink. svn path=/trunk/; revision=26943
This commit is contained in:

committed by
Kevin Cozens

parent
460b0ffbfd
commit
600274e85d
@ -1,3 +1,9 @@
|
||||
2008-09-14 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/tinyscheme/scheme.c (mk_vector), (opexe_2):
|
||||
Applied changes from official version of TinyScheme which adds
|
||||
tests for when mk_vector is out of memory. Can't rely on sc->sink.
|
||||
|
||||
2008-09-13 Michael Schumacher <schumaml@cvs.gnome.org>
|
||||
|
||||
* app/actions/edit-actions.c (edit_actions): removed double "the"
|
||||
@ -11,7 +17,7 @@
|
||||
2008-09-12 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/tinyscheme/scheme.c
|
||||
* plug-ins/script-fu/tinyscheme/scheme.h: Applied changes froh
|
||||
* plug-ins/script-fu/tinyscheme/scheme.h: Applied changes from
|
||||
official version of TinyScheme which expose more of the internals.
|
||||
Part of making it more suitable for Scheme->C->Scheme calling.
|
||||
See SourceForge bug #1599947.
|
||||
|
@ -1026,6 +1026,7 @@ INTERFACE pointer mk_empty_string(scheme *sc, int len, gunichar fill) {
|
||||
|
||||
INTERFACE static pointer mk_vector(scheme *sc, int len) {
|
||||
pointer x=get_consecutive_cells(sc,len/2+len%2+1);
|
||||
if(sc->no_memory) { return sc->sink; }
|
||||
typeflag(x) = (T_VECTOR | T_ATOM);
|
||||
ivalue_unchecked(x)=len;
|
||||
set_num_integer(x);
|
||||
@ -3443,6 +3444,7 @@ static pointer opexe_2(scheme *sc, enum scheme_opcodes op) {
|
||||
Error_1(sc,"vector: not a proper list:",sc->args);
|
||||
}
|
||||
vec=mk_vector(sc,len);
|
||||
if(sc->no_memory) { s_return(sc, sc->sink); }
|
||||
for (x = sc->args, i = 0; is_pair(x); x = cdr(x), i++) {
|
||||
set_vector_elem(vec,i,car(x));
|
||||
}
|
||||
@ -3460,6 +3462,7 @@ static pointer opexe_2(scheme *sc, enum scheme_opcodes op) {
|
||||
fill=cadr(sc->args);
|
||||
}
|
||||
vec=mk_vector(sc,len);
|
||||
if(sc->no_memory) { s_return(sc, sc->sink); }
|
||||
if(fill!=sc->NIL) {
|
||||
fill_vector(vec,fill);
|
||||
}
|
||||
|
Reference in New Issue
Block a user