summaryrefslogtreecommitdiff
path: root/src/chartab.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix minor problems found by static checking.Paul Eggert2011-07-081-7/+1
| | | | | | | | * chartab.c (char_table_set_range, map_sub_char_table) (uniprop_table_uncompress): Remove unused locals. (uniprop_table): Now static. * composite.c (_work_char): Remove unused static var. * gtkutil.c (qttip_cb): Remove stray no-effect statement.
* chartab.c (sub_char_table_set_range): Fix previous change.Kenichi Handa2011-07-071-1/+1
|
* Add C interface for Unicode character property table.Kenichi Handa2011-07-071-72/+507
|
* * chartab.c (Fchar_table_range): Use CHARACTERP to check range.Paul Eggert2011-06-121-3/+3
| | | | | Otherwise, an out-of-range integer could cause undefined behavior on a 64-bit host.
* lisp.h: Fix a problem with aliasing and vector headers.Paul Eggert2011-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Undo the DEFUN->DEFUE change.Paul Eggert2011-04-131-6/+6
|
* * chartab.c (chartab_chars, chartab_bits): Now static.Paul Eggert2011-04-101-2/+2
|
* Make Emacs functions such as Fatom 'static' by default.Paul Eggert2011-04-101-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it easier for human readers (and static analyzers) to see whether these functions can be called from other modules. DEFUN now defines a static function. To make the function external so that it can be used in other C modules, use the new macro DEFUE. * lisp.h (DEFINE_FUNC): New macro, with the old contents of DEFUN. (DEFUN): Rewrite in terms of DEFINE_FUNC. It now generates a static function definition. Use DEFUE if you want an extern one. (DEFUE, INFUN): New macros. (Funibyte_char_to_multibyte, Fsyntax_table_p, Finit_image_library): (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer): (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute): (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes): Remove decls, since these functions are now static. (Funintern, Fget_internal_run_time): New decls, since these functions were already external. * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c: * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c: * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c: * fns.c, font.c, fontset.c, frame.c, image.c, indent.c: * keyboard.c, keymap.c, lread.c: * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c: * syntax.c, term.c, terminal.c, textprop.c, undo.c: * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c: Mark functions with DEFUE instead of DEFUN, if they are used in other modules. * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward decls for now-static functions. * buffer.h (Fdelete_overlay): Remove decl. * callproc.c (Fgetenv_internal): Mark as internal. * composite.c (Fremove_list_of_text_properties): Remove decl. (Fcomposition_get_gstring): New forward static decl. * composite.h (Fcomposite_get_gstring): Remove decl. * dired.c (Ffile_attributes): New forward static decl. * doc.c (Fdocumntation_property): New forward static decl. * eval.c (Ffetch_bytecode): New forward static decl. (Funintern): Remove extern decl; now in .h file where it belongs. * fileio.c (Fmake_symbolic_link): New forward static decl. * image.c (Finit_image_library): New forward static decl. * insdel.c (Fcombine_after_change_execute): Make forward decl static. * intervals.h (Fprevious_property_change): (Fremove_list_of_text_properties): Remove decls. * keyboard.c (Fthis_command_keys): Remove decl. (Fcommand_execute): New forward static decl. * keymap.c (Flookup_key): New forward static decl. (Fcopy_keymap): Now static. * keymap.h (Flookup_key): Remove decl. * process.c (Fget_process): New forward static decl. (Fprocess_datagram_address): Mark as internal. * syntax.c (Fsyntax_table_p): New forward static decl. (skip_chars): Remove duplicate decl. * textprop.c (Fprevious_property_change): New forward static decl. * window.c (Fset_window_fringes, Fset_window_scroll_bars): Now internal. (Fset_window_margins, Fset_window_vscroll): New forward static decls. * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
* * chartab.c: Use similar style as for other recent patches.Paul Eggert2011-04-091-2/+1
|
* * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.Paul Eggert2011-04-091-7/+9
|
* * chartab.c (sub_char_table_ref_and_range): Redo for slightPaul Eggert2011-03-271-3/+3
| | | | efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
* * chartab.c (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.Paul Eggert2011-03-081-14/+0
|
* * chartab.c: (sub_char_table_ref_and_range, char_table_ref_and_range):Paul Eggert2011-03-081-13/+13
| | | | Rename locals to avoid shadowing.
* * chartab.c (copy_sub_char_table): Now static, since it's not usedPaul Eggert2011-03-081-3/+2
| | | | elsewhere.
* Nuke arch-tags.Glenn Morris2011-01-151-2/+0
|
* Merge from emacs-23Stefan Monnier2011-01-141-1/+1
|\
| * Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
| |
* | Remove unused declarationsAndreas Schwab2010-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/buffer.c: Remove unused declarations. * src/buffer.h: Likewise. * src/charset.h: Likewise. * src/composite.h: Likewise. * src/dispextern.h: Likewise. * src/dispnew.c: Likewise. * src/font.h: Likewise. * src/fontset.c: Likewise. * src/fontset.h: Likewise. * src/intervals.h: Likewise. * src/keymap.h: Likewise. * src/lisp.h: Likewise. * src/syntax.c: Likewise. * src/syntax.h: Likewise. * src/termhooks.h: Likewise. * src/window.h: Likewise. * src/xsettings.h: Likewise. * src/xterm.c: Likewise. * src/xterm.h: Likewise. * src/chartab.c (sub_char_table_ref): Make static. * src/dispnew.c (line_hash_code, required_matrix_height) (required_matrix_width): Likewise. * src/eval.c (interactive_p, apply_lambda): Likewise. * src/fns.c (string_make_multibyte, copy_hash_table, hash_clear): Likewise. * src/font.c (QCadstyle, QCregistry, font_make_spec) (font_parse_fcname, font_encode_char, font_at): Likewise. * src/frame.c (x_frame_get_arg): Likewise. * src/keymap.c (get_keyelt): Likewise. * src/lread.c (read_filtered_event): Likewise. * src/print.c (write_string_1): Likewise. * src/window.c (delete_window, window_height, window_width) (foreach_window): Likewise. * src/xrdb.c (x_get_customization_string, x_get_resource): Likewise. * src/xterm.c (x_scroll_bar_clear, xembed_set_info) (xembed_send_message): Likewise. * src/eval.c (run_hook_list_with_args): Delete. * src/font.c (font_unparse_gtkname, font_update_lface): Likewise. * src/terminal.c (get_terminal_param): Likewise. * src/xterm.c (x_alloc_lighter_color_for_widget): Likewise.
* | Convert DEFUNs to standard C.Dan Nicolaescu2010-07-081-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c: Convert DEFUNs to standard C. * src/buffer.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/dosfns.c: * src/editfns.c: * src/emacs.c: * src/eval.c: * src/fileio.c: * src/filelock.c: * src/floatfns.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/image.c: * src/indent.c: * src/insdel.c: * src/keyboard.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/menu.c: * src/minibuf.c: * src/msdos.c: * src/nsfns.m: * src/nsmenu.m: * src/nsselect.m: * src/print.c: * src/process.c: * src/search.c: * src/sound.c: * src/syntax.c: * src/term.c: * src/terminal.c: * src/textprop.c: * src/undo.c: * src/w16select.c: * src/w32console.c: * src/w32fns.c: * src/w32font.c: * src/w32menu.c: * src/w32proc.c: * src/w32select.c: * src/window.c: * src/xdisp.c: * src/xfaces.c: * src/xfns.c: * src/xmenu.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: Likewise.
* | Convert declarations or definitions to standard C.Dan Nicolaescu2010-07-041-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/xsmfns.c (smc_save_yourself_CB, smc_error_handler): * src/xrdb.c (get_system_name): * src/window.c (shrink_windows): * src/syntax.c (forw_comment): * src/scroll.c (calculate_scrolling, calculate_direct_scrolling) (ins_del_costs): * src/mem-limits.h (start_of_data): * src/lread.c (readevalloop): * src/gtkutil.c (xg_dialog_response_cb, xg_get_file_with_chooser) (xg_get_file_with_selection, xg_update_menubar, xg_update_submenu): * src/frame.c (x_get_focus_frame): * src/floatfns.c (fmod_float): * src/fileio.c (choose_write_coding_system): * src/emacs.c (fatal_error_signal, init_cmdargs, argmatch) (malloc_initialize_hook, sort_args, synchronize_locale): * src/doprnt.c (doprnt): * src/dired.c (compile_pattern): * src/data.c (fmod_float): * src/chartab.c (map_sub_char_table, map_sub_char_table_for_charset) (map_char_table_for_charset): * src/charset.c (define_charset_internal): * src/alloc.c (Fgarbage_collect): Convert declarations or definitions to standard C.
* | Convert (most) functions in src to standard C.Dan Nicolaescu2010-07-041-51/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/alloc.c: Convert function definitions to standard C. * src/atimer.c: * src/bidi.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.c: * src/ccl.c: * src/character.c: * src/charset.c: * src/chartab.c: * src/cmds.c: * src/coding.c: * src/composite.c: * src/data.c: * src/dbusbind.c: * src/dired.c: * src/dispnew.c: * src/doc.c: * src/doprnt.c: * src/ecrt0.c: * src/editfns.c: * src/fileio.c: * src/filelock.c: * src/filemode.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/ftfont.c: * src/ftxfont.c: * src/gtkutil.c: * src/indent.c: * src/insdel.c: * src/intervals.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/md5.c: * src/menu.c: * src/minibuf.c: * src/prefix-args.c: * src/print.c: * src/ralloc.c: * src/regex.c: * src/region-cache.c: * src/scroll.c: * src/search.c: * src/sound.c: * src/strftime.c: * src/syntax.c: * src/sysdep.c: * src/termcap.c: * src/terminal.c: * src/terminfo.c: * src/textprop.c: * src/tparam.c: * src/undo.c: * src/unexelf.c: * src/window.c: * src/xfaces.c: * src/xfns.c: * src/xfont.c: * src/xftfont.c: * src/xgselect.c: * src/xmenu.c: * src/xrdb.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: * src/xterm.c: Likewise.
* | Remove __P and P_ from .c and .m files and definition of P_Jan D2010-07-021-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp.h: * atimer.h: Remove define for P_. * alloc.c: Remove __P and P_ from .c and .m files. * atimer.c: * buffer.c: * callint.c: * category.c: * charset.c: * chartab.c: * cm.c: * coding.c: * composite.c: * data.c: * dired.c: * dispnew.c: * doc.c: * editfns.c: * emacs.c: * eval.c: * fileio.c: * filelock.c: * fns.c: * font.c: * fontset.c: * frame.c: * ftfont.c: * ftxfont.c: * gmalloc.c: * gtkutil.c: * image.c: * indent.c: * intervals.c: * keyboard.c: * keymap.c: * lread.c: * marker.c: * menu.c: * minibuf.c: * print.c: * process.c: * scroll.c: * search.c: * sound.c: * strftime.c: * syntax.c: * sysdep.c: * term.c: * terminal.c: * textprop.c: * unexalpha.c: * w32console.c: * w32fns.c: * w32font.c: * w32menu.c: * w32term.c: * w32uniscribe.c: * window.c: * xdisp.c: * xfaces.c: * xfns.c: * xfont.c: * xftfont.c: * xmenu.c: * xselect.c: * xterm.c: Likewise. * ebrowse.c: Remove P_ and __P. * etags.c: * movemail.c: * pop.c: * update-game-score.c: Likewise.
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* * alloc.c: Do not define struct catchtag.Dan Nicolaescu2009-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: Move struct catchtag definition ... * lisp.h: ... here. * image.c: Move png.h #include earlier to avoid warnings. * xterm.c: * xsmfns.c: * xselect.c: * xrdb.c: * xmenu.c: * xftfont.c: * xfont.c: * xfns.c: * xfaces.c: * xdisp.c: * window.c: * widget.c: * w32xfns.c: * w32uniscribe.c: * w32term.c: * w32select.c: * w32reg.c: * w32proc.c: * w32menu.c: * w32inevt.c: * w32heap.c: * w32font.c: * w32fns.c: * w32console.c: * w32.c: * w16select.c: * vm-limit.c: * unexsol.c: * unexec.c: * unexcw.c: * unexaix.c: * undo.c: * tparam.c: * textprop.c: * terminfo.c: * terminal.c: * termcap.c: * term.c: * syntax.c: * sound.c: * sheap.c: * search.c: * scroll.c: * region-cache.c: * regex.c: * ralloc.c: * process.c: * print.c: * msdos.c: * minibuf.c: * menu.c: * marker.c: * macros.c: * keymap.c: * keyboard.c: * intervals.c: * insdel.c: * indent.c: * gtkutil.c: * ftxfont.c: * ftfont.c: * fringe.c: * frame.c: * fontset.c: * font.c: * fns.c: * floatfns.c: * filelock.c: * fileio.c: * emacs.c: * editfns.c: * dosfns.c: * doprnt.c: * doc.c: * dispnew.c: * dired.c: * dbusbind.c: * data.c: * composite.c: * coding.c: * cmds.c: * cm.c: * chartab.c: * charset.c: * character.c: * ccl.c: * category.c: * casetab.c: * casefiddle.c: * callproc.c: * callint.c: * bytecode.c: * buffer.c: * atimer.c: Include setjmp.h. (Bug#4643) * xlwmenu.c: * lwlib.c: * lwlib-utils.c: * lwlib-Xm.c: * lwlib-Xlw.c: * lwlib-Xaw.c: Include setjmp.h.
* (sub_char_table_ref_and_range): Fix the range check against max_char.Kenichi Handa2009-07-131-1/+1
|
* Add 2009 to copyright years.Glenn Morris2009-01-081-1/+1
|
* (sub_char_table_ref_and_range): Adjusted for theKenichi Handa2008-11-271-47/+44
| | | | | | | change of char_table_ref_and_range. (char_table_ref_and_range): Change the meaning of argument FROM and TO. Now the caller must provide initial values for *FROM and *TO.
* Fix typos.Juanma Barranquero2008-11-111-1/+1
|
* (map_char_table_for_charset): Add comment.Kenichi Handa2008-11-111-0/+21
|
* (Foptimize_char_table): Make sure `ascii' doesn't point toStefan Monnier2008-10-261-0/+3
| | | | the previous unoptimized table.
* (optimize_sub_char_table): Perform more greedy optimization.Kenichi Handa2008-08-291-7/+6
|
* * chartab.c (Foptimize_char_table, optimize_sub_char_table):Stefan Monnier2008-05-301-16/+19
| | | | | | | | Add a `test' argument so another predicate than `equal' can be used. (map_sub_char_table): Use `eq' rather than `equal' to merge ranges. (map_char_table): Remove unused vars `c' and `i'. * lisp.h (Foptimize_char_table): Adjust declaration. * charset.c (Fclear_charset_maps): Adjust call to Foptimize_char_table.
* Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-141-6/+4
|
* (Fset_char_table_range): If range is t, really set all chars to that value.Stefan Monnier2008-05-031-3/+2
|
* (make_sub_char_table): Remove noop-yet-incorrect statement.Stefan Monnier2008-02-061-1/+0
|
* Update copyright years and FSF address.Glenn Morris2008-02-021-4/+4
|
* Fix up multi-tty mergeMiles Bader2007-10-121-1/+4
| | | | | Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-261 Creator: Stefan Monnier <monnier@iro.umontreal.ca>
* (map_sub_char_table): If the range contains just oneKenichi Handa2007-09-201-5/+14
| | | | | | character, call the function with that character even if the depth is not 3. (map_char_table): Likewise.
* (map_sub_char_table): Make it work for the top-levelKenichi Handa2007-06-251-42/+103
| | | | | char-table. Fix handling of parent char-table. (map_char_table): Adjusted for the above change.
* (map_char_table): GCPRO table and arg.Andreas Schwab2004-11-241-2/+2
|
* Add arch taglinesMiles Bader2004-04-191-0/+3
|
* Sync to HEADKenichi Handa2004-04-161-4/+4
|
* (map_sub_char_table_for_charset): Fix args to c_function with.Kenichi Handa2003-12-291-1/+1
|
* (char_table_translate): Use CHARACTERP, not INETEGERP.Kenichi Handa2003-10-061-3/+2
|
* (map_char_table): Protect `range' from GC.Andreas Schwab2003-09-101-0/+8
| | | | (map_char_table_for_charset): Likewise.
* *** empty log message ***Kenichi Handa2003-09-081-95/+28
|
* *** empty log message ***Kenichi Handa2003-05-061-1/+1
|
* (map_sub_char_table): New argument DEFAULT_VAL.Kenichi Handa2003-05-061-32/+56
| | | | | (map_char_table): Don't inherit the value from the parent on initializing VAL. Adjusted for the above change.
* (char_table_ascii): Check if the char table contentsKenichi Handa2003-01-061-2/+6
| | | | | | is sub-char-table or not. (char_table_set): Fix argument to char_table_ascii. (char_table_set_range): Likewise.
* *** empty log message ***Kenichi Handa2002-08-151-1/+1
|