Mercurial > emacs
comparison src/ccl.c @ 30344:9f2a382a22e3
(Fccl_execute_on_string): Don't check xmalloc return. Use xfree, not
free.
author | Dave Love <fx@gnu.org> |
---|---|
date | Thu, 20 Jul 2000 12:50:09 +0000 |
parents | d9e5b40d33c5 |
children | 4687d69de88a |
comparison
equal
deleted
inserted
replaced
30343:21d1c542f98e | 30344:9f2a382a22e3 |
---|---|
1892 if (ccl.ic < i && i < ccl.size) | 1892 if (ccl.ic < i && i < ccl.size) |
1893 ccl.ic = i; | 1893 ccl.ic = i; |
1894 } | 1894 } |
1895 outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256; | 1895 outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256; |
1896 outbuf = (char *) xmalloc (outbufsize); | 1896 outbuf = (char *) xmalloc (outbufsize); |
1897 if (!outbuf) | |
1898 error ("Not enough memory"); | |
1899 ccl.last_block = NILP (contin); | 1897 ccl.last_block = NILP (contin); |
1900 produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf, | 1898 produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf, |
1901 STRING_BYTES (XSTRING (str)), outbufsize, (int *)0); | 1899 STRING_BYTES (XSTRING (str)), outbufsize, (int *)0); |
1902 for (i = 0; i < 8; i++) | 1900 for (i = 0; i < 8; i++) |
1903 XSET (XVECTOR (status)->contents[i], Lisp_Int, ccl.reg[i]); | 1901 XSET (XVECTOR (status)->contents[i], Lisp_Int, ccl.reg[i]); |
1906 | 1904 |
1907 if (NILP (unibyte_p)) | 1905 if (NILP (unibyte_p)) |
1908 val = make_string (outbuf, produced); | 1906 val = make_string (outbuf, produced); |
1909 else | 1907 else |
1910 val = make_unibyte_string (outbuf, produced); | 1908 val = make_unibyte_string (outbuf, produced); |
1911 free (outbuf); | 1909 xfree (outbuf); |
1912 QUIT; | 1910 QUIT; |
1913 if (ccl.status != CCL_STAT_SUCCESS | 1911 if (ccl.status != CCL_STAT_SUCCESS |
1914 && ccl.status != CCL_STAT_SUSPEND_BY_SRC | 1912 && ccl.status != CCL_STAT_SUSPEND_BY_SRC |
1915 && ccl.status != CCL_STAT_SUSPEND_BY_DST) | 1913 && ccl.status != CCL_STAT_SUSPEND_BY_DST) |
1916 error ("Error in CCL program at %dth code", ccl.ic); | 1914 error ("Error in CCL program at %dth code", ccl.ic); |