diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-25 08:47:57 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-03-25 09:03:29 -0700 |
commit | b7a98993789d18bc675798d49038982d5cf41683 (patch) | |
tree | 664630027dfc0918c3fa61156435250063057e1d /src/lisp.h | |
parent | 176ababa8cf57564cf9374c15ffdc14fa76be39f (diff) | |
download | emacs-b7a98993789d18bc675798d49038982d5cf41683.tar.gz emacs-b7a98993789d18bc675798d49038982d5cf41683.tar.bz2 emacs-b7a98993789d18bc675798d49038982d5cf41683.zip |
Fix some integer issues in regex-emacs
Also, remove some duplicate comments related to thread.h.
* src/regex-emacs.h (struct re_registers):
* src/regex-emacs.c (SIGN_EXTEND_CHAR): Remove.
(TALLOC, RETALLOC): Remove. All uses replaced by usual
allocators, which check for integer overflow.
(extract_number): Redo without using ‘unsigned’.
(CHARSET_RANGE_TABLE_EXISTS_P): Clearly return a boolean.
(print_fastmap, print_partial_compiled_pattern, CHECK_INFINITE_LOOP)
(regex_compile, analyze_first, bcmp_translate, mutually_exclusive_p)
(re_match_2_internal):
Use bool for booleans.
(print_fastmap, regex_compile, execute_charset):
Prefer int to unsigned where either will do.
(print_double_string): Prefer ptrdiff_t to ssize_t, since the
latter can in theory be narrower than the former. Use fwrite
instead of repeated putchar.
(emacs_re_max_failures, fail_stack_type, compile_stack_type)
(re_wctype_parse, regex_compile, re_search, re_search_2)
(re_match_2, re_match_2_internal, re_compile_pattern):
Prefer ptrdiff_t to size_t where either will do.
(union fail_stack_elt, PUSH_FAILURE_REG, POP_FAILURE_REG_OR_COUNT):
Make the integer an intptr_t, not long.
(GET_BUFFER_SPACE, EXTEND_BUFFER, regex_compile):
Use xpalloc to simplify allocation.
(regex_compile): Check for integer overflow when calculating
register numbers.
* src/regex-emacs.c (re_set_registers, re_match_2_internal):
* src/regex-emacs.h (struct re_registers, struct re_pattern_buffer):
* src/search.c (Freplace_match):
Prefer ptrdiff_t to unsigned where either will do.
* src/regex-emacs.h (struct re_pattern_buffer):
Prefer bool_bf to unsigned where either will do.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/lisp.h b/src/lisp.h index 2508e2b804e..178eebed2a5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3233,11 +3233,6 @@ union specbinding } bt; }; -/* These 3 are defined as macros in thread.h. */ -/* extern union specbinding *specpdl; */ -/* extern union specbinding *specpdl_ptr; */ -/* extern ptrdiff_t specpdl_size; */ - INLINE ptrdiff_t SPECPDL_INDEX (void) { |