aboutsummaryrefslogtreecommitdiffstats
path: root/src/floatfns.c
Commit message (Collapse)AuthorAgeFilesLines
* use guile-snarf for subr definitionBT Templeton2015-04-181-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/Makefile.in: Run guile-snarf on files that previously contained `defsubr' calls. * src/alloc.c (syms_of_alloc): * src/buffer.c (syms_of_buffer): * src/bytecode.c (syms_of_bytecode): * src/callint.c (syms_of_callint): * src/callproc.c (syms_of_callproc): * src/casefiddle.c (syms_of_casefiddle): * src/casetab.c (syms_of_casetab): * src/category.c (syms_of_category): * src/ccl.c (syms_of_ccl): * src/character.c (syms_of_character): * src/charset.c (syms_of_charset): * src/chartab.c (syms_of_chartab): * src/cmds.c (syms_of_cmds): * src/coding.c (syms_of_coding): * src/composite.c (syms_of_composite): * src/data.c (syms_of_data): * src/dbusbind.c (syms_of_dbusbind): * src/dired.c (syms_of_dired): * src/dispnew.c (syms_of_display): * src/doc.c (syms_of_doc): * src/dosfns.c (syms_of_dosfns): * src/editfns.c (syms_of_editfns): * src/emacs.c (syms_of_emacs): * src/eval.c (syms_of_eval): * src/fileio.c (syms_of_fileio): * src/filelock.c (syms_of_filelock): * src/floatfns.c (syms_of_floatfns): * src/fns.c (syms_of_fns): * src/font.c (syms_of_font): * src/fontset.c (syms_of_fontset): * src/frame.c (syms_of_frame): * src/fringe.c (syms_of_fringe): * src/gnutls.c (syms_of_gnutls): * src/image.c (syms_of_image): * src/indent.c (syms_of_indent): * src/insdel.c (syms_of_insdel): * src/keyboard.c (syms_of_keyboard): * src/keymap.c (syms_of_keymap): * src/lread.c (syms_of_lread): * src/macros.c (syms_of_macros): * src/marker.c (syms_of_marker): * src/menu.c (syms_of_menu): * src/minibuf.c (syms_of_minibuf): * src/msdos.c (syms_of_msdos): * src/nsfns.m (syms_of_nsfns): * src/nsmenu.m (syms_of_nsmenu): * src/nsselect.m (syms_of_nsselect): * src/print.c (syms_of_print): * src/process.c (syms_of_process): * src/search.c (syms_of_search): * src/sound.c (syms_of_sound): * src/syntax.c (syms_of_syntax): * src/term.c (syms_of_term): * src/terminal.c (syms_of_terminal): * src/textprop.c (syms_of_textprop): * src/undo.c (syms_of_undo): * src/w16select.c (syms_of_win16select): * src/w32console.c (syms_of_ntterm): * src/w32fns.c (syms_of_w32fns): * src/w32font.c (syms_of_w32font): * src/w32menu.c (syms_of_w32menu): * src/w32proc.c (syms_of_ntproc): * src/w32select.c (syms_of_w32select): * src/window.c (syms_of_window): * src/xdisp.c (syms_of_xdisp): * src/xfaces.c (syms_of_xfaces): * src/xfns.c (syms_of_xfns): * src/xmenu.c (syms_of_xmenu): * src/xml.c (syms_of_xml): * src/xselect.c (syms_of_xselect): * src/xsettings.c (syms_of_xsettings): * src/xsmfns.c (syms_of_xsmfns): Include guile-snarf files for subr definition.
* Doc fixesGlenn Morris2014-05-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/autotype.texi (Skeleton Language): * doc/misc/message.texi (Header Commands): * lisp/allout-widgets.el (allout-widgets-tally) (allout-decorate-item-guides): * lisp/menu-bar.el (menu-bar-positive-p): * lisp/minibuffer.el (completion-pcm-complete-word-inserts-delimiters): * lisp/cedet/ede.el (ede-project-directories, ede-check-project-directory): * lisp/cedet/semantic/ia-sb.el (semantic-ia-sb-show-doc): * lisp/cedet/semantic/tag.el (semantic-tag-in-buffer-p): * lisp/cedet/semantic/bovine/c.el (semantic-tag-abstract-p): * lisp/gnus/gnus-registry.el (gnus-registry-install-p): Doc fix. * lisp/progmodes/gdb-mi.el (gdbmi-same-start, gdbmi-is-number): * lisp/progmodes/js.el (js--inside-param-list-p) (js--inside-dojo-class-list-p, js--forward-destructuring-spec): * lisp/progmodes/prolog.el (region-exists-p): * lisp/progmodes/verilog-mode.el (verilog-scan-cache-ok-p): * lisp/textmodes/reftex-parse.el (reftex-using-biblatex-p): * lisp/url/url-parse.el (url-generic-parse-url): * src/floatfns.c (Fisnan): * src/profiler.c (Fprofiler_cpu_running_p): Doc fixes (replace `iff'). Fixes: debbugs:17309
* Fix porting inconsistency about rounding to even.Paul Eggert2014-03-191-1/+3
| | | | | | | | * doc/lispref/numbers.texi (Numeric Conversions, Rounding Operations): Document that 'round' and 'fround' round to even. * src/floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even. This way, the unusual !HAVE_RINT case acts like the usual HAVE_RINT case, and we can fix the documentation accordingly.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Port to Solaris 10 and its bundled GCC.Paul Eggert2013-10-221-6/+7
| | | | | Problem reported by Timothy C. Burt. * floatfns.c (isfinite, isnan): Redefine unconditionally.
* Add log2 support and make log10 obsolete for consistency.Paul Eggert2013-06-201-15/+10
| | | | | | | | | | * configure.ac (log2): Check for this function. * doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10. * lisp/subr.el (log10): Move here from C code, and declare as obsolete. All uses of (log10 X) replaced with (log X 10). * src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the base is 2; this is more accurate. (Flog10): Move to Lisp (marked obsolete there).
* * floatfns.c: Add commentary re C99 and C11.Paul Eggert2013-06-191-0/+11
|
* Use functions, not macros, for XINT etc.Paul Eggert2013-06-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In lisp.h, prefer functions to function-like macros, and constants to object-like macros, when either will do. This: . simplifies use, as there's no more need to worry about arguments' side effects being evaluated multiple times. . makes the code easier to debug on some platforms. However, when using gcc -O0, keep using function-like macros for a few critical operations, for performance reasons. This sort of thing isn't needed with gcc -Og, but -Og is a GCC 4.8 feature and isn't widely-enough available yet. Also, move functions from lisp.h to individual modules when possible. From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>. * alloc.c (XFLOAT_INIT, set_symbol_name): * buffer.c (CHECK_OVERLAY): * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii) (set_char_table_parent): * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR): * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD) (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found) (blv_value, set_blv_value, set_blv_where, set_blv_defcell) (set_blv_valcell): * emacs.c (setlocale) [!HAVE_SETLOCALE]: * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where) (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs) (backtrace_args, backtrace_debug_on_exit): * floatfns.c (CHECK_FLOAT): * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END) (set_hash_key_and_value, set_hash_next, set_hash_next_slot) (set_hash_hash, set_hash_hash_slot, set_hash_index) (set_hash_index_slot): * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE): * marker.c (CHECK_MARKER): * textprop.c (CHECK_STRING_OR_BUFFER): * window.c (CHECK_WINDOW_CONFIGURATION): Move here from lisp.h, and make these functions static rather than extern inline. * buffer.c (Qoverlayp): * data.c (Qsubrp): * fns.c (Qhash_table_p): * window.c (Qwindow_configuration_p): Now static. * lisp.h: Remove the abovementioned defns and decls. * configure.ac (WARN_CFLAGS): Remove -Wbad-function-cast, as it generates bogus warnings about reasonable casts of calls. * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Remove enum lsb_bits; no longer needed. (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue. * buffer.c (Qoverlap): * data.c (Qsubrp): * fns.c (Qhash_table_p): Now extern, so lisp.h can use these symbols. * dispextern.h: Include character.h, for MAX_CHAR etc. (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE) (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE) (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P) (GLYPH_CODE_P): Move here from lisp.h. (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE) (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros. (GLYPH_MODE_LINE_FACE): Now enums, not macros. * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since XUNTAG now returns void *. * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS) (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE) (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP) (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP) (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P) (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP) (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH) (lisp_h_XPNTR, lisp_h_XSYMBOL): New macros, renamed from their sans-lisp_h_ counterparts. (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL) (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP) (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP) (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL): If compiling via GCC without optimization, define these as macros in addition to inline functions. To disable this, compile with -DINLINING=0. (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros. (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise. (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that. (INTMASK, VALMASK): Now macros, since static values cannot be accessed from extern inline functions. (VALMASK): Also a constant, for benefit of old GDB. (LISP_INT_TAG_P): Remove; no longer needed as the only caller is INTEGERP, which can fold it in. (XLI, XIL, XHASH, XTYPE,XINT, XFASTINT, XUINT) (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL) (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE) (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE) (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR) (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET) (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF) (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF) (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS) (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS) (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P) (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P) (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE) (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE) (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE) (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD) (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP) (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP) (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP) (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP) (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP) (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP) (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P) (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP) (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING) (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE) (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY) (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW) (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR) (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT) (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY) (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR) (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH) Now functions. (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function. (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed. (VALMASK): Define in one place rather than in two, merging the USE_LSB_TAG parts; this is simpler. (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM) (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P): Move up, to avoid use before definition. Also include "globals.h" earlier, for the same reason. (make_natnum): New function. (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts. (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP) (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP) (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP) (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP) (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set) (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p) (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp) (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp) (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument) (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp) (Qwindow_configuration_p, Qimage): New forward declarations. (XSETFASTINT): Simplify by rewriting in terms of make_natnum. (STRING_COPYIN): Remove; unused. (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ... (xcar_addr, xcdr_addr): New functions. All uses changed. (IEEE_FLOATING_POINT): Now a constant, not a macro. (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE) (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE) (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P) (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use. (TYPE_RANGED_INTEGERP): Simplify. (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls. (setlocale, fixup_locale, synchronize_system_messages_locale) (synchronize_system_time_locale) [!HAVE_SETLOCALE]: Now empty functions, not macros. (functionp): Return bool, not int. * window.c (Qwindow_configuration_p): Now extern, so window.h can use it. * window.h (Qwindowp): Move decl back to lisp.h.
* Reorder conditions that are written backwardsAndreas Schwab2013-03-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are written backwards. * blockinput.h (input_blocked_p): Likewise. * bytecode.c (exec_byte_code): Likewise. * callproc.c (call_process_kill, call_process_cleanup) (Fcall_process): Likewise. * ccl.c (ccl_driver, resolve_symbol_ccl_program) (Fccl_execute_on_string): Likewise. * character.c (string_escape_byte8): Likewise. * charset.c (read_hex): Likewise. * cm.c (calccost): Likewise. * data.c (cons_to_unsigned): Likewise. * dired.c (directory_files_internal, file_name_completion): Likewise. * dispnew.c (scrolling_window, update_frame_1, Fsleep_for) (sit_for): Likewise. * doc.c (Fsubstitute_command_keys): Likewise. * doprnt.c (doprnt): Likewise. * editfns.c (hi_time, decode_time_components, Fformat): Likewise. * emacsgtkfixed.c: Likewise. * fileio.c (file_offset, Fwrite_region): Likewise. * floatfns.c (Fexpt, fmod_float): Likewise. * fns.c (larger_vector, make_hash_table, Fmake_hash_table): Likewise. * font.c (font_intern_prop): Likewise. * frame.c (x_set_alpha): Likewise. * gtkutil.c (get_utf8_string): Likewise. * indent.c (check_display_width): Likewise. * intervals.c (create_root_interval, rotate_right, rotate_left) (split_interval_right, split_interval_left) (adjust_intervals_for_insertion, delete_node) (interval_deletion_adjustment, adjust_intervals_for_deletion) (merge_interval_right, merge_interval_left, copy_intervals) (set_intervals_multibyte_1): Likewise. * keyboard.c (gobble_input, append_tool_bar_item): Likewise. * keymap.c (Fkey_description): Likewise. * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise. * lread.c (openp, read_integer, read1, string_to_number): Likewise. * menu.c (ensure_menu_items): Likewise. * minibuf.c (read_minibuf_noninteractive): Likewise. * print.c (printchar, strout): Likewise. * process.c (create_process, Faccept_process_output) (wait_reading_process_output, read_process_output, send_process) (wait_reading_process_output): Likewise. * profiler.c (make_log, handle_profiler_signal): Likewise. * regex.c (re_exec): Likewise. * regex.h: Likewise. * search.c (looking_at_1, Freplace_match): Likewise. * sysdep.c (get_child_status, procfs_ttyname) (procfs_get_total_memory): Likewise. * systime.h (EMACS_TIME_VALID_P): Likewise. * term.c (dissociate_if_controlling_tty): Likewise. * window.c (get_phys_cursor_glyph): Likewise. * xdisp.c (init_iterator, redisplay_internal, redisplay_window) (try_window_reusing_current_matrix, try_window_id, pint2hrstr): Likewise. * xfns.c (Fx_window_property): Likewise. * xmenu.c (set_frame_menubar): Likewise. * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise. * xsmfns.c (smc_save_yourself_CB): Likewise. * xterm.c (x_scroll_bar_set_handle): Likewise.
* Merge from emacs-24; up to 2012-12-06T01:39:[email protected]Paul Eggert2013-01-021-2/+2
|\
| * Update copyright notices for 2013.Paul Eggert2013-01-011-2/+2
| |
* | Simplify via eabs.Paul Eggert2013-01-011-2/+2
|/ | | | | | | | | | | | | * dired.c (file_name_completion): * doc.c (get_doc_string): * floatfns.c (round2): * font.c (font_score, font_delete_unmatched): * fringe.c (compute_fringe_widths): * lread.c (read_list): * minibuf.c (Ftry_completion): * term.c (tty_ins_del_lines): * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1): Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
* Simplify and avoid signal-handling races.Paul Eggert2012-09-231-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * nt/inc/ms-w32.h (emacs_raise): New macro. * src/alloc.c (die): * src/sysdep.c (emacs_abort) [HAVE_NTGUI]: Avoid recursive loop if there's a fatal error in the function itself. * src/atimer.c (pending_atimers): * src/blockinput.h: Don't include "atimer.h"; no longer needed. (interrupt_input_pending): Remove. All uses removed. pending_signals now counts both atimers and ordinary interrupts. This is less racy than having three separate pending-signal flags. (block_input, unblock_input, totally_unblock_input, unblock_input_to) (input_blocked_p): Rename from their upper-case counterparts BLOCK_INPUT, UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO, INPUT_BLOCKED_P, and turn into functions. All uses changed. This makes it easier to access volatile variables more accurately. (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input (). (input_blocked_p): Prefer this to 'interrupt_input_blocked', as that's more reliable if the code is buggy and sets interrupt_input_blocked to a negative value. All uses changed. * src/atimer.c (deliver_alarm_signal): Remove. No need to deliver this to the parent; any thread can handle this signal now. All uses replaced by underlying handler. * src/atimer.c (turn_on_atimers): * src/dispnew.c (handle_window_change_signal): * src/emacs.c (handle_danger_signal): * src/keyboard.c (kbd_buffer_get_event): Don't reestablish signal handler; not needed with sigaction. * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT) (UNBLOCK_INPUT_TO): Rework to avoid unnecessary accesses to volatile variables. (UNBLOCK_INPUT_TO): Now a function. (totally_unblock_input, unblock_input): New decls. * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c (init_data): Remove. Necessary stuff now done in init_signal. * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions. * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c. (fatal_error_code): Remove; no longer needed. (terminate_due_to_signal): Rename from fatal_error_backtrace, since it doesn't always backtrace. All uses changed. No need to reset signal to default, since sigaction and/or die does that for us now. Use emacs_raise (FOO), not kill (getpid (), FOO). (main): Check more-accurately whether we're dumping. Move fatal-error setup to sysdep.c * src/floatfns.c: Do not include "syssignal.h"; no longer needed. * src/gtkutil.c (xg_get_file_name, xg_get_font): Remove no-longer-needed signal-mask manipulation. * src/keyboard.c, src/process.c (POLL_FOR_INPUT): Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined. * src/keyboard.c (read_avail_input): Remove. All uses replaced by gobble_input. (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code. (kbd_buffer_store_event_hold, gobble_input): (record_asynch_buffer_change) [USABLE_SIGIO]: (store_user_signal_events): No need to mess with signal mask. (gobble_input): If blocking input and there are terminals, simply set pending_signals to 1 and return. All hooks changed to not worry about whether input is blocked. (process_pending_signals): Clear pending_signals before processing them, in case a signal comes in while we're processing. By convention callers now test pending_signals before calling us. (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input): New functions, to support changes to blockinput.h. (handle_input_available_signal): Now extern. (reinvoke_input_signal): Remove. All uses replaced by handle_async_input. (quit_count): Now volatile, since a signal handler uses it. (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All callers changed. Block SIGINT only if not already blocked. Clear sigmask reliably, even if Fsignal returns, which it can. Omit unnecessary accesses to volatile var. (quit_throw_to_read_char): No need to restore sigmask. * src/keyboard.c (gobble_input, handle_user_signal): * src/process.c (wait_reading_process_output): Call signal-handling code rather than killing ourselves. * src/lisp.h: Include <float.h>, for... (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication. (pending_signals): Now volatile. (syms_of_data): Now const if IEEE floating point. (handle_input_available_signal) [USABLE_SIGIO]: (terminate_due_to_signal, record_child_status_change): New decls. * src/process.c (create_process): Avoid disaster if memory is exhausted while we're processing a vfork, by tightening the critical section around the vfork. (send_process_frame, process_sent_to, handle_pipe_signal) (deliver_pipe_signal): Remove. No longer needed, as Emacs now ignores SIGPIPE. (send_process): No need for setjmp/longjmp any more, since the SIGPIPE stuff is now gone. Instead, report an error if errno is EPIPE. (record_child_status_change): Now extern. PID and W are now args. Return void, not bool. All callers changed. * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]: Remove. All uses removed. This bug should be fixed now in a different way. (wait_for_termination_1): Use waitpid rather than sigsuspend, and record the child status change directly. This avoids the need to futz with the signal mask. (process_fatal_action): Move here from emacs.c. (emacs_sigaction_flags): New function, containing much of what used to be in emacs_sigaction_init. (emacs_sigaction_init): Use it. Block nonfatal system signals that are caught by emacs, to make races less likely. (deliver_process_signal): Rename from handle_on_main_thread. All uses changed. (BACKTRACE_LIMIT_MAX): Now at top level. (thread_backtrace_buffer, threadback_backtrace_pointers): New static vars. (deliver_thread_signal, deliver_fatal_thread_signal): New functions, for more-accurate delivery of thread-specific signals. (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c. (deliver_arith_signal): Handle in this thread, not in the main thread, since it's triggered by this thread. (maybe_fatal_sig): New function. (init_signals): New arg DUMPING so that we can be more accurate about whether we're dumping. Caller changed. Treat thread-specific signals differently from process-general signals. Block all signals while handling fatal error; that's safer. xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal on IEEE hosts. When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored. Ignore SIGPIPE unless batch. (emacs_backtrace): Output backtrace for the appropriate thread, which is not necessarily the main thread. * src/syssignal.h: Include <stdbool.h>. (emacs_raise): New macro. * src/xterm.c (x_connection_signal): Remove; no longer needed now that we use sigaction. (x_connection_closed): No need to mess with sigmask now. (x_initialize): No need to reset SIGPIPE handler here, since init_signals does this for us now. Fixes: debbugs:12471
* Port better to POSIX hosts lacking _setjmp.Paul Eggert2012-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. (_setjmp, _longjmp): Remove. * src/lisp.h: Include <setjmp.h> here, since we use its symbols here. All instances of '#include <setjmp.h>' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, and _longjmp with the new symbols. Emacs already uses _setjmp if available, so this change affects only POSIXish hosts that have sigsetjmp but not _setjmp, such as some versions of Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. (png_load_body) [HAVE_PNG]: (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, since PNG requires jmp_buf. This is the only exception to the general rule that we now use sys_setjmp and sys_longjmp. This exception is OK since this code does not change the signal mask or longjmp out of a signal handler. Fixes: debbugs:12446
* Simplify, document, and port floating-point.Paul Eggert2012-09-101-212/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The porting part of this patch fixes bugs on non-IEEE platforms with frexp, ldexp, logb. * admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove. * configure.ac (logb, cbrt): Do not check for these functions, as they are not being used. * doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions): Document that / and mod (with floating point arguments), along with asin, acos, log, log10, expt and sqrt, return special values instead of signaling exceptions. (Float Basics): Document that logb operates on the absolute value of its argument. (Math Functions): Document that (log ARG BASE) also returns NaN if BASE is negative. Document that (expt X Y) returns NaN if X is a finite negative number and Y a finite non-integer. * etc/NEWS: Document NaNs versus signaling-error change. * src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error): Now static. * src/floatfns.c: Simplify discussion of functions that Emacs doesn't support, by removing commented-out code and briefly listing the C89 functions excluded. The commented-out stuff was confusing maintenance, e.g., we thought we needed cbrt but it was commented out. (logb): Remove decl; no longer needed. (isfinite): New macro, if not already supplied. (isnan): Don't replace any existing macro. (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp are present on all C89 platforms. (Ffrexp): Do not special-case zero, as frexp does the right thing for that case. (Flogb): Do not use logb, as it doesn't have the desired meaning on hosts that use non-base-2 floating point. Instead, stick with frexp, which is C89 anyway. Do not pass an infinity or a NaN to frexp, to avoid getting an unspecified result.
* Assume C89 or later for math functions.Paul Eggert2012-09-091-352/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the code, and makes it a bit smaller and faster, and (most important) makes it easier to clean up signal handling since we can stop worring about floating-point exceptions in library code. That was a problem before C89, but the problem went away many years ago on all practical Emacs targets. * configure.ac (frexp, fmod): Remove checks for these functions, as we now assume them. (FLOAT_CHECK_DOMAIN, HAVE_INVERSE_HYPERBOLIC, NO_MATHERR) (HAVE_EXCEPTION): Remove; no longer needed. * admin/CPP-DEFINES (HAVE_FMOD, HAVE_FREXP, FLOAT_CHECK_DOMAIN) (HAVE_INVERSE_HYPERBOLIC, NO_MATHERR): Remove. * src/data.c, src/image.c, src/lread.c, src/print.c: Don't include <math.h>; no longer needed. * src/data.c, src/floatfns.c (IEEE_FLOATING_POINT): Don't worry that it might be autoconfigured, as that never happens. * src/data.c (fmod): * src/doprnt.c (DBL_MAX_10_EXP): * src/print.c (DBL_DIG): Remove. C89 or later always defines these. * src/floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN) (in_float, float_error_arg, float_error_arg2, float_error_fn_name) (arith_error, domain_error, domain_error2): Remove all this pre-C89 cruft. Do not include <errno.h> as that's no longer needed -- we simply return what C returns. All uses removed. (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with the wrapped code. (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2): Remove. All uses expanded, as these macros are no longer used more than once and are now more trouble than they're worth. (Ftan): Use tan, not sin / cos. (Flogb): Assume C89 frexp. (fmod_float): Assume C89 fmod. (matherr) [HAVE_MATHERR]: Remove; no longer needed. (init_floatfns): Remove. All uses removed.
* * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).Paul Eggert2012-09-081-2/+2
| | | | This produces more-accurate results.
* More signal-handler cleanup.Paul Eggert2012-09-071-1/+1
| | | | | | | | | | | | | | | | | * configure.ac (FLOAT_CHECK_DOMAIN): Comment fix (Bug#12327). * src/floatfns.c: Comment fix. * src/lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER. SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right, and anyway the declaration is harmless even if SIGDANGER is not defined. * src/syssignal.h (SIGIO): Also #undef if (! defined FIONREAD || defined BROKEN_FIONREAD). systty.h formerly did this, but other source files not surprisingly expected syssignal.h to define, or not define, SIGIO, and it's cleaner to do it that way, for consistency. Include <sys/ioctl.h>, for FIONREAD. * src/systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job. This eliminates a problem whereby other files mysteriously had to include "syssignal.h" before including "systty.h" if they wanted to use "#ifdef SIGIO".
* Signal-handler cleanup.Paul Eggert2012-09-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emacs's signal handlers were written in the old 4.2BSD style with sigblock and sigmask and so forth, and this led to some inefficiencies and confusion. Rewrite these to use pthread_sigmask etc. without copying signal sets around. Also, get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and 'signal', and instead use functions that do not attempt to take over the system name space. This patch causes Emacs's text segment to shrink by 0.7% on my platform, Fedora 17 x86-64. * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF): Adjust to syssignal.h changes. (SIGNAL_H_AB): Remove; no longer needed. * src/alloc.c, src/emacsgtkfixed.c, src/nsfns.m, src/widget.c, src/xmenu.c: Do not include <signal.h> or "syssignal.h", as these modules do not use signals. * src/atimer.c, src/callproc.c, src/data.c, src/dispnew.c, src/emacs.c: * src/floatfns.c, src/gtkutil.c, src/keyboard.c, src/process.c, src/sound.c: * src/sysdep.c, src/term.c, src/xterm.c: Do not include <signal.h>, as "syssignal.h" does that for us now. * src/atimer.c (sigmask_atimers): New function. (block_atimers, unblock_atimers): New functions, replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS. All uses replaced. * src/conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>; no longer needed here. * src/emacs.c (main): Inspect existing signal handler with sigaction, so that there's no need to block and unblock SIGHUP. * src/sysdep.c (struct save_signal): New member 'action', replacing old member 'handler'. (save_signal_handlers, restore_signal_handlers): Use sigaction instead of 'signal' to save and restore. (get_set_sighandler, set_sighandler) [!WINDOWSNT]: New function. All users of 'signal' modified to use set_sighandler if they're writeonly, and to use sys_signal if they're read+write. (emacs_sigaction_init, forwarded_signal): New functions. (sys_signal): Remove. All uses replaced by calls to sigaction and emacs_sigaction_init, or by direct calls to 'signal'. (sys_sigmask) [!__GNUC__]: Remove; no longer needed. (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove; all uses replaced by pthread_sigmask etc. calls. * src/syssignal.h: Include <signal.h>. (emacs_sigaction_init, forwarded_signal): New decls. (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t. (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask. (sigmask, sys_sigmask): Remove; no longer needed. (sigpause): Remove. All uses replaced by its definiens, sigsuspend. (sigblock, sigunblock, sigfree): (sigsetmask) [!defined sigsetmask]: Remove. All uses replaced by pthread_sigmask. (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN) no longer need to be replaced, and its typical old uses are now done via emacs_sigaction_init and sigaction. (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls. (sys_sigdel): Remove; unused. (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef. Fixes: debbugs:12327
* Fix race conditions with signal handlers and errno.Paul Eggert2012-09-051-35/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Be more systematic about preserving errno whenever a signal handler returns, even if it's not in the main thread. Do this by renaming signal handlers to distinguish between signal delivery and signal handling. All uses changed. * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler. * data.c (deliver_arith_signal): Rename from arith_error. * dispnew.c (deliver_window_change_signal): Rename from window_change_signal. * emacs.c (deliver_error_signal): Rename from fatal_error_signal. (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal. * keyboard.c (deliver_input_available_signal): Rename from input_available_signal. (deliver_user_signal): Rename from handle_user_signal. (deliver_interrupt_signal): Rename from interrupt_signal. * process.c (deliver_pipe_signal): Rename from send_process_trap. (deliver_child_signal): Rename from sigchld_handler. * atimer.c (handle_alarm_signal): * data.c (handle_arith_signal): * dispnew.c (handle_window_change_signal): * emacs.c (handle_fatal_signal, handle_danger_signal): * keyboard.c (handle_input_available_signal): * keyboard.c (handle_user_signal, handle_interrupt_signal): * process.c (handle_pipe_signal, handle_child_signal): New functions, with the actual signal-handling code taken from the original respective signal handlers, sans the sporadic attempts to preserve errno, since that's now done by handle_on_main_thread. * atimer.c (alarm_signal_handler): Remove unnecessary decl. * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft. * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Move to sysdep.c. (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Move initialization of main_thread to sysdep.c's init_signals. * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for our usage, and simplifies the mainline code. (record_child_status_change): New static function, as a helper for handle_child_signal, and with most of the old child handler's contents. (CAN_HANDLE_MULTIPLE_CHILDREN): New constant. (handle_child_signal): Use the above. * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Moved here from emacs.c. (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it; code moved here from emacs.c's main function. * sysdep.c, syssignal.h (handle_on_main_thread): New function, replacing the old SIGNAL_THREAD_CHECK. All uses changed. This lets callers save and restore errno properly.
* * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.Paul Eggert2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name) (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file) (file_name_absolute_p, Fsubstitute_in_file_name): (check_executable, check_writable, Ffile_accessible_directory_p) (Fset_file_selinux_context, Fdefault_file_modes) (Finsert_file_contents, choose_write_coding_system) (Fwrite_region, build_annotations, a_write, e_write) (Fdo_auto_save): * filelock.c (boot_time_initialized, get_boot_time) (get_boot_time_1, lock_file_1, within_one_second): * floatfns.c (in_float): * fns.c (concat, internal_equal, Frequire, base64_encode_1) (base64_decode_1, cmpfn_eql, cmpfn_user_defined) (sweep_weak_table, sweep_weak_hash_tables, secure_hash): * lisp.h (struct Lisp_Hash_Table.cmpfn): * window.c (compare_window_configurations): Use bool for booleans. * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits) (Fdefault_file_modes): Now mode_t, not int, for modes. (Fdo_auto_save): Set a boolean to 1 rather than using ++. (internal_delete_file): Now returns void, not a (boolean) int, since nobody was looking at the return value. * lisp.h, window.h: Adjust to above API changes.
* * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT.Paul Eggert2012-07-161-1/+1
| | | | | | | Unlike the other wrapped functions, fabs has an unspecified effect on errno. Fixes: debbugs:11913
* Merge from trunk.Paul Eggert2012-02-101-1/+1
|\
| * Make second arg of copysign non-optional.Chong Yidong2012-01-211-1/+1
| | | | | | | | | | * src/floatfns.c (Fcopysign): Make the second argument non-optional, since nil is not allowed anyway.
* | Merge from trunk.Paul Eggert2012-01-091-1/+1
|\|
| * Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
| |
* | * floatfns.c (Fexpt): Avoid unnecessary multiplications.Paul Eggert2011-10-061-18/+5
| |
* | * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.Paul Eggert2011-09-261-1/+2
|/
* Whitespace changes.Juanma Barranquero2011-09-091-2/+2
|
* isnan: Fix porting problem to Solaris 10 with bundled gcc.Paul Eggert2011-09-061-2/+5
| | | | | | | | | | | | | | Without this fix, the command to link temacs failed due to an undefined symbol __builtin_isnan. This is because /usr/include/iso/math_c99.h #defines isnan(x) to __builtin_isnan(x), but the bundled gcc, which identifies itself as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have a __builtin_isnan. * configure.in (isnan): Remove now-unnecessary check. * src/floatfns.c (isnan): #undef, and then #define to a clone of what's in data.c. (Fisnan): Always define, since it's always available now. (syms_of_floatfns): Always define isnan at the Lisp level.
* Merge from trunk.Paul Eggert2011-07-101-2/+1
|\
| * ProtoizeAndreas Schwab2011-07-101-2/+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.
* | Assume freestanding C89 headers, string.h, stdlib.h.Paul Eggert2011-07-061-3/+0
|/
* * floatfns.c (Fexpt): Omit unnecessary cast to unsigned.Paul Eggert2011-06-121-1/+1
|
* Undo the DEFUN->DEFUE change.Paul Eggert2011-04-131-2/+2
|
* Make Emacs functions such as Fatom 'static' by default.Paul Eggert2011-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove (RET)SIGTYPE; it is identical to void on all supported systems.Glenn Morris2011-03-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg01068.html * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro. (AH_BOTTOM): Do not define SIGTYPE. * lib-src/emacsclient.c: Replace SIGTYPE with void. * nt/config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void). * src/syssignal.h: Replace RETSIGTYPE with void. * src/atimer.c, src/data.c, src/dispnew.c, src/emacs.c, src/floatfns.c: * src/keyboard.c, src/keyboard.h, src/lisp.h, src/process.c, src/sysdep.c: * src/xterm.c: Replace SIGTYPE with void everywhere. * src/s/template.h (SIGTYPE): Remove commented out definition. * src/s/usg5-4-common.h (SIGTYPE): Remove definition. * admin/CPP-DEFINES: Remove SIGTYPE.
* * floatfns.c (Ffrexp, Fldexp): Rename locals to avoid shadowing.Paul Eggert2011-03-161-6/+6
|
* * floatfns.c (domain_error2): Define only if needed.Paul Eggert2011-03-161-2/+3
|
* Refill some long/short copyright headers.Glenn Morris2011-01-261-1/+3
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* 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
| |
* | Fix -Wwrite_strings in general and for Gtk+ specific code.Jan D2010-08-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * callproc.c (synch_process_death): Make const. (Fcall_process): Make signame const. * emacs.c (main): Pass char[] to putenv instead of literal. * floatfns.c (matherr): Use a const char* variable for x->name. * font.c (font_open_by_name): Make name const. * font.h (font_open_by_name): Make name const. * gtkutil.c (get_utf8_string): Always return an allocated string. Parameter is const. (create_dialog, xg_create_one_menuitem, create_menus) (xg_item_label_same_p, xg_update_menu_item): Free result from get_utf8_string. (xg_separator_p, xg_item_label_same_p): label is const. * gtkutil.h: Replace widget_value with struct _widget_value. (enum button_type, struct _widget_value): Remove and use the one from keyboard.h. * keyboard.h (_widget_value): Add defined USE_GTK. Replace Boolean with unsigned char and XtPointer with void *. * menu.c (Fx_popup_menu): error_name is const. * menu.h (w32_menu_show, ns_menu_show, xmenu_show): error parameter is const char **. * w32menu.c (w32_menu_show): * nsmenu.m (ns_menu_show): error parameter is const char **. * process.h (synch_process_death): Is const char*. * xmenu.c (Fx_popup_dialog): error_name is const char*. (xmenu_show): error parameter is const char **. pane_string is const char *. (button_names): Is const char *. (xdialog_show): error_name and pane_string is const. * xrdb.c (get_system_app): Make path const and use char *p for non-const char. * xselect.c (Fx_get_atom_name): Use char empty[] instead of literal "". * xsmfns.c (NOSPLASH_OPT): Change to char[]. (smc_save_yourself_CB): Do xstrdup on all ->type and ->name for props. Free them at the end. * xterm.c (emacs_class): New char[] for EMACS_CLASS. (xim_open_dpy, xim_initialize, xim_close_dpy): Use emacs_class. (x_term_init): Use char[] display_opt and name_opt instead of string literal. file is const char*.
* | Use const char* instead of char*.Dan Nicolaescu2010-08-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of warnings with -Wwrite-strings. * src/xrdb.c (get_environ_db, get_system_name): * src/unexelf.c (find_section): * src/term.c (string_cost, string_cost_one_line, per_line_cost) (get_named_tty, init_tty): * src/sysdep.c (sys_subshell): * src/sound.c (sound_perror, sound_warning, vox_open, vox_init) (alsa_sound_perror, alsa_open, alsa_configure, alsa_init): * src/search.c (Freplace_match): * src/process.c (Fmake_network_process, send_process, init_process): * src/lread.c (Fload, init_lread): * src/keymap.c (Fdescribe_buffer_bindings, describe_map_tree): * src/keyboard.c (parse_tool_bar_item, struct event_head): * src/gtkutil.h (xg_get_font_name): * src/gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name) (make_widget_for_menu_item, make_menu_item, create_menus) (xg_make_tool_item): * src/font.c (parse_matrix, font_parse_name): * src/floatfns.c (rounding_driver, float_error_fn_name): * src/filelock.c (get_boot_time_1, lock_file_1): * src/fileio.c (barf_or_query_if_file_exists, check_writable): * src/editfns.c (get_system_name, get_operating_system_release) (Fencode_time, Fset_time_zone_rule): * src/dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty): * src/buffer.c (defvar_per_buffer): Use const.
* | Convert old-style definitionsAndreas Schwab2010-07-121-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * editfns.c (transpose_markers): Convert old-style definition. * emacs.c (abort, shut_down_emacs, fixup_locale) (synchronize_system_time_locale) (synchronize_system_messages_locale, syms_of_emacs): Likewise. * floatfns.c (extract_float, matherr, init_floatfns) (syms_of_floatfns): Likewise. * fns.c (make_hash_table): Likewise. * ftfont.c (ftfont_get_otf, ftfont_otf_features) (ftfont_otf_capability, ftfont_get_glyph_id, ftfont_get_metrics) (ftfont_drive_otf, ftfont_shape_by_flt, ftfont_shape) (ftfont_variation_glyphs): Likewise. * gtkutil.c (xg_create_widget, xg_modify_menubar_widgets): Likewise. * keymap.c (describe_map_tree, describe_map, describe_vector): Likewise. * lread.c (read_filtered_event): Likewise. * minibuf.c (read_minibuf_noninteractive, read_minibuf): Likewise. * process.c (wait_reading_process_output): Likewise. * scroll.c (do_line_insertion_deletion_costs): Likewise. * search.c (search_buffer, boyer_moore): Likewise. * syntax.c (scan_sexps_forward): Likewise. * xdisp.c (try_scrolling): Likewise. * xfaces.c (face_at_buffer_position, face_for_overlay_string) (face_at_string_position): Likewise. * xfns.c (x_default_scroll_bar_color_parameter): Likewise. * xselect.c (x_get_window_property, receive_incremental_selection) (x_get_window_property_as_lisp_data, lisp_data_to_selection_data): Likewise. * xterm.c (x_draw_relief_rect, x_draw_box_rect): Likewise.
* | Convert DEFUNs to standard C.Dan Nicolaescu2010-07-081-84/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 function definitions and declarations to standard C.Dan Nicolaescu2010-07-051-18/+11
| | | | | | | | | | | | | | | | | | * src/vm-limit.c (memory_warnings): * src/keyboard.c (modify_event_symbol): * src/floatfns.c (rounding_driver, ceiling2, floor2, truncate2) (round2, emacs_rint): * src/process.c (send_process, old_sigpipe): Convert function definitions and declarations to standard C.
* | Convert declarations or definitions to standard C.Dan Nicolaescu2010-07-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.