aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixes.Paul Eggert2011-12-111-1/+1
|
* Small init_lread fix for bug#10208Glenn Morris2011-12-061-10/+16
| | | | | * src/lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in installation and source directories as well.
* Spelling fixes.Paul Eggert2011-11-261-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.Paul Eggert2011-10-111-2/+4
| | | | Some packages use them to denote characters with modifiers.
* Fix typos.Juanma Barranquero2011-09-281-1/+1
|
* * lread.c (readevalloop): Use correct code for NBSP.Andreas Schwab2011-09-271-4/+4
| | | | (read1): Likewise. (Bug#9608)
* * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is.Lars Magne Ingebrigtsen2011-09-191-0/+2
| | | | Fixes: debbugs:9493
* Whitespace changes.Juanma Barranquero2011-09-091-1/+1
|
* * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.Paul Eggert2011-08-291-5/+11
| | | | Use esprintf, not sprintf, in case result does not fit in int.
* Merge from trunk.Paul Eggert2011-08-181-2/+26
|\
| * Fix bug #9311 with loading on MS-Windows .elc files in root directories.Eli Zaretskii2011-08-171-2/+26
| | | | | | | | | | src/lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file has no `load' handler, try opening the file locally.
* | Merge from trunk.Paul Eggert2011-07-281-0/+3
|\|
| * Implement ## reader macroAndreas Schwab2011-07-281-0/+3
| | | | | | | | | | | | * src/lread.c (read1): Read ## as empty symbol. * src/print.c (print_object): Print empty symbol as ##.
* | * lread.c (read1, init_obarray): Don't update size until alloc done.Paul Eggert2011-07-281-8/+12
|/
* Merge from trunk.Paul Eggert2011-07-191-28/+28
|\
| * * lread.c (syms_of_lread): Clarify when `lexical-binding' is usedLars Magne Ingebrigtsen2011-07-191-4/+3
| |
| * Fix last changeAndreas Schwab2011-07-171-1/+1
| |
| * Make read-symbol-positions-list more accurateAndreas Schwab2011-07-171-26/+14
| | | | | | | | | | * src/lread.c (read_integer): Unread even EOF character. (read1): Likewise. Properly record start position of symbol.
| * * src/lread.c (read1): Read `#:' as empty uninterned symbol if noAndreas Schwab2011-07-171-1/+14
| | | | | | | | symbol character follows.
* | Merge from trunk.Paul Eggert2011-07-161-3/+5
|\|
| * `lexical-binding' doc clarificationLars Magne Ingebrigtsen2011-07-151-3/+5
| | | | | | | | | | | | | | | | * lread.c (syms_of_lread): Clarify that is isn't only `eval-buffer' and `eval-defun' that's affected by `lexical-binding'. Fixes: debbugs:8460
* | Merge from trunk.Paul Eggert2011-07-101-3/+1
|\|
| * ProtoizeAndreas Schwab2011-07-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge) (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Protoize. * src/data.c (fmod): Likewise. * src/dispnew.c (swap_glyphs_in_rows): Likewise. * src/emacs.c (memory_warning_signal): Likewise. * src/floatfns.c (float_error): Likewise. * src/font.c (check_gstring, check_otf_features, otf_tag_symbol) (otf_open, font_otf_capability, generate_otf_features) (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor): Likewise. * src/image.c (pbm_read_file): Likewise. * src/indent.c (string_display_width): Likewise. * src/intervals.c (check_for_interval, search_for_interval) (inc_interval_count, count_intervals, root_interval) (adjust_intervals_for_insertion, make_new_interval): Likewise. * src/lread.c (defalias): Likewise. * src/regex.c (set_image_of_range_1, set_image_of_range) (regex_grow_registers): Likewise. * src/sysdep.c (strerror): Likewise. * src/termcap.c (valid_filename_p, tprint, main): Likewise. * src/tparam.c (main): Likewise. * src/unexhp9k800.c (run_time_remap, save_data_space) (update_file_ptrs, read_header, write_header, calculate_checksum) (copy_file, copy_rest, display_header): Likewise. * src/widget.c (mark_shell_size_user_specified, create_frame_gcs): Likewise. * src/xdisp.c (check_it): Likewise. * src/xfaces.c (register_color, unregister_color, unregister_colors): Likewise. * src/xfns.c (print_fontset_result): Likewise. * src/xrdb.c (member, fatal, main): Likewise.
* | Improve hashing quality when configured --with-wide-int.Paul Eggert2011-07-071-19/+0
|/ | | | | | | | | | | * fns.c (hash_string): New function, taken from sxhash_string. Do not discard information about ASCII character case; this discarding is no longer needed. (sxhash-string): Use it. Change sig to match it. Caller changed. * lisp.h: Declare it. * lread.c (hash_string): Remove, since we now use fns.c's version. The fns.c version returns a wider integer if --with-wide-int is specified, so this should help the quality of the hashing a bit.
* * lread.c (syms_of_lread): Mention single symbols defined byLars Magne Ingebrigtsen2011-07-021-3/+5
| | | | `defvar' or `defconst' (bug#7154).
* Move DEFSYM to lisp.h and use everywhere.Juanma Barranquero2011-06-241-73/+31
|
* * lread.c (read1): Check for size overflow.Paul Eggert2011-06-221-0/+6
|
* * lread.c (read_escape): Avoid int overflow.Paul Eggert2011-06-221-20/+20
| | | | | | | (Fload, openp, read_buffer_size, read1) (substitute_object_recurse, read_vector, read_list, map_obarray): Use ptrdiff_t, not int, for sizes. (read1): Use EMACS_INT, not int, for sizes.
* * lread.c: Integer overflow fixes.Paul Eggert2011-06-221-33/+46
| | | | | | | | (read_integer): Radix is now EMACS_INT, not int, to improve quality of diagnostics for out-of-range radices. Calculate buffer size correctly for out-of-range radices. (read1): Check for integer overflow in radices, and in read-circle numbers.
* * lread.c (read_escape): Check for hex character overflow.Paul Eggert2011-06-221-4/+3
|
* * lread.c: Integer overflow issues.Paul Eggert2011-06-221-10/+13
| | | | | | | | | (saved_doc_string_size, saved_doc_string_length) (prev_saved_doc_string_size, prev_saved_doc_string_length): Now ptrdiff_t, not int. (read1): Don't assume doc string length fits in int. Check for out-of-range doc string lengths. (read_list): Don't assume file position fits in int.
* * lread.c (intern, intern_c_string): Don't assume strlen fits in int.Paul Eggert2011-06-191-2/+2
|
* * lread.c (string_to_number): Simplify the 2011-04-26 change by invoking ↵Paul Eggert2011-06-181-1/+1
| | | | xsignal1.
* * lread.c (invalid_syntax): Omit length argument.Paul Eggert2011-06-181-18/+16
| | | | | | All uses changed. This doesn't fix a bug, but it simplifies the code away from its former Hollerith-constant appearance, and it's one less 'int' to worry about when looking at integer-overflow issues.
* * lread.c (Fload): Don't compare a possibly-garbage time_t value.Paul Eggert2011-06-121-4/+7
|
* Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.Paul Eggert2011-06-121-1/+1
| | | | | | These casts should not be needed on 32-bit hosts, either. * keyboard.c (read_char): * lread.c (Fload): Remove casts to unsigned.
* Fix the MS-Windows build broken by 2011-05-06T07:13:[email protected].Eli Zaretskii2011-05-061-0/+1
| | | | src/lread.c: Include limits.h.
* Merge from mainline.Paul Eggert2011-05-051-1/+5
|\
| * * src/lread.c (lisp_file_lexically_bound_p): Stop scanning at endAndreas Schwab2011-05-051-1/+5
| | | | | | | | marker. (Bug#8610)
* | * lread.c (read_integer): Be more consistent with string-to-number.Paul Eggert2011-05-011-48/+56
| | | | | | | | | | | | | | | | | | Use string_to_number to do the actual conversion; this avoids rounding errors and fixes some other screwups. Without this fix, for example, #x1fffffffffffffff was misread as -2305843009213693952. (digit_to_number): Move earlier, for benefit of read_integer. Return -1 if the digit is out of range for the base, -2 if it is not a digit in any supported base.
* | * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.Paul Eggert2011-04-291-1/+0
| |
* | * lread.c (hash_string): Use size_t, not int, for hash computation.Paul Eggert2011-04-271-10/+10
|/ | | | | | | | | Normally we prefer signed values; but hashing is special, because it's better to use unsigned division on hash table sizes so that the remainder is nonnegative. Also, size_t is the natural width for hashing into memory. The previous code used 'int', which doesn't retain enough info to hash well into very large tables. (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
* * lisp.h: (XVECTOR_SIZE): Remove. All uses replaced with ASIZE.Paul Eggert2011-04-251-10/+10
| | | | | (ASIZE): Now contains previous implementation of XVECTOR_SIZE instead of invoking XVECTOR_SIZE.
* lisp.h: Fix a problem with aliasing and vector headers.Paul Eggert2011-04-251-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6.0 optimizes based on type-based alias analysis. For example, if b is of type struct buffer * and v of type struct Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size != &v->size, and therefore "v->size = 1; b->size = 2; return v->size;" must therefore return 1. This assumption is incorrect for Emacs, since it type-puns struct Lisp_Vector * with many other types. To fix this problem, this patch adds a new type struct vector_header that documents the constraints on layout of vectors and pseudovectors, and helps optimizing compilers not get fooled by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons. * lisp.h (XVECTOR_SIZE): New convenience macro. All previous uses of XVECTOR (foo)->size replaced to use this macro, to avoid the hassle of writing XVECTOR (foo)->header.size. (XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR. (XSETTYPED_PVECTYPE): New macro, specifying the name of the size member. (XSETPVECTYPE): Rewrite in terms of new macro. (XSETPVECTYPESIZE): New macro, specifying both type and size. This is a bit clearer, and further avoids the possibility of undesirable aliasing. (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size. (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XVECTOR_HEADER_SIZE. (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE, since Lisp_Subr is a special case (no "next" field). (ASIZE): Rewrite in terms of XVECTOR_SIZE. (struct vector_header): New type. (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the object, to help avoid aliasing. (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP. (SUBRP): Likewise, since Lisp_Subr is a special case. * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table): (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector): (struct Lisp_Hash_Table): Combine first two members into a single struct vector_header member. All uses of "size" and "next" members changed to be "header.size" and "header.next". * buffer.h (struct buffer): Likewise. * font.h (struct font_spec, struct font_entity, struct font): Likewise. * frame.h (struct frame): Likewise. * process.h (struct Lisp_Process): Likewise. * termhooks.h (struct terminal): Likewise. * window.c (struct save_window_data, struct saved_window): Likewise. * window.h (struct window): Likewise. * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector): Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems. * buffer.c (init_buffer_once): Likewise. * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a special case. * process.c (Fformat_network_address): Use local var for size, for brevity.
* Remove empty line.Paul Eggert2011-04-211-1/+0
|
* * lread.c (string_to_number): Use strtoumax, to convert more integers ↵Paul Eggert2011-04-211-31/+29
| | | | without overflow.
* Treat large integers as floats in the Lisp reader and in string-to-number.Paul Eggert2011-04-201-90/+136
|
* Remove stray comment.Paul Eggert2011-04-201-3/+0
|
* Merge: Make the Lisp reader and string-to-float more consistent.Paul Eggert2011-04-191-80/+69
|\