Mercurial > emacs
changeset 106950:ddd257e3f816
Make string pointer args point to const as in other string allocation functions.
* lisp.h (make_pure_string): String pointer arg now points to const.
* alloc.c (find_string_data_in_pure, make_pure_string): String pointer
args now point to const.
author | YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
---|---|
date | Fri, 22 Jan 2010 18:10:04 +0900 |
parents | 86ae2a69cf52 |
children | 89c890863220 |
files | src/ChangeLog src/alloc.c src/lisp.h |
diffstat | 3 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Fri Jan 22 10:44:50 2010 +0200 +++ b/src/ChangeLog Fri Jan 22 18:10:04 2010 +0900 @@ -1,3 +1,10 @@ +2010-01-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * lisp.h (make_pure_string): String pointer arg now points to const. + + * alloc.c (find_string_data_in_pure, make_pure_string): String pointer + args now point to const. + 2010-01-22 Eli Zaretskii <eliz@gnu.org> * lread.c (Fload): Don't treat files without .elc extension as
--- a/src/alloc.c Fri Jan 22 10:44:50 2010 +0200 +++ b/src/alloc.c Fri Jan 22 18:10:04 2010 +0900 @@ -4725,11 +4725,11 @@ static char * find_string_data_in_pure (data, nbytes) - char *data; + const char *data; int nbytes; { int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max; - unsigned char *p; + const unsigned char *p; char *non_lisp_beg; if (pure_bytes_used_non_lisp < nbytes + 1) @@ -4740,7 +4740,7 @@ for (i = 0; i < 256; i++) bm_skip[i] = skip; - p = (unsigned char *) data; + p = (const unsigned char *) data; while (--skip > 0) bm_skip[*p++] = skip; @@ -4754,7 +4754,7 @@ infinity = pure_bytes_used_non_lisp + 1; bm_skip['\0'] = infinity; - p = (unsigned char *) non_lisp_beg + nbytes; + p = (const unsigned char *) non_lisp_beg + nbytes; start = 0; do { @@ -4796,7 +4796,7 @@ Lisp_Object make_pure_string (data, nchars, nbytes, multibyte) - char *data; + const char *data; int nchars, nbytes; int multibyte; {
--- a/src/lisp.h Fri Jan 22 10:44:50 2010 +0200 +++ b/src/lisp.h Fri Jan 22 18:10:04 2010 +0900 @@ -2686,7 +2686,7 @@ extern Lisp_Object make_string_from_bytes P_ ((const char *, int, int)); extern Lisp_Object make_specified_string P_ ((const char *, int, int, int)); EXFUN (Fpurecopy, 1); -extern Lisp_Object make_pure_string P_ ((char *, int, int, int)); +extern Lisp_Object make_pure_string P_ ((const char *, int, int, int)); extern Lisp_Object make_pure_c_string (const char *data); extern Lisp_Object pure_cons P_ ((Lisp_Object, Lisp_Object)); extern Lisp_Object make_pure_vector P_ ((EMACS_INT));