diff --git a/ChangeLog b/ChangeLog index d98ba148ac..3460d1eb80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-05-25 Kevin Cozens + + * plug-ins/script-fu/Makefile.am: Missed commit of this file. + + * plug-ins/script-fu/scheme-wrapper.h: + * plug-ins/script-fu/scheme-wrapper.c (ts_output_string): Updated + to expect a 'const char *' and an int but no file pointer. + + * plug-ins/script-fu/tinyscheme/scheme.c: + * plug-ins/script-fu/tinyscheme/scheme.h: Changes due to use of + 'const char *' for ts_output_routine. + 2007-05-25 Kevin Cozens This is the first part of fixing bugs #438997 and #440674. diff --git a/plug-ins/script-fu/Makefile.am b/plug-ins/script-fu/Makefile.am index 3d516a671e..6a8bc4dae5 100644 --- a/plug-ins/script-fu/Makefile.am +++ b/plug-ins/script-fu/Makefile.am @@ -18,6 +18,7 @@ WINSOCK_LIBS = -lws2_32 endif AM_CFLAGS = \ + -DSTANDALONE=0 \ -DUSE_INTERFACE=1 \ -DUSE_STRLWR=0 \ -I$(top_srcdir) \ diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c index 4c6c5c0b34..6147445eec 100644 --- a/plug-ins/script-fu/scheme-wrapper.c +++ b/plug-ins/script-fu/scheme-wrapper.c @@ -254,11 +254,11 @@ ts_get_success_msg (void) } void -ts_output_string (FILE *fp, char *string, int len) +ts_output_string (const char *string, int len) { g_return_if_fail (len >= 0); - if (len > 0 && ts_console_mode && fp == stdout) + if (len > 0 && ts_console_mode) { /* len is the number of UTF-8 characters; we need the number of bytes */ len = g_utf8_offset_to_pointer (string, len) - string; diff --git a/plug-ins/script-fu/scheme-wrapper.h b/plug-ins/script-fu/scheme-wrapper.h index 61fa28eef5..c7e3b56bc0 100644 --- a/plug-ins/script-fu/scheme-wrapper.h +++ b/plug-ins/script-fu/scheme-wrapper.h @@ -34,7 +34,7 @@ void tinyscheme_init (const gchar *path, gboolean local_register_scripts); void tinyscheme_deinit (void); -void ts_output_string (FILE *fp, char *string, int len); +void ts_output_string (const char *string, int len); /* if the return value is 0, success. error otherwise. */ gint ts_interpret_string (const gchar *); diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c index ecd6b24549..0ea8365228 100644 --- a/plug-ins/script-fu/tinyscheme/scheme.c +++ b/plug-ins/script-fu/tinyscheme/scheme.c @@ -384,7 +384,7 @@ scheme *scheme_init_new(void); #if !STANDALONE void scheme_call(scheme *sc, pointer func, pointer args); -void (*ts_output_routine) (char *, int) = NULL; +void (*ts_output_routine) (const char *, int) = NULL; #endif #define num_ivalue(n) (n.is_fixnum?(n).value.ivalue:(long)(n).value.rvalue) @@ -1577,7 +1577,7 @@ static void putchars(scheme *sc, const char *chars, int char_cnt) { /* If output is still directed to stdout (the default) it should be */ /* safe to redirect it to the routine pointed to by ts_output_routine. */ if (pt->rep.stdio.file == stdout && ts_output_routine != NULL) - (*ts_output_routine) ((char *)chars, char_cnt); + (*ts_output_routine) (chars, char_cnt); else { fwrite(chars,1,char_cnt,pt->rep.stdio.file); fflush(pt->rep.stdio.file); diff --git a/plug-ins/script-fu/tinyscheme/scheme.h b/plug-ins/script-fu/tinyscheme/scheme.h index 90fcd220f5..4c2540c8d7 100644 --- a/plug-ins/script-fu/tinyscheme/scheme.h +++ b/plug-ins/script-fu/tinyscheme/scheme.h @@ -115,7 +115,7 @@ typedef struct num { } num; #if !STANDALONE -SCHEME_EXPORT void (*ts_output_routine) (char *, int); +SCHEME_EXPORT void (*ts_output_routine) (const char *, int); #endif SCHEME_EXPORT scheme *scheme_init_new();