X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/99027bdd81f63ea690394a153ef49a08f55e498d..6f81ab324c6c62c34b737f93ae54fd7e71ddf59f:/src/ccl.c diff --git a/src/ccl.c b/src/ccl.c index 63ceaeadad..d1783c2571 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -1,5 +1,5 @@ /* CCL (Code Conversion Language) interpreter. - Copyright (C) 2001-2012 Free Software Foundation, Inc. + Copyright (C) 2001-2013 Free Software Foundation, Inc. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 National Institute of Advanced Industrial Science and Technology (AIST) @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" @@ -1095,7 +1094,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size ccl_prog_stack_struct[stack_idx].ic = ic; ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; stack_idx++; - ccl_prog = XVECTOR (AREF (slot, 1))->contents; + ccl_prog = XVECTOR (AREF (slot, 1))->u.contents; ic = CCL_HEADER_MAIN; eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); } @@ -1937,9 +1936,9 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog) return -1; vp = XVECTOR (ccl_prog); ccl->size = vp->header.size; - ccl->prog = vp->contents; - ccl->eof_ic = XINT (vp->contents[CCL_HEADER_EOF]); - ccl->buf_magnification = XINT (vp->contents[CCL_HEADER_BUF_MAG]); + ccl->prog = vp->u.contents; + ccl->eof_ic = XINT (vp->u.contents[CCL_HEADER_EOF]); + ccl->buf_magnification = XINT (vp->u.contents[CCL_HEADER_BUF_MAG]); if (ccl->idx >= 0) { Lisp_Object slot; @@ -2098,7 +2097,7 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY outbufsize = (ccl.buf_magnification ? str_bytes * ccl.buf_magnification + 256 : str_bytes + 256); - outp = outbuf = (unsigned char *) xmalloc (outbufsize); + outp = outbuf = xmalloc (outbufsize); consumed_chars = consumed_bytes = 0; produced_chars = 0; @@ -2131,7 +2130,7 @@ usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBY produced_chars += ccl.produced; offset = outp - outbuf; shortfall = ccl.produced * max_expansion - (outbufsize - offset); - if (0 < shortfall) + if (shortfall > 0) { outbuf = xpalloc (outbuf, &outbufsize, shortfall, -1, 1); outp = outbuf + offset; @@ -2229,9 +2228,8 @@ Return index number of the registered CCL program. */) Vccl_program_table = larger_vector (Vccl_program_table, 1, -1); { - Lisp_Object elt; + Lisp_Object elt = make_uninit_vector (4); - elt = Fmake_vector (make_number (4), Qnil); ASET (elt, 0, name); ASET (elt, 1, ccl_prog); ASET (elt, 2, resolved);