1. 23 Feb, 2017 2 commits
    • Paul Eggert's avatar
      Merge from gnulib · 7204577b
      Paul Eggert authored
      This incorporates:
      2017-02-16 xbinary-io: rename from xsetmode
      2017-02-15 xsetmode: new module
      * lib-src/etags.c (main):
      * lib-src/hexl.c (main):
      * src/emacs.c (main) [MSDOS]:
      Prefer set_binary_mode to the obsolescent SET_BINARY.
      * lib/binary-io.c, lib/binary-io.h: Copy from gnulib.
      7204577b
    • Paul Eggert's avatar
      hexl: handle large files and I/O errors · 23e64fac
      Paul Eggert authored
      * lib-src/hexl.c: Include inttypes.h, for PRIxMAX etc.
      Do not include ctype.h, as the code no longer uses isdigit.
      (DEFAULT_GROUPING, un_flag, iso_flag, group_by): Now local to ‘main’.
      (DEFAULT_BASE, endian): Remove; was not really used.
      (usage): Remove; now done by ‘main’, as that’s simpler.
      (progname): Now static.
      (output_error, hexchar): New functions.
      (main): Use them.  Simplify.  Remove "-oct", "-big-endian", and
      "-little-endian" options, as they did not work and were not used.
      Use SET_BINARY only on stdin, and fopen with "rb" otherwise.
      Use SET_BINARY only once on stdout.
      Do not assume file offsets fit in ‘long’.
      If an I/O error occurs, report it and exit with nonzero status.
      23e64fac
  2. 01 Jan, 2017 1 commit
  3. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  4. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  5. 01 Jan, 2016 1 commit
  6. 25 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 5.1 x86-64 · 52ba851d
      Paul Eggert authored
      * lib-src/ebrowse.c (dump_sym):
      * lib-src/hexl.c (main):
      * src/ccl.c (ccl_driver):
      * src/character.c (string_escape_byte8):
      * src/dbusbind.c (xd_retrieve_arg, xd_add_watch):
      * src/gnutls.c (Fgnutls_boot):
      * src/gtkutil.c (xg_check_special_colors):
      * src/image.c (x_build_heuristic_mask):
      * src/print.c (safe_debug_print, print_object):
      * src/term.c (produce_glyphless_glyph):
      * src/xdisp.c (get_next_display_element)
      (produce_glyphless_glyph):
      * src/xterm.c (x_draw_glyphless_glyph_string_foreground):
      Don't use a signed format to print an unsigned integer, or vice
      versa.  GCC 5.1's new -Wformat-signedness option warns about this.
      * src/image.c (png_load_body, jpeg_load_body):
      Silence a bogus setjump diagnostic from GCC 5.1 (GCC bug 54561).
      52ba851d
  7. 01 Jan, 2015 2 commits
  8. 14 Jul, 2014 1 commit
    • Paul Eggert's avatar
      Use binary-io module, O_BINARY, and "b" flag. · ba1ed52f
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add binary-io.  It was already
      present implicitly; this just makes the dependence explicit.
      * lib-src/etags.c, lib-src/hexl.c, lib-src/make-docfile.c:
      Include binary-io.h instead of fcntl.h and/or io.h.
      (main): Use set_binary_mode or SET_BINARY
      in place of handcrafted code.
      * lib-src/etags.c (main) [DOS_NT]:
      * lib-src/movemail.c (main) [WINDOWSNT]:
      Don't mess with _fmode.
      * lib-src/etags.c (main, process_file_name, analyse_regex):
      Use fopen/popen's "b" flag instead.
      * lib-src/movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY
      instead.
      * src/callproc.c (create_temp_file): Use mkostemp's O_BINARY flag.
      * src/emacs.c [MSDOS]:
      * src/emacs.c (main) [DOS_NT]: Don't mess with _fmode.
      (main) [MSDOS]: Use SET_BINARY instead of setmode.
      * src/minibuf.c: Include binary-io.h instead of fcntl.h.
      (read_minibuf_noninteractive):
      Use set_binary_mode instead of handcrafted code.
      Don't call emacs_set_tty if emacs_get_tty failed.
      * src/sysdep.c, src/systty.h (emacs_get_tty): Return int, not void.
      * src/sysdep.c (emacs_open, emacs_pipe): Use O_BINARY.
      * src/w32.c (pipe2): Adjust eassert to include O_BINARY.
      
      Fixes: debbugs:18006
      ba1ed52f
  9. 01 Jan, 2014 1 commit
  10. 14 Dec, 2013 1 commit
    • Paul Eggert's avatar
      Use bool for boolean, focusing on headers. · 96c06863
      Paul Eggert authored
      * configure.ac (PTY_OPEN, GC_MARK_SECONDARY_STACK):
      Use bool for boolean.
      * lib-src/emacsclient.c, lib-src/etags.c, lib-src/hexl.c (FALSE, TRUE):
      Remove.  All uses replaced with uncapitalized version.
      * lib-src/emacsclient.c (message):
      * lib-src/etags.c (make_tag, pfnote, consider_token, make_C_tag, lang_names):
      * lib-src/hexl.c (un_flag, iso_flag, endian):
      * lib-src/pop.c (pop_debug, pop_open, pop_multi_first, pop_multi_next)
      (pop_trash):
      Use bool for boolean.
      * lib-src/etags.c (bool): Remove.
      * lib-src/etags.c (globals, members, declarations, no_line_directive)
      (no_duplicates): Use 'int' for boolean values that getopt requires
      to be 'int'.  Formerly, these were 'bool' and 'bool' was 'int',
      but we can no longer rely on this implementation.
      * lib-src/pop.h (struct _popserver): Use bool_bf for boolean bit-fields.
      * lwlib/xlwmenuP.h (XlwMenu_part): Use bool_bf for boolean bit-fields.
      * src/atimer.h, src/lisp.h, src/syssignal.h, src/syswait.h, src/unexelf.c:
      No need to include <stdbool.h>, since conf_post.h does it now.
      * src/buffer.h (BUF_COMPUTE_UNCHANGED, DECODE_POSITION)
      (BUFFER_CHECK_INDIRECTION, GET_OVERLAYS_AT, PER_BUFFER_VALUE_P)
      (SET_PER_BUFFER_VALUE_P):
      * src/ccl.c, src/ccl.h (setup_ccl_program):
      * src/ccl.h (CHECK_CCL_PROGRAM):
      * src/character.h (MAKE_CHAR_UNIBYTE, CHECK_CHARACTER_CAR)
      (CHECK_CHARACTER_CDR, CHAR_STRING_ADVANCE, NEXT_CHAR_BOUNDARY)
      (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE)
      (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE)
      (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, FETCH_CHAR_ADVANCE)
      (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, INC_BOTH)
      (DEC_BOTH, BUF_INC_POS, BUF_DEC_POS):
      * src/charset.h (CHECK_CHARSET, CHECK_CHARSET_GET_ID)
      (CHECK_CHARSET_GET_ATTR, CHECK_CHARSET_GET_CHARSET)
      (CHARSET_FAST_MAP_SET):
      * src/coding.c (decode_coding_ccl, encode_coding_ccl):
      * src/coding.h (CHECK_CODING_SYSTEM, CHECK_CODING_SYSTEM_GET_SPEC)
      (CHECK_CODING_SYSTEM_GET_ID, SJIS_TO_JIS, SJIS_TO_JIS2)
      (JIS_TO_SJIS, JIS_TO_SJIS2, ENCODE_FILE, DECODE_FILE)
      (ENCODE_SYSTEM, DECODE_SYSTEM, ENCODE_UTF_8)
      (decode_coding_c_string):
      * src/composite.h (COMPOSITION_DECODE_REFS, COMPOSITION_DECODE_RULE):
      * src/conf_post.h (has_attribute):
      * src/dispextern.h (trace_redisplay_p):
      (INC_TEXT_POS, DEC_TEXT_POS, SET_GLYPH_FROM_GLYPH_CODE)
      (SET_CHAR_GLYPH, SET_CHAR_GLYPH_FROM_GLYPH)
      (SET_GLYPH_FROM_CHAR_GLYPH):
      (WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P)
      (FACE_SUITABLE_FOR_ASCII_CHAR_P, FACE_SUITABLE_FOR_CHAR_P)
      (PRODUCE_GLYPHS, reset_mouse_highlight, in_display_vector_p)
      (cursor_in_mouse_face_p):
      * src/dispnew.c (adjust_glyph_matrix, clear_glyph_matrix_rows)
      (blank_row, prepare_desired_row)
      (build_frame_matrix_from_leaf_window, make_current)
      (mirror_make_current, mirrored_line_dance, mirror_line_dance)
      (update_window, scrolling_window, update_frame_line):
      * src/disptab.h (GLYPH_FOLLOW_ALIASES):
      * src/editfns.c (Fformat):
      * src/font.h (FONT_WEIGHT_SYMBOLIC, FONT_SLANT_SYMBOLIC)
      (FONT_WIDTH_SYMBOLIC, FONT_WEIGHT_FOR_FACE, FONT_SLANT_FOR_FACE)
      (FONT_WIDTH_FOR_FACE, FONT_WEIGHT_NAME_NUMERIC)
      (FONT_SLANT_NAME_NUMERIC, FONT_WIDTH_NAME_NUMERIC)
      (FONT_SET_STYLE, CHECK_FONT, CHECK_FONT_SPEC, CHECK_FONT_ENTITY)
      (CHECK_FONT_OBJECT, CHECK_FONT_GET_OBJECT, FONT_ADD_LOG)
      (FONT_DEFERRED_LOG):
      * src/frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_WINDOW_P):
      (FRAME_EXTERNAL_TOOL_BAR, FRAME_EXTERNAL_MENU_BAR, FOR_EACH_FRAME)
      (FRAME_MOUSE_UPDATE):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/image.c (x_create_bitmap_from_data, x_create_bitmap_mask)
      (x_create_bitmap_from_xpm_data, xpm_load_image):
      * src/intervals.h (INTERVAL_HAS_PARENT, INTERVAL_PARENT)
      (set_interval_parent, RESET_INTERVAL, COPY_INTERVAL_CACHE)
      (MERGE_INTERVAL_CACHE):
      * src/keymap.h (KEYMAPP):
      * src/lisp.h (eassert, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE)
      (STRING_SET_UNIBYTE, STRING_SET_MULTIBYTE, DEFSYM, PSEUDOVECTORP)
      (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER)
      (CHECK_NUMBER_COERCE_MARKER, CHECK_NUMBER_OR_FLOAT_COERCE_MARKER)
      (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT)
      (DEFVAR_BUFFER_DEFAULTS, DEFVAR_KBOARD, QUIT)
      (RETURN_UNGCPRO, USE_SAFE_ALLOCA, SAFE_NALLOCA, SAFE_FREE)
      (SAFE_ALLOCA_LISP, FOR_EACH_ALIST_VALUE, functionp):
      * src/syntax.h (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX)
      (UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD)
      (SETUP_BUFFER_SYNTAX_TABLE):
      * src/systime.h (timespec_valid_p):
      * src/term.c (save_and_enable_current_matrix):
      * src/window.h (WINDOW_MENU_BAR_P, WINDOW_TOOL_BAR_P):
      * src/xdisp.c (in_display_vector_p, display_tool_bar_line)
      (redisplay_internal, try_window_reusing_current_matrix)
      (sync_frame_with_window_matrix_rows, try_window_id)
      (display_menu_bar, display_tty_menu_item, display_mode_line)
      (coords_in_mouse_face_p, cursor_in_mouse_face_p):
      * src/xmenu.c (xmenu_show):
      * src/xterm.c (use_xim, x_term_init):
      * src/xterm.h (XSync, GTK_CHECK_VERSION, use_xim, SET_SCROLL_BAR_X_WIDGET)
      (struct x_bitmap_record):
      Use bool for booleans.
      * src/ccl.c (struct buffer_text):
      * src/ccl.h (struct ccl_program):
      * src/charset.h (struct charset):
      * src/cm.h (struct cm):
      * src/coding.h (struct iso_2022_spec, struct coding_system):
      * src/dispextern.h (struct glyph, struct glyph_matrix, struct glyph_row)
      (struct glyph_string, struct face, struct face_cache)
      (struct bidi_string_data, struct bidi_it)
      (struct draw_fringe_bitmap_params, struct it, Mouse_HLInfo)
      (struct image):
      * src/editfns.c (Fformat):
      * src/frame.h (struct frame):
      * src/fringe.c (struct fringe_bitmap):
      * src/intervals.h (struct interval):
      * src/keyboard.h (struct kboard):
      * src/lisp.h (struct Lisp_Symbol, struct Lisp_Misc_Any, struct Lisp_Marker)
      (struct Lisp_Overlay, struct Lisp_Save_Value, struct Lisp_Free)
      (struct Lisp_Buffer_Local_Value, union specbinding):
      * src/macfont.m (struct macfont_info):
      * src/process.h (struct Lisp_Process):
      * src/termchar.h (struct tty_display_info):
      * src/window.h (struct window):
      * src/xterm.h (struct x_output):
      Use bool_bf for boolean bit-fields.
      * src/ccl.c (setup_ccl_program): Now returns bool instead of -1 or 0.
      All callers changed.
      * src/ccl.h (struct ccl_program): Remove unused members private_state,
      src_multibyte, dst_multibyte, cr_consumed, suppress_error,
      eight_bit_control.
      (struct ccl_spec): Remove unused members cr_carryover,
      eight_bit_carryover.
      * src/conf_post.h: Include <stdbool.h>.
      (bool_bf): New type.
      * src/dispextern.h (TRACE, PREPARE_FACE_FOR_DISPLAY):
      * src/interval.h (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE)
      Surround statement macro with proper 'do { ... } while (false)' brackets.
      (SET_MATRIX_ROW_ENABLED_P): Assume 2nd arg is bool.
      (PRODUCE_GLYPHS): Simplify use of boolean.
      * src/fileio.c (Fcopy_file):
      If I is an integer, prefer 'if (I != 0)' to 'if (I)'.
      * src/lisp.h (UNGCPRO): Return void, not int.
      (FOR_EACH_TAIL): Use void expression, not int expression.
      * src/region-cache.c: Reindent.
      * src/region-cache.h: Copy comments from region-cache.c, to fix
      incorrect remarks about booleans.
      96c06863
  11. 01 Jan, 2013 1 commit
  12. 26 Jun, 2012 1 commit
  13. 24 Jun, 2012 1 commit
  14. 11 Jan, 2012 1 commit
  15. 05 Jan, 2012 1 commit
  16. 09 Sep, 2011 1 commit
  17. 25 Jan, 2011 1 commit
  18. 23 Jan, 2011 1 commit
  19. 15 Jan, 2011 1 commit
  20. 02 Jan, 2011 1 commit
  21. 24 Jul, 2010 1 commit
    • Dan Nicolaescu's avatar
      Add NO_RETURN specifiers to functions in lib-src. · 68441b90
      Dan Nicolaescu authored
      * lib-src/update-game-score.c (usage):  Add NO_RETURN specifier.
      * lib-src/movemail.c (fatal, pfatal_with_name, pfatal_and_delete):
      * lib-src/make-docfile.c (fatal):
      * lib-src/hexl.c (usage):
      * lib-src/fakemail.c (fatal):
      * lib-src/etags.c (fatal, suggest_asking_for_help, pfatal):
      * lib-src/emacsclient.c (fatal):
      * lib-src/b2m.c (fatal): Likewise.
      68441b90
  22. 03 Jul, 2010 1 commit
    • Dan Nicolaescu's avatar
      Convert function definitions to standard C. · 873fbd0b
      Dan Nicolaescu authored
      * lib-src/update-game-score.c: Convert function definitions to standard C.
      * lib-src/sorted-doc.c:
      * lib-src/profile.c:
      * lib-src/pop.c:
      * lib-src/movemail.c:
      * lib-src/make-docfile.c:
      * lib-src/hexl.c:
      * lib-src/fakemail.c:
      * lib-src/etags.c:
      * lib-src/ebrowse.c:
      * lib-src/digest-doc.c:
      * lib-src/b2m.c: Likewise.
      873fbd0b
  23. 13 Jan, 2010 1 commit
  24. 10 Jan, 2009 1 commit
  25. 08 Jan, 2009 1 commit
  26. 09 May, 2008 1 commit
  27. 07 Jan, 2008 1 commit
  28. 25 Jul, 2007 1 commit
  29. 16 Jan, 2007 1 commit
  30. 06 Feb, 2006 1 commit
  31. 07 Aug, 2005 1 commit
  32. 04 Jul, 2005 1 commit
  33. 09 Nov, 2004 1 commit
  34. 08 May, 2004 1 commit
  35. 16 Apr, 2004 1 commit
  36. 08 Sep, 2003 1 commit
  37. 01 Sep, 2003 1 commit
  38. 30 Dec, 2001 1 commit