Check cell type for T_NUMBER in addition to checking if it is an integer.

2006-11-26  Kevin Cozens  <kcozens@cvs.gnome.org>

	* plug-ins/script-fu/tinyscheme/scheme.c (is_integer): Check cell
	type for T_NUMBER in addition to checking if it is an integer.
	Fixes TinyScheme bug #1593861 reported on SourceForge. Fixed
	prototype for dump_mark_stack(). Quieted compiler warnings.

	* plug-ins/script-fu/scripts/script-fu-compat.init: Added delq,
	prin1, and print.
This commit is contained in:
Kevin Cozens 2006-11-26 19:50:21 +00:00 committed by Kevin Cozens
parent b871025caa
commit 1dead8dfb2
3 changed files with 45 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2006-11-26 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/tinyscheme/scheme.c (is_integer): Check cell
type for T_NUMBER in addition to checking if it is an integer.
Fixes TinyScheme bug #1593861 reported on SourceForge. Fixed
prototype for dump_mark_stack(). Quieted compiler warnings.
* plug-ins/script-fu/scripts/script-fu-compat.init: Added delq,
prin1, and print.
2006-11-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrushclipboard.c

View File

@ -128,6 +128,26 @@
;Items below this line are for compatability with Script-Fu but
;may be useful enough to keep around
(define (delq item lis)
(let ((l))
(if (null? lis)
(set! l '())
(begin
(set! l (car lis))
(set! lis (cdr lis))
(while (not (null? lis))
(if (not (= item (car lis)))
(set! l (append l (list (car lis))))
)
(set! lis (cdr lis))
)
)
)
l
)
)
(define (make-list count fill)
(vector->list (make-vector count fill))
)
@ -227,6 +247,13 @@
(define nil '())
(define nreverse reverse)
(define pow expt)
(define prin1 write)
(define (print obj . port)
(apply write obj port)
(newline)
)
(define strcat string-append)
(define string-lessp string<?)
(define symbol-bound? defined?)

View File

@ -182,7 +182,7 @@ INTERFACE static pointer vector_elem(pointer vec, int ielem);
INTERFACE static pointer set_vector_elem(pointer vec, int ielem, pointer a);
INTERFACE INLINE int is_number(pointer p) { return (type(p)==T_NUMBER); }
INTERFACE INLINE int is_integer(pointer p) {
return ((p)->_object._number.is_fixnum);
return (type(p)==T_NUMBER && (p)->_object._number.is_fixnum);
}
INTERFACE INLINE int is_real(pointer p) {
return (!(p)->_object._number.is_fixnum);
@ -382,7 +382,7 @@ static pointer reverse_in_place(scheme *sc, pointer term, pointer list);
static pointer append(scheme *sc, pointer a, pointer b);
static int list_length(scheme *sc, pointer a);
static int eqv(pointer a, pointer b);
static void dump_stack_mark(scheme *);
static INLINE void dump_stack_mark(scheme *);
static pointer opexe_0(scheme *sc, enum scheme_opcodes op);
static pointer opexe_1(scheme *sc, enum scheme_opcodes op);
static pointer opexe_2(scheme *sc, enum scheme_opcodes op);
@ -394,6 +394,10 @@ static void Eval_Cycle(scheme *sc, enum scheme_opcodes op);
static void assign_syntax(scheme *sc, char *name);
static int syntaxnum(pointer p);
static void assign_proc(scheme *sc, enum scheme_opcodes, char *name);
scheme *scheme_init_new(void);
#if !STANDALONE
void scheme_call(scheme *sc, pointer func, pointer args);
#endif
#define num_ivalue(n) (n.is_fixnum?(n).value.ivalue:(long)(n).value.rvalue)
#define num_rvalue(n) (!n.is_fixnum?(n).value.rvalue:(double)(n).value.ivalue)
@ -4432,7 +4436,7 @@ static struct scheme_interface vtbl ={
};
#endif
scheme *scheme_init_new() {
scheme *scheme_init_new(void) {
scheme *sc=(scheme*)malloc(sizeof(scheme));
if(!scheme_init(sc)) {
free(sc);
@ -4684,7 +4688,7 @@ void scheme_call(scheme *sc, pointer func, pointer args) {
#if STANDALONE
#if defined(macintosh) && !defined (OSX)
int main()
int main(int argc, char **argv)
{
extern MacTS_main(int argc, char **argv);
char** argv;