From: <cli...@li...> - 2005-01-25 09:47:05
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src lispbibl.d,1.605,1.606 (Bruno Haible) 2. clisp/src format.lisp,1.43,1.44 (Bruno Haible) 3. clisp/src makemake.in,1.505,1.506 ChangeLog,1.4142,1.4143 (Bruno Haible) 4. clisp/modules/i18n gettext.c,1.4,1.5 (Bruno Haible) 5. clisp/modules/syscalls configure.in,1.19,1.20 calls.c,1.61,1.62 (Bruno Haible) 6. clisp/src ChangeLog,1.4143,1.4144 (Bruno Haible) 7. clisp/src configure.in,1.83,1.84 makemake.in,1.506,1.507 ChangeLog,1.4144,1.4145 (Bruno Haible) 8. clisp/utils gctrigger.d,1.3,1.4 (Bruno Haible) 9. clisp/src intelem.d,1.28,1.29 ChangeLog,1.4145,1.4146 (Bruno Haible) 10. clisp/src stream.d,1.497,1.498 NEWS,1.228,1.229 ChangeLog,1.4146,1.4147 (Bruno Haible) 11. clisp/src stream.d,1.415.2.11,1.415.2.12 ChangeLog,1.2750.2.86,1.2750.2.87 (Bruno Haible) --__--__-- Message: 1 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src lispbibl.d,1.605,1.606 Date: Tue, 25 Jan 2005 09:20:42 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22088/src Modified Files: lispbibl.d Log Message: Typo in comment. Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.605 retrieving revision 1.606 diff -u -d -r1.605 -r1.606 --- lispbibl.d 25 Jan 2005 09:19:30 -0000 1.605 +++ lispbibl.d 25 Jan 2005 09:20:38 -0000 1.606 @@ -9070,7 +9070,7 @@ /* used by FFI & modules */ #endif -# UP: allocates foreign adddress +# UP: allocates foreign address # allocate_faddress() # < result: LISP-object foreign address # can trigger GC --__--__-- Message: 2 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src format.lisp,1.43,1.44 Date: Tue, 25 Jan 2005 09:21:09 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22191/src Modified Files: format.lisp Log Message: Typo in comment. Index: format.lisp =================================================================== RCS file: /cvsroot/clisp/clisp/src/format.lisp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- format.lisp 21 Jan 2005 11:42:16 -0000 1.43 +++ format.lisp 25 Jan 2005 09:21:06 -0000 1.44 @@ -396,7 +396,7 @@ (if (null *FORMAT-NEXT-ARG*) (format-error 'error *FORMAT-CS* nil (TEXT "There are not enough arguments left for this format directive.")) - (format-error 'type-error :datum *FORMAT-NEXT-ARG* :expected-type 'list + (format-error 'type-error :datum *FORMAT-NEXT-ARG* :expected-type 'LIST *FORMAT-CS* nil (TEXT "The argument list is a dotted list: ~S") *FORMAT-ARG-LIST*)) @@ -2480,7 +2480,7 @@ (setq *FORMAT-CSDL* body-csdl) (labels ((compute-inner () `((PPRINT-LOGICAL-BLOCK - ;; *args refers to things *after* + ;; *args* refers to things *after* ;; anything used in the body. ;; I need some way to refer to ;; all the list. --__--__-- Message: 3 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src makemake.in,1.505,1.506 ChangeLog,1.4142,1.4143 Date: Tue, 25 Jan 2005 09:26:39 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22983/src Modified Files: makemake.in ChangeLog Log Message: Make the i18n module work also when GNU_GETTEXT is not defined. Index: makemake.in =================================================================== RCS file: /cvsroot/clisp/clisp/src/makemake.in,v retrieving revision 1.505 retrieving revision 1.506 diff -u -d -r1.505 -r1.506 --- makemake.in 24 Jan 2005 22:47:56 -0000 1.505 +++ makemake.in 25 Jan 2005 09:26:25 -0000 1.506 @@ -1884,11 +1884,7 @@ # i18n: essential for internationalized programs # syscalls: very useful for scripting # regexp: useful for scripting and text processing -if [ -n "$USE_GETTEXT" ]; then - echol "BASE_MODULES = i18n syscalls regexp" -else - echol "BASE_MODULES = syscalls regexp" -fi +echol "BASE_MODULES = i18n syscalls regexp" echol echol '# Programs used by "make":' if [ $CROSS = true ] ; then Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4142 retrieving revision 1.4143 diff -u -d -r1.4142 -r1.4143 --- ChangeLog 25 Jan 2005 09:19:36 -0000 1.4142 +++ ChangeLog 25 Jan 2005 09:26:36 -0000 1.4143 @@ -1,3 +1,9 @@ +2005-01-24 Bruno Haible <br...@cl...> + + * i18n/gettext.c (do_gettext, do_ngettext): Don't define if GNU_GETTEXT + is not defined. Needed for platforms without gettext(). + * makemake.in (BASE_MODULES): Add i18n always. + 2005-01-22 Bruno Haible <br...@cl...> * lispbibl.d (small_read_label_type): Renamed from read_label_type. --__--__-- Message: 4 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/modules/i18n gettext.c,1.4,1.5 Date: Tue, 25 Jan 2005 09:26:27 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/modules/i18n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22983/modules/i18n Modified Files: gettext.c Log Message: Make the i18n module work also when GNU_GETTEXT is not defined. Index: gettext.c =================================================================== RCS file: /cvsroot/clisp/clisp/modules/i18n/gettext.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gettext.c 17 Jan 2005 19:05:57 -0000 1.4 +++ gettext.c 25 Jan 2005 09:26:25 -0000 1.5 @@ -1,6 +1,6 @@ /* * ======= General internationalization, for Lisp programs too ======= - * Copyright (C) 1990-2004 Bruno Haible + * Copyright (C) 1990-2005 Bruno Haible * Copyright (C) 1998-2004 Sam Steingold * GPL2 */ @@ -35,6 +35,8 @@ DEFCHECKER(check_locale_category,"LC", ALL COLLATE CTYPE MESSAGES MONETARY \ NUMERIC TIME PAPER NAME ADDRESS TELEPHONE MEASUREMENT IDENTIFICATION) +#ifdef GNU_GETTEXT + static inline object do_gettext (const char* msgid, const char* domain, int category) { @@ -67,11 +69,13 @@ return asciz_to_string(translated_msg,Symbol_value(S(utf_8))); } +#endif + DEFUNR(I18N:GETTEXT, msgid &optional domain category) { /* returns the translation of msgid in the given domain, depending on the given category. */ object msgid = check_string(STACK_2); -# ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT with_string_0(msgid,Symbol_value(S(ascii)),msgid_asciz, { object domain = STACK_1; if (missingp(domain)) { @@ -85,9 +89,9 @@ }); } }); -# else + #else VALUES1(msgid); -# endif + #endif skipSTACK(3); } @@ -106,7 +110,7 @@ n = 1000000 + posfixnum_to_L(value1); } msgid = STACK_4; msgid_plural = STACK_3; -#ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT with_string_0(msgid,Symbol_value(S(ascii)),msgid_asciz, { with_string_0(msgid_plural,Symbol_value(S(ascii)),msgid_plural_asciz, { object domain = STACK_1; @@ -124,43 +128,43 @@ } }); }); -#else + #else VALUES1(n == 1 ? msgid : msgid_plural); -#endif + #endif skipSTACK(5); } DEFUNR(I18N:TEXTDOMAIN,) { /* returns the current default domain. */ -#ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT const char* domain; begin_system_call(); domain = textdomain(NULL); end_system_call(); VALUES1(asciz_to_string(domain,Symbol_value(S(ascii)))); -#else + #else VALUES1(NIL); -#endif + #endif } DEFUN(I18N:SET-TEXTDOMAIN, domain) { /* sets the default domain. */ object domain = check_string(popSTACK()); -#ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT with_string_0(domain,Symbol_value(S(ascii)),domain_asciz, { begin_system_call(); textdomain(domain_asciz); if_UNICODE(bind_textdomain_codeset(domain_asciz,"UTF-8")); end_system_call(); }); -#endif + #endif VALUES1(domain); } DEFUN(I18N:TEXTDOMAINDIR, domain) { /* returns the message catalog directory for the given domain. */ object domain = check_string(popSTACK()); - #ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT const char* dir; with_string_0(domain,Symbol_value(S(ascii)),domain_asciz, { begin_system_call(); @@ -168,15 +172,15 @@ end_system_call(); }); VALUES1(dir != NULL ? OSdir_to_pathname(dir) : (object)NIL); - #else + #else VALUES1(NIL); - #endif + #endif } DEFUN(I18N:SET-TEXTDOMAINDIR, domain directory) { /* sets the message catalog directory for the given domain. */ object domain = check_string(STACK_1); -#ifdef GNU_GETTEXT + #ifdef GNU_GETTEXT /* Check and use default directory, because the bindtextdomain() documentation recommends that the argument be an absolute pathname, to protect against later chdir() calls. */ @@ -186,7 +190,7 @@ bindtextdomain(domain_asciz,TheAsciz(directory)); end_system_call(); }); -#endif + #endif VALUES1(STACK_0); skipSTACK(2); } --__--__-- Message: 5 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/modules/syscalls configure.in,1.19,1.20 calls.c,1.61,1.62 Date: Tue, 25 Jan 2005 09:28:27 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/modules/syscalls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23313/modules/syscalls Modified Files: configure.in calls.c Log Message: FreeBSD 4.0: lgamma_r exists but is not usable if it's not declared. Index: calls.c =================================================================== RCS file: /cvsroot/clisp/clisp/modules/syscalls/calls.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- calls.c 17 Jan 2005 19:05:37 -0000 1.61 +++ calls.c 25 Jan 2005 09:28:24 -0000 1.62 @@ -1,6 +1,8 @@ /* * system calls * Copyright (C) 2003-2004 Sam Steingold + * Copyright (C) 2005 Bruno Haible + * Copyright (C) 2005 Arseny Slobodyuk * GPL2 */ @@ -188,9 +190,9 @@ DEFUNF(POSIX::Y1,x) { VAL_D(y1); mv_count=1; } DEFUNF(POSIX:YN,i y){ VAL_ID(yn); mv_count=1; } -#if defined(HAVE_LGAMMA) || defined(HAVE_LGAMMA_R) +#if defined(HAVE_LGAMMA) || defined(HAVE_DECL_LGAMMA_R) DEFUNF(POSIX::LGAMMA,x) { -# if defined(HAVE_LGAMMA_R) +# if defined(HAVE_DECL_LGAMMA_R) int sign; double res = lgamma_r(D_S,&sign); value2 = (sign > 0 ? Fixnum_1 : Fixnum_minus1); Index: configure.in =================================================================== RCS file: /cvsroot/clisp/clisp/modules/syscalls/configure.in,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- configure.in 11 Jan 2005 22:19:35 -0000 1.19 +++ configure.in 25 Jan 2005 09:28:24 -0000 1.20 @@ -36,7 +36,8 @@ getrlimit setrlimit getlogin getpwent getpwnam getpwuid getuid dnl fchmod fchown fstat link stat symlink utime mknod chmod chown umask) AC_SEARCH_LIBS(erf, m) -AC_CHECK_FUNCS(erf erfc lgamma lgamma_r fstatvfs statvfs) +AC_CHECK_FUNCS(erf erfc lgamma fstatvfs statvfs) +AC_CHECK_DECLS(lgamma_r, , , [#include <math.h>] ) AC_CHECK_DECLS(signgam, , , [#include <math.h>] ) AC_SEARCH_LIBS(crypt, crypt) AC_CHECK_FUNCS(crypt encrypt setkey GlobalMemoryStatusEx) --__--__-- Message: 6 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src ChangeLog,1.4143,1.4144 Date: Tue, 25 Jan 2005 09:28:28 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23313/src Modified Files: ChangeLog Log Message: FreeBSD 4.0: lgamma_r exists but is not usable if it's not declared. Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4143 retrieving revision 1.4144 diff -u -d -r1.4143 -r1.4144 --- ChangeLog 25 Jan 2005 09:26:36 -0000 1.4143 +++ ChangeLog 25 Jan 2005 09:28:25 -0000 1.4144 @@ -1,5 +1,13 @@ 2005-01-24 Bruno Haible <br...@cl...> + * syscalls/configure.in: Check whether lgamma_r is declared, assuming + that it is defined in this case. + * syscalls/calls.c (POSIX:LGAMMA): Use lgamma_r only if it's declared. + Needed for FreeBSD 4.0, which has lgamma and lgamma_r, but declares + lgamma_r only if _REENTRANT is defined. + +2005-01-24 Bruno Haible <br...@cl...> + * i18n/gettext.c (do_gettext, do_ngettext): Don't define if GNU_GETTEXT is not defined. Needed for platforms without gettext(). * makemake.in (BASE_MODULES): Add i18n always. --__--__-- Message: 7 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src configure.in,1.83,1.84 makemake.in,1.506,1.507 ChangeLog,1.4144,1.4145 Date: Tue, 25 Jan 2005 09:29:47 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23671/src Modified Files: configure.in makemake.in ChangeLog Log Message: Don't generate clisp.pdf if dvipdf does not exist. Index: configure.in =================================================================== RCS file: /cvsroot/clisp/clisp/src/configure.in,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- configure.in 10 Dec 2004 16:11:23 -0000 1.83 +++ configure.in 25 Jan 2005 09:29:38 -0000 1.84 @@ -1,5 +1,5 @@ dnl -*- Autoconf -*- configuration for CLISP -dnl Bruno Haible 1992-2004 +dnl Bruno Haible 1992-2005 dnl Sam Steingold 2002-2004 dnl dnl configure.in ---<autoconf>--->> configure @@ -44,6 +44,8 @@ CL_PROG_HLN dnl sets variable GROFF AC_CHECK_PROG(GROFF,groff,groff) +dnl sets variable DVIPDF +AC_CHECK_PROG(DVIPDF,dvipdf,dvipdf) dnl AC_MSG_NOTICE([* checks for UNIX variants that set DEFS]) dnl Index: makemake.in =================================================================== RCS file: /cvsroot/clisp/clisp/src/makemake.in,v retrieving revision 1.506 retrieving revision 1.507 diff -u -d -r1.506 -r1.507 --- makemake.in 25 Jan 2005 09:26:25 -0000 1.506 +++ makemake.in 25 Jan 2005 09:29:43 -0000 1.507 @@ -482,6 +482,7 @@ INSTALL_PROGRAM='@INSTALL_PROGRAM@' # either 'install -c' or 'cp' INSTALL_DATA='@INSTALL_DATA@' # either 'install -c -m 644' or 'cp' GROFF='@GROFF@' # either 'groff' or '' + DVIPDF='@DVIPDF@' # either 'dvipdf' or '' GMALLOC='@GMALLOC@' # either 'gmalloc' or '' LIBS='@LIBS@' # list of system libraries LIBTERMCAP='@LIBTERMCAP@' # either '-ltermcap' or '-lncurses' @@ -556,6 +557,7 @@ CC_NEED_DEEMA=false fi GROFF='groff' + DVIPDF='dvipdf' GMALLOC='' LIBS='' LIBICONV='' @@ -2031,6 +2033,9 @@ if test -n "$GROFF"; then echol "ROFF_DVI = ${ROFF_DVI}"' # try "groff -Tdvi -mandoc"' echol "ROFF_PS = ${ROFF_PS}"' # try "groff -Tps -mandoc"' + if test -n "$DVIPDF"; then + echol "DVIPDF = ${DVIPDF}" + fi fi echol echol '# -------------- End of configurable section --------------------' @@ -3237,7 +3242,10 @@ OBSOLETE=$OBSOLETE" genclisph${HEXE}" if test -n "$GROFF"; then - manual_dvi='clisp.dvi clisp.ps clisp.pdf' + manual_dvi='clisp.dvi clisp.ps' + if test -n "$DVIPDF"; then + manual_dvi="$manual_dvi clisp.pdf" + fi else manual_dvi='' fi @@ -3359,9 +3367,11 @@ # Use dvipdf, not ps2pdf, to generate clisp.pdf, because ps2pdf generates # bad quality output: It puts an undesired space after "fi", such as in # "file". - echol "clisp.pdf : clisp.dvi" - echotab "dvipdf clisp.dvi clisp.pdf" - echol + if test -n "$DVIPDF"; then + echol "clisp.pdf : clisp.dvi" + echotab "\$(DVIPDF) clisp.dvi clisp.pdf" + echol + fi fi echol "clisp.man : clisp.1" @@ -3484,7 +3494,9 @@ if test -n "$GROFF"; then echotab "\$(INSTALL_DATA) clisp.dvi \$(DESTDIR)\$(dvidir)/clisp.dvi" echotab "\$(INSTALL_DATA) clisp.ps \$(DESTDIR)\$(psdir)/clisp.ps" - echotab "\$(INSTALL_DATA) clisp.pdf \$(DESTDIR)\$(pdfdir)/clisp.pdf" + if test -n "$DVIPDF"; then + echotab "\$(INSTALL_DATA) clisp.pdf \$(DESTDIR)\$(pdfdir)/clisp.pdf" + fi fi ;; *bsd) Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4144 retrieving revision 1.4145 diff -u -d -r1.4144 -r1.4145 --- ChangeLog 25 Jan 2005 09:28:25 -0000 1.4144 +++ ChangeLog 25 Jan 2005 09:29:43 -0000 1.4145 @@ -1,5 +1,11 @@ 2005-01-24 Bruno Haible <br...@cl...> + * configure.in: Add check for dvipdf. + * makemake.in: Generate and install clisp.pdf only if DVIPDF is + nonempty. + +2005-01-24 Bruno Haible <br...@cl...> + * syscalls/configure.in: Check whether lgamma_r is declared, assuming that it is defined in this case. * syscalls/calls.c (POSIX:LGAMMA): Use lgamma_r only if it's declared. --__--__-- Message: 8 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/utils gctrigger.d,1.3,1.4 Date: Tue, 25 Jan 2005 09:31:42 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24229/utils Modified Files: gctrigger.d Log Message: Use 'var'. Index: gctrigger.d =================================================================== RCS file: /cvsroot/clisp/clisp/utils/gctrigger.d,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gctrigger.d 19 Jan 2005 14:26:57 -0000 1.3 +++ gctrigger.d 25 Jan 2005 09:31:39 -0000 1.4 @@ -844,7 +844,7 @@ else if (token.type == ident && String_equals(token.string,"maygc")) seen_maygc = TRUE; else if (seen_maygc && token.type == sep && token.ch == '(') { - VectorString parameters_of_type_object; + var VectorString parameters_of_type_object; handle_opening_token(&token); # Remember the variable names from the parameter list. VectorString_init(¶meters_of_type_object); --__--__-- Message: 9 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src intelem.d,1.28,1.29 ChangeLog,1.4145,1.4146 Date: Tue, 25 Jan 2005 09:32:53 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24337/src Modified Files: intelem.d ChangeLog Log Message: Fix compilation error with compilers other than GCC 3: use 'var'. Index: intelem.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/intelem.d,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- intelem.d 11 Jan 2005 16:38:44 -0000 1.28 +++ intelem.d 25 Jan 2005 09:32:48 -0000 1.29 @@ -1359,17 +1359,17 @@ /* bit sequence --> integer */ global maygc object udigits_to_I (void* digits, uintC len) { - uintL bn_size = ceiling(len,sizeof(uintD)); - uintD total = bn_size * sizeof(uintD); - void *data = (len == total ? digits : - total<=1024 ? alloca(total) : my_malloc(total)); + var uintL bn_size = ceiling(len,sizeof(uintD)); + var uintD total = bn_size * sizeof(uintD); + var void *data = (len == total ? digits : + total<=1024 ? alloca(total) : my_malloc(total)); if (data != digits) { /* len is not divisible by sizeof(uintD) */ begin_system_call(); memset(data,0,total); memcpy((char*)data + total - len,digits,len); end_system_call(); } - object ret = UDS_to_I(data,bn_size); + var object ret = UDS_to_I(data,bn_size); if (data != digits && total>1024) { begin_system_call(); free(data); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4145 retrieving revision 1.4146 diff -u -d -r1.4145 -r1.4146 --- ChangeLog 25 Jan 2005 09:29:43 -0000 1.4145 +++ ChangeLog 25 Jan 2005 09:32:49 -0000 1.4146 @@ -1,5 +1,10 @@ 2005-01-24 Bruno Haible <br...@cl...> + * intelem.d (udigits_to_I): Use 'var'. + * utils/gctrigger.d (convert): Likewise. + +2005-01-24 Bruno Haible <br...@cl...> + * configure.in: Add check for dvipdf. * makemake.in: Generate and install clisp.pdf only if DVIPDF is nonempty. --__--__-- Message: 10 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src stream.d,1.497,1.498 NEWS,1.228,1.229 ChangeLog,1.4146,1.4147 Date: Tue, 25 Jan 2005 09:37:54 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25013/src Modified Files: stream.d NEWS ChangeLog Log Message: Fix a crash triggered if iconv() swallows input characters, such as U+E0000. Index: NEWS =================================================================== RCS file: /cvsroot/clisp/clisp/src/NEWS,v retrieving revision 1.228 retrieving revision 1.229 diff -u -d -r1.228 -r1.229 --- NEWS 21 Jan 2005 17:35:59 -0000 1.228 +++ NEWS 25 Jan 2005 09:37:51 -0000 1.229 @@ -314,6 +314,9 @@ + Fixed a crash when using a hash-table as hash-table key. + Fixed a crash triggered by the READ-BYTE function on streams with element type ([UN]SIGNED-BYTE n), 24 < n < 32, on big-endian platforms. + + Fixed a crash that occurred on glibc platforms when writing Unicode + characters in the range #\U000E0000..#\U000E007F on a stream with an + encoding other than UTF-8. + An invalid bignum could be returned by GET-INTERNAL-RUN-TIME on 64-bit platforms. + Third party code walkers can now handle HANDLER-BIND et al. Index: stream.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/stream.d,v retrieving revision 1.497 retrieving revision 1.498 diff -u -d -r1.497 -r1.498 --- stream.d 21 Jan 2005 11:48:26 -0000 1.497 +++ stream.d 25 Jan 2005 09:37:28 -0000 1.498 @@ -482,6 +482,12 @@ var chart ch = char_code(TheStream(stream)->strm_rd_ch_last); var uintB buf[4]; # are there characters longer than 4 bytes?! var uintL char_len = cslen(enc,&ch,1); + ASSERT(char_len <= sizeof(buf)); + if (char_len == 0) { # the char corresponds to no bytes at all + TheStream(stream)->strmflags &= ~strmflags_unread_B; + TheStream(stream)->strm_rd_ch_last = NIL; + goto do_read_byte; + } cstombs(enc,&ch,1,buf,char_len); var uint8 code = buf[0]; if (char_len == 1) { # the char was just one byte @@ -504,8 +510,10 @@ return sfixnum((sint8)code); else return fixnum((uint8)code); - } else + } else { + do_read_byte: return rd_by(stream)(stream); + } } else { # Call the generic function (STREAM-READ-BYTE stream): pushSTACK(stream); funcall(S(stream_read_byte),1); @@ -5543,7 +5551,9 @@ Encoding_wcstombs(encoding) (encoding,stream,&cptr,cptr+1,&bptr,&buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],persev_full); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,persev_full); #else UnbufferedStreamLow_write(stream)(stream,as_cint(c)); #endif @@ -5565,8 +5575,10 @@ var uintB* bptr = &tmptmpbuf[0]; Encoding_wcstombs(encoding)(encoding,stream,&charptr,endptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],persev_full); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,persev_full); } while (charptr != endptr); #undef tmpbufsize #else @@ -5590,7 +5602,9 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cptr+1,&bptr, &buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],persev_full); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,persev_full); #else UnbufferedStreamLow_write(stream)(stream,as_cint(c)); #endif @@ -5630,8 +5644,10 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],persev_full); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,persev_full); #else UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)tmpbuf,n, persev_full); @@ -5664,7 +5680,9 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cp+n,&bptr, &buf[2*max_bytes_per_chart]); ASSERT(cptr == cp+n); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],persev_full); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,persev_full); #else if (chareq(c,ascii(NL))) { UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)crlf,2,persev_full); @@ -5709,8 +5727,10 @@ var uintB* bptr = &tmptmpbuf[0]; Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr,&tmptmpbuf[2*tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],persev_full); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,persev_full); #else UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)tmpbuf, tmpptr-&tmpbuf[0],persev_full); @@ -6806,9 +6826,11 @@ &buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,persev_full); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,persev_full); + # increment position + BufferedStream_position(stream) += buflen; + } #else write_byte_buffered(stream,as_cint(c)); # write unchanged #endif @@ -6831,9 +6853,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&charptr,endptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } until (charptr == endptr); #undef tmpbufsize #else @@ -6859,9 +6883,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cptr+1,&bptr,&buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,persev_full); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,persev_full); + # increment position + BufferedStream_position(stream) += buflen; + } #else write_byte_buffered(stream,as_cint(c)); #endif @@ -6900,9 +6926,11 @@ &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } remaining -= n; } while (remaining > 0); @@ -6942,9 +6970,11 @@ &buf[2*max_bytes_per_chart]); ASSERT(cptr == cp+n); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,persev_full); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,persev_full); + # increment position + BufferedStream_position(stream) += buflen; + } #else if (chareq(c,ascii(NL))) { write_byte_buffered(stream,CR); write_byte_buffered(stream,LF); @@ -6988,9 +7018,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr,&tmptmpbuf[2*tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,persev_full); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } remaining -= n; } while (remaining > 0); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4146 retrieving revision 1.4147 diff -u -d -r1.4146 -r1.4147 --- ChangeLog 25 Jan 2005 09:32:49 -0000 1.4146 +++ ChangeLog 25 Jan 2005 09:37:51 -0000 1.4147 @@ -1,5 +1,18 @@ 2005-01-24 Bruno Haible <br...@cl...> + * stream.d (read_byte, wr_ch_unbuffered_unix, + wr_ch_array_unbuffered_unix, wr_ch_unbuffered_mac, + wr_ch_array_unbuffered_mac, wr_ch_unbuffered_dos, + wr_ch_array_unbuffered_dos, wr_ch_buffered_unix, + wr_ch_array_buffered_unix, wr_ch_buffered_mac, + wr_ch_array_buffered_mac, wr_ch_buffered_dos, wr_ch_array_buffered_dos): + Don't assume that when the input of Encoding_wcstombs is nonempty, + the output is nonempty as well. For example, glibc converts #\U000E0000 + to an empty multibyte sequence for most encodings. + Reported by Pascal Bourguignon. + +2005-01-24 Bruno Haible <br...@cl...> + * intelem.d (udigits_to_I): Use 'var'. * utils/gctrigger.d (convert): Likewise. --__--__-- Message: 11 From: Bruno Haible <ha...@us...> To: cli...@li... Subject: clisp/src stream.d,1.415.2.11,1.415.2.12 ChangeLog,1.2750.2.86,1.2750.2.87 Date: Tue, 25 Jan 2005 09:45:29 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26706/src Modified Files: Tag: clisp_2_33-patched stream.d ChangeLog Log Message: Fix a crash when iconv() swallows input characters, such as #\U000E0000. Index: stream.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/stream.d,v retrieving revision 1.415.2.11 retrieving revision 1.415.2.12 diff -u -d -r1.415.2.11 -r1.415.2.12 --- stream.d 11 Dec 2004 15:30:28 -0000 1.415.2.11 +++ stream.d 25 Jan 2005 09:45:22 -0000 1.415.2.12 @@ -1,5 +1,5 @@ # Streams for CLISP -# Bruno Haible 1990-2004 +# Bruno Haible 1990-2005 # Sam Steingold 1998-2004 # Generic Streams: Marcus Daniels 8.4.1994 # SCREEN package for Win32: Arseny Slobodjuck 2001-02-14 @@ -473,6 +473,12 @@ var chart ch = char_code(TheStream(stream)->strm_rd_ch_last); var uintB buf[4]; # are there characters longer than 4 bytes?! var uintL char_len = cslen(enc,&ch,1); + ASSERT(char_len <= sizeof(buf)); + if (char_len == 0) { # the char corresponds to no bytes at all + TheStream(stream)->strmflags &= ~strmflags_unread_B; + TheStream(stream)->strm_rd_ch_last = NIL; + goto do_read_byte; + } cstombs(enc,&ch,1,buf,char_len); var uint8 code = buf[0]; if (char_len == 1) { # the char was just one byte @@ -495,8 +501,10 @@ return sfixnum((sint8)code); else return fixnum((uint8)code); - } else + } else { + do_read_byte: return rd_by(stream)(stream); + } } else { # Call the generic function (STREAM-READ-BYTE stream): pushSTACK(stream); funcall(S(stream_read_byte),1); @@ -5326,7 +5334,9 @@ Encoding_wcstombs(encoding) (encoding,stream,&cptr,cptr+1,&bptr,&buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],false); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,false); #else UnbufferedStreamLow_write(stream)(stream,as_cint(c)); #endif @@ -5348,8 +5358,10 @@ var uintB* bptr = &tmptmpbuf[0]; Encoding_wcstombs(encoding)(encoding,stream,&charptr,endptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],false); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,false); } while (charptr != endptr); #undef tmpbufsize #else @@ -5373,7 +5385,9 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cptr+1,&bptr, &buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],false); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,false); #else UnbufferedStreamLow_write(stream)(stream,as_cint(c)); #endif @@ -5413,8 +5427,10 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],false); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,false); #else UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)tmpbuf, n,false); @@ -5447,7 +5463,9 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cp+n,&bptr, &buf[2*max_bytes_per_chart]); ASSERT(cptr == cp+n); - UnbufferedStreamLow_write_array(stream)(stream,&buf[0],bptr-&buf[0],false); + var uintL buflen = bptr-&buf[0]; + if (buflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&buf[0],buflen,false); #else if (chareq(c,ascii(NL))) { UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)crlf,2,false); @@ -5492,8 +5510,10 @@ var uintB* bptr = &tmptmpbuf[0]; Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr,&tmptmpbuf[2*tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); - UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], - bptr-&tmptmpbuf[0],false); + var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; + if (tmptmpbuflen > 0) + UnbufferedStreamLow_write_array(stream)(stream,&tmptmpbuf[0], + tmptmpbuflen,false); #else UnbufferedStreamLow_write_array(stream)(stream,(const uintB*)tmpbuf, tmpptr-&tmpbuf[0],false); @@ -6539,9 +6559,11 @@ &buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,false); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,false); + # increment position + BufferedStream_position(stream) += buflen; + } #else write_byte_buffered(stream,as_cint(c)); # write unchanged #endif @@ -6564,9 +6586,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&charptr,endptr,&bptr, &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } until (charptr == endptr); #undef tmpbufsize #else @@ -6592,9 +6616,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,cptr+1,&bptr,&buf[max_bytes_per_chart]); ASSERT(cptr == &c+1); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,false); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,false); + # increment position + BufferedStream_position(stream) += buflen; + } #else write_byte_buffered(stream,as_cint(c)); #endif @@ -6633,9 +6659,11 @@ &tmptmpbuf[tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } remaining -= n; } while (remaining > 0); @@ -6675,9 +6703,11 @@ &buf[2*max_bytes_per_chart]); ASSERT(cptr == cp+n); var uintL buflen = bptr-&buf[0]; - write_byte_array_buffered(stream,&buf[0],buflen,false); - # increment position - BufferedStream_position(stream) += buflen; + if (buflen > 0) { + write_byte_array_buffered(stream,&buf[0],buflen,false); + # increment position + BufferedStream_position(stream) += buflen; + } #else if (chareq(c,ascii(NL))) { write_byte_buffered(stream,CR); write_byte_buffered(stream,LF); @@ -6721,9 +6751,11 @@ Encoding_wcstombs(encoding)(encoding,stream,&cptr,tmpptr,&bptr,&tmptmpbuf[2*tmpbufsize*max_bytes_per_chart]); ASSERT(cptr == tmpptr); var uintL tmptmpbuflen = bptr-&tmptmpbuf[0]; - write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); - # increment position - BufferedStream_position(stream) += tmptmpbuflen; + if (tmptmpbuflen > 0) { + write_byte_array_buffered(stream,&tmptmpbuf[0],tmptmpbuflen,false); + # increment position + BufferedStream_position(stream) += tmptmpbuflen; + } } remaining -= n; } while (remaining > 0); Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.2750.2.86 retrieving revision 1.2750.2.87 diff -u -d -r1.2750.2.86 -r1.2750.2.87 --- ChangeLog 24 Jan 2005 10:42:28 -0000 1.2750.2.86 +++ ChangeLog 25 Jan 2005 09:45:24 -0000 1.2750.2.87 @@ -1,3 +1,16 @@ +2005-01-24 Bruno Haible <br...@cl...> + + * stream.d (read_byte, wr_ch_unbuffered_unix, + wr_ch_array_unbuffered_unix, wr_ch_unbuffered_mac, + wr_ch_array_unbuffered_mac, wr_ch_unbuffered_dos, + wr_ch_array_unbuffered_dos, wr_ch_buffered_unix, + wr_ch_array_buffered_unix, wr_ch_buffered_mac, + wr_ch_array_buffered_mac, wr_ch_buffered_dos, wr_ch_array_buffered_dos): + Don't assume that when the input of Encoding_wcstombs is nonempty, + the output is nonempty as well. For example, glibc converts #\U000E0000 + to an empty multibyte sequence for most encodings. + Reported by Pascal Bourguignon. + 2005-01-22 Bruno Haible <br...@cl...> * io.d (pr_readlabel): Use oint_data_shift, not oint_addr_shift. --__--__-- _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest |