Minor changes to quiet the compiler.

* plug-ins/script-fu/re/re.c: Minor changes to quiet the compiler.

	* plug-ins/script-fu/tinyscheme/CHANGES: Updated to version from
	the 1.38 version of TinyScheme.

	* plug-ins/script-fu/tinyscheme/scheme.c: Added some changes from the
	1.38 version of TinyScheme. Added fix for bug #1589701 (reported on
	SourceForge.net).

	* plug-ins/script-fu/tinyscheme/scheme.h: Added a prototype to quiet
	the compiler. Added one change from the 1.38 version of TinyScheme.
This commit is contained in:
Kevin Cozens 2006-12-07 18:57:10 +00:00
parent 6ded475a12
commit 04a45e41dc
5 changed files with 54 additions and 22 deletions

View File

@ -1,3 +1,17 @@
2006-12-07 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/re/re.c: Minor changes to quiet the compiler.
* plug-ins/script-fu/tinyscheme/CHANGES: Updated to version from
the 1.38 version of TinyScheme.
* plug-ins/script-fu/tinyscheme/scheme.c: Added some changes from the
1.38 version of TinyScheme. Added fix for bug #1589701 (reported on
SourceForge.net).
* plug-ins/script-fu/tinyscheme/scheme.h: Added a prototype to quiet
the compiler. Added one change from the 1.38 version of TinyScheme.
2006-12-07 Michael Natterer <mitch@gimp.org> 2006-12-07 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrush.c (gimp_brush_class_init) * app/core/gimpbrush.c (gimp_brush_class_init)

View File

@ -14,6 +14,10 @@
/* Since not exported */ /* Since not exported */
#define T_STRING 1 #define T_STRING 1
pointer foreign_re_match(scheme *sc, pointer args);
EXPORT void init_re(scheme *sc);
static void set_vector_elem(pointer vec, int ielem, pointer newel) { static void set_vector_elem(pointer vec, int ielem, pointer newel) {
int n=ielem/2; int n=ielem/2;
if(ielem%2==0) { if(ielem%2==0) {
@ -34,7 +38,7 @@ pointer foreign_re_match(scheme *sc, pointer args) {
int num=0; int num=0;
if(!((args != sc->NIL) && sc->vptr->is_string((first_arg = sc->vptr->pair_car(args))) if(!((args != sc->NIL) && sc->vptr->is_string((first_arg = sc->vptr->pair_car(args)))
&& (args=sc->vptr->pair_cdr(args)) && (args=sc->vptr->pair_cdr(args))
&& sc->vptr->is_pair(args) && sc->vptr->is_string((second_arg = sc->vptr->pair_car(args))))) { && sc->vptr->is_pair(args) && sc->vptr->is_string((second_arg = sc->vptr->pair_car(args))))) {
return sc->F; return sc->F;
} }
@ -49,12 +53,12 @@ pointer foreign_re_match(scheme *sc, pointer args) {
num=third_arg->_object._number.value.ivalue; num=third_arg->_object._number.value.ivalue;
} }
} }
if(regcomp(&rt,pattern,REG_EXTENDED)!=0) { if(regcomp(&rt,pattern,REG_EXTENDED)!=0) {
return sc->F; return sc->F;
} }
if(num==0) { if(num==0) {
retcode=regexec(&rt,string,0,0,0); retcode=regexec(&rt,string,0,0,0);
} else { } else {
@ -62,14 +66,13 @@ pointer foreign_re_match(scheme *sc, pointer args) {
if(pmatch!=0) { if(pmatch!=0) {
retcode=regexec(&rt,string,num+1,pmatch,0); retcode=regexec(&rt,string,num+1,pmatch,0);
if(retcode==0) { if(retcode==0) {
int i; int i;
for(i=0; i<num; i++) { for(i=0; i<num; i++) {
#undef cons #undef cons
set_vector_elem(third_arg, i, set_vector_elem(third_arg, i,
sc->vptr->cons(sc, sc->vptr->mk_integer(sc, pmatch[i].rm_so), sc->vptr->cons(sc, sc->vptr->mk_integer(sc, pmatch[i].rm_so),
sc->vptr->mk_integer(sc, pmatch[i].rm_eo))); sc->vptr->mk_integer(sc, pmatch[i].rm_eo)));
}
}
} }
free(pmatch); free(pmatch);
} else { } else {
@ -77,19 +80,20 @@ pointer foreign_re_match(scheme *sc, pointer args) {
retcode=-1; retcode=-1;
} }
} }
if(retcode==0) { if(retcode==0) {
retval=sc->T; retval=sc->T;
} }
regfree(&rt); regfree(&rt);
return(retval); return(retval);
} }
#if 0
static char* utilities=";; return the substring of STRING matched in MATCH-VECTOR, \n" static char* utilities=";; return the substring of STRING matched in MATCH-VECTOR, \n"
";; the Nth subexpression match (default 0).\n" ";; the Nth subexpression match (default 0).\n"
"(define (re-match-nth string match-vector . n)\n" "(define (re-match-nth string match-vector . n)\n"
" (let ((n (if (pair? n) (car n) 0)))\n" " (let ((n (if (pair? n) (car n) 0)))\n"
" (substring string (car (vector-ref match-vector n))\n" " (substring string (car (vector-ref match-vector n))\n"
" (cdr (vector-ref match-vector n)))))\n" " (cdr (vector-ref match-vector n)))))\n"
@ -100,8 +104,9 @@ static char* utilities=";; return the substring of STRING matched in MATCH-VECTO
" (let ((n (if (pair? n) (car n) 0)))\n" " (let ((n (if (pair? n) (car n) 0)))\n"
" (substring string (cdr (vector-ref match-vector n))\n" " (substring string (cdr (vector-ref match-vector n))\n"
" (string-length string))))\n"; " (string-length string))))\n";
#endif
EXPORT void init_re(scheme *sc) { void init_re(scheme *sc) {
sc->vptr->scheme_define(sc,sc->global_env,sc->vptr->mk_symbol(sc,"re-match"),sc->vptr->mk_foreign_func(sc, foreign_re_match)); sc->vptr->scheme_define(sc,sc->global_env,sc->vptr->mk_symbol(sc,"re-match"),sc->vptr->mk_foreign_func(sc, foreign_re_match));
/* sc->vptr->load_string(sc,utilities);*/ /* sc->vptr->load_string(sc,utilities);*/
} }

View File

@ -1,12 +1,16 @@
Change Log Change Log
---------- ----------
Version 1.38
Interim release until the rewrite, mostly incorporating modifications from
Kevin Cozens. Small addition for Cygwin in the makefile, and modifications
by Andrew Guenther for Apple platforms.
Version 1.37 Version 1.37
Joe Buehler submitted reserve_cells. Joe Buehler submitted reserve_cells.
Version 1.36 Version 1.36
Joe Buehler fixed a patch in the allocator. Joe Buehler fixed a patch in the allocator.
Alexander Shendi moved the comment handling in the scanner, which Alexander Shendi moved the comment handling in the scanner, which
fixed an obscure bug for which Mike E had provided a patch as well. fixed an obscure bug for which Mike E had provided a patch as well.
Kevin Kozens has submitted some fixes and modifications which have not Kevin Cozens has submitted some fixes and modifications which have not
been incorporated yet in their entirety. been incorporated yet in their entirety.
Version 1.35 Version 1.35
Todd Showalter discovered that the number of free cells reported Todd Showalter discovered that the number of free cells reported

View File

@ -74,6 +74,9 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifndef __APPLE__
# include <malloc.h>
#endif
#define stricmp utf8_stricmp #define stricmp utf8_stricmp
@ -1497,6 +1500,8 @@ static gunichar inchar(scheme *sc) {
file_pop(sc); file_pop(sc);
if(sc->nesting!=0) { if(sc->nesting!=0) {
return EOF; return EOF;
} else {
return '\n';
} }
goto again; goto again;
} }
@ -4687,7 +4692,7 @@ void scheme_call(scheme *sc, pointer func, pointer args) {
#if STANDALONE #if STANDALONE
#if defined(macintosh) && !defined (OSX) #if defined(__APPLE__) && !defined (OSX)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
extern MacTS_main(int argc, char **argv); extern MacTS_main(int argc, char **argv);

View File

@ -14,6 +14,9 @@
#endif #endif
#ifndef _MSC_VER #ifndef _MSC_VER
# ifndef USE_STRLWR
# define USE_STRLWR 1
# endif
# define SCHEME_EXPORT # define SCHEME_EXPORT
#else #else
# define USE_STRLWR 0 # define USE_STRLWR 0
@ -138,7 +141,8 @@ pointer mk_string(scheme *sc, const char *str);
pointer mk_counted_string(scheme *sc, const char *str, int len); pointer mk_counted_string(scheme *sc, const char *str, int len);
pointer mk_character(scheme *sc, gunichar c); pointer mk_character(scheme *sc, gunichar c);
pointer mk_foreign_func(scheme *sc, foreign_func f); pointer mk_foreign_func(scheme *sc, foreign_func f);
void putstr(scheme *sc, const char *s); void putcharacter(scheme *sc, gunichar c);
void putstr(scheme *sc, const char *s);
void set_safe_foreign (scheme *sc, pointer data); void set_safe_foreign (scheme *sc, pointer data);