* buffer.c (Fmove_overlay): Delete an evaporating overlay
[bpt/emacs.git] / src / ChangeLog
CommitLineData
535272bb 12011-09-30 Paul Eggert <eggert@cs.ucla.edu>
d311d28c
PE
2
3 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5 (string_bytes, check_sblock, allocate_string_data):
6 (compact_small_strings, Fmake_bool_vector, make_string)
7 (make_unibyte_string, make_multibyte_string)
8 (make_string_from_bytes, make_specified_string)
9 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
10 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11 (mark_vectorlike):
12 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13 (allocate_pseudovector):
14 Use int, not EMACS_INT, where int is wide enough.
15 (inhibit_garbage_collection, Fgarbage_collect):
16 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
17 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
18 int might not be wide enough.
19 (bidi_cache_search, bidi_cache_find, bidi_init_it)
20 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
21 (bidi_at_paragraph_end, bidi_find_paragraph_start)
22 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
23 (bidi_level_of_next_char, bidi_move_to_visually_next):
24 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
25 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
26 (Fkill_buffer, Fset_buffer_major_mode)
27 (advance_to_char_boundary, Fbuffer_swap_text)
28 (Fset_buffer_multibyte, overlays_at, overlays_in)
29 (overlay_touches_p, struct sortvec, record_overlay_string)
30 (overlay_strings, recenter_overlay_lists)
31 (adjust_overlays_for_insert, adjust_overlays_for_delete)
32 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
33 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
34 (Foverlay_recenter, last_overlay_modification_hooks_used)
35 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
36 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
37 (validate_region): Omit unnecessary test for b <= e, since
38 that's guaranteed by the previous test.
39 (adjust_overlays_for_delete): Avoid pos + length overflow.
40 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
41 (report_overlay_modification):
42 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
43 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
44 Omit pointer cast, which isn't needed anyway, and doesn't work
45 after the EMACS_INT -> ptrdiff_t change.
79cce3f2
PE
46 (Fmove_overlay): Delete an evaporating overlay
47 if it becomes empty after its bounds are adjusted to fit within
48 its buffer. Without this fix, in a nonempty buffer (let ((o
49 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
50 yields an empty overlay that has the evaporate property, which is
51 not supposed to happen. (Bug#9642)
d311d28c
PE
52 * buffer.h: Adjust decls to match defn changes elsewhere.
53 (struct buffer_text, struct buffer):
54 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
55 Use EMACS_INT, not int, where int might not be wide enough.
56 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, to avoid
57 needless 32-bit limit on 64-bit hosts. Remove unnecessary
58 memory-full test. Use EMACS_INT, not ptrdiff_t or int, where
59 ptrdiff_t or int might not be wide enough.
60 * callint.c (Fcall_interactively):
61 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
62 * callproc.c (call_process_kill, Fcall_process):
63 Don't assume pid_t fits into an Emacs fixnum.
64 (call_process_cleanup, Fcall_process, child_setup):
65 Don't assume pid_t fits into int.
66 (call_process_cleanup, Fcall_process, delete_temp_file)
67 (Fcall_process_region):
68 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
69 (Fcall_process): Simplify handling of volatile integers.
70 Use int, not EMACS_INT, where int will do.
71 * casefiddle.c (casify_object, casify_region, operate_on_word)
72 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
73 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
74 (casify_object): Avoid integer overflow when overallocating buffer.
75 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 76 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
77 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
78 * category.h (CATEGORYP): Don't assume arg is nonnegative.
79 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
80 integers are now checked earlier. All uses replaced with XINT.
81 (ccl_driver):
82 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
83 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
84 (ccl_driver, Fregister_code_conversion_map):
85 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
86 (resolve_symbol_ccl_program): Check that vector header is in range.
87 Always copy the vector, so that we can check its contents reliably
88 now rather than having to recheck each instruction as it's being
89 executed. Check that vector words fit in 'int'.
90 (ccl_get_compiled_code, Fregister_ccl_program)
91 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
92 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
93 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
94 contents are in range.
95 (Fccl_execute_on_string): Check that status is in range.
96 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
97 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
98 Accept and return EMACS_INT, not int, because callers can pass values
99 out of 'int' range.
100 (c_string_width, strwidth, lisp_string_width, chars_in_text)
101 (multibyte_chars_in_text, parse_str_as_multibyte)
102 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
103 (str_as_unibyte, str_to_unibyte, string_count_byte8)
104 (string_escape_byte8, Fget_byte):
105 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
106 (Funibyte_string): Use CHECK_CHARACTER, not CHECK_NATNUM, to
107 avoid mishandling large integers.
108 * character.h: Adjust decls to match defn changes elsewhere.
109 * charset.c (load_charset_map_from_file, find_charsets_in_text)
110 (Ffind_charset_region):
111 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
112 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
113 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 114 Don't assume fixnum fits in int.
d311d28c
PE
115 (load_charset_map_from_vector, Fmap_charset_chars):
116 Remove now-unnecessary CHECK_NATNUMs.
117 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
118 Don't rely on undefined behavior with signed left shift overflow.
119 Don't assume unsigned int fits into fixnum, or that fixnum fits
120 into unsigned int. Don't require max_code to be a valid fixnum;
121 that's not true for gb10830 4-byte on a 32-bit host. Allow
122 invalid_code to be a cons, for the same reason. Require code_offset
123 to be a character. Avoid int overflow if max_char is close
124 to INT_MAX.
125 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
126 this is intended anyway and avoids some undefined behavior.
127 (load_charset_map): Pass unsigned, not int, as 2nd arg of
128 INDEX_TO_CODE_POINT, as that's what it expects.
129 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
130 * charset.h (DECODE_CHAR): Return int, not unsigned;
131 this is what was intended anyway, and it avoids undefined behavior.
132 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
133 integer-overflow issues.
134 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
135 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
136 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
137 * chartab.c (Fmake_char_table, Fset_char_table_range)
138 (uniprop_get_decoder, uniprop_get_encoder):
139 Don't assume fixnum fits in int.
140 * cmds.c (move_point): New function, that does the gist of
141 Fforward_char and Fbackward_char, but does so while checking
142 for integer overflow more accurately.
c96e5d6a 143 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
144 (Fforward_line, Fend_of_line, internal_self_insert)
145 (internal_self_insert):
146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
147 Fix a FIXME, by checking for integer overflow when calculating
148 target_clm and actual_clm.
149 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
150 (ASSURE_DESTINATION, coding_alloc_by_realloc)
151 (coding_alloc_by_making_gap, alloc_destination)
152 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
153 (encode_coding_utf_16, detect_coding_emacs_mule)
154 (decode_coding_emacs_mule, encode_coding_emacs_mule)
155 (detect_coding_iso_2022, decode_coding_iso_2022)
156 (encode_invocation_designation, encode_designation_at_bol)
157 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
158 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
159 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
160 (encode_coding_ccl, encode_coding_raw_text)
161 (detect_coding_charset, decode_coding_charset)
162 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
163 (produce_composition, produce_charset, produce_annotation)
164 (decode_coding, handle_composition_annotation)
165 (handle_charset_annotation, consume_chars, decode_coding_gap)
166 (decode_coding_object, encode_coding_object, detect_coding_system)
167 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
168 (code_convert_region, code_convert_string)
169 (Fdefine_coding_system_internal):
170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
171 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
172 (Fdefine_coding_system_internal):
173 Don't assume fixnums fit in int.
174 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 175 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
176 (Funencodable_char_position, Fcheck_coding_systems_region)
177 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2c6a9faa 179 (consume_chars): Rewrite to avoid calculating an address outside buffer.
d311d28c 180 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 181 Don't access memory outside of the args array.
d311d28c 182 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
183 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
184 result of ENCODE_CHAR.
d311d28c
PE
185 * coding.h: Adjust decls to match defn changes elsewhere.
186 (struct coding_system):
187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
188 * composite.c (get_composition_id, find_composition)
189 (run_composition_function, update_compositions)
190 (compose_text, composition_gstring_put_cache)
191 (composition_gstring_p, composition_gstring_width)
192 (fill_gstring_header, fill_gstring_body, autocmp_chars)
193 (composition_compute_stop_pos, composition_reseat_it)
194 (composition_update_it, struct position_record)
195 (find_automatic_composition, composition_adjust_point)
196 (Fcomposition_get_gstring, Ffind_composition_internal):
197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
198 (update_compositions):
199 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
200 * composite.h: Adjust decls to match defn changes elsewhere.
201 (struct composition):
202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
203 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
204 Do not attempt to compute the address of the object just before a
205 buffer; this is not portable.
206 (Faref, Faset):
207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
208 (Faset): Use int, not EMACS_INT, where int is wide enough.
209 (Fstring_to_number): Don't assume fixnums fit in int.
210 (Frem): Don't assume arg is nonnegative.
211 * dbusbind.c (xd_append_arg): Check for integers out of range.
212 (Fdbus_call_method): Don't overflow the timeout int.
213 * dired.c (directory_files_internal, file_name_completion, scmp)
214 (file_name_completion_stat):
215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
216 (file_name_completion): Don't overflow matchcount.
217 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
218 * dispextern.h: Adjust decls to match defn changes elsewhere.
219 (struct text_pos, struct glyph, struct bidi_saved_info)
220 (struct bidi_string_data, struct bidi_it, struct composition_it)
221 (struct it):
222 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
223 (struct display_pos, struct composition_it, struct it):
224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
225 * dispnew.c (increment_matrix_positions)
226 (increment_row_positions, mode_line_string)
227 (marginal_area_string):
228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 229 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
230 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
231 (duration_to_sec_usec): New function, to check for overflow better.
232 (Fsleep_for, sit_for): Use it.
233 * doc.c (get_doc_string, store_function_docstring):
234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
235 (get_doc_string, Fsnarf_documentation):
236 Use int, not EMACS_INT, where int is wide enough.
237 (get_doc_string):
238 Use SAFE_ALLOCA, not alloca.
239 Check for overflow when converting EMACS_INT to off_t.
240 * doprnt.c (doprnt):
241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
242 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
243 Don't assume uid_t fits into fixnum.
244 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
245 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
246 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
247 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
248 (general_insert_function)
249 (Finsert_char, make_buffer_string, make_buffer_string_both)
250 (update_buffer_properties, Fbuffer_substring)
251 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
252 (Fsubst_char_in_region, check_translation)
253 (Ftranslate_region_internal, save_restriction_restore, Fformat)
254 (transpose_markers, Ftranspose_regions):
255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
256 (clip_to_bounds): Move to lisp.h as an inline function).
257 (Fconstrain_to_field): Don't assume integers are nonnegative.
258 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
259 (Fsubst_char_in_region, Fsave_restriction):
260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
261 (Femacs_pid): Don't assume pid_t fits into fixnum.
262 (lo_time): Use int, not EMACS_INT, when int suffices.
263 (lisp_time_argument): Check for usec out of range.
264 (Fencode_time): Don't assume fixnum fits in int.
265 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
266 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
267 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
268 (init_cmdargs, Fdump_emacs):
269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
270 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
271 the bottom (typically) 32 bits of the fixnum.
272 * eval.c (specpdl_size, call_debugger):
273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
274 (when_entered_debugger, Fbacktrace_debug):
275 Don't assume fixnum can fit in int.
276 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
277 the object just before a buffer; this is not portable.
278 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
279 (grow_specpdl, unbind_to):
280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
281 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
282 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 283 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
284 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
285 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
286 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
287 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
288 (a_write, e_write):
289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
290 (Fcopy_file, non_regular_nbytes, read_non_regular)
291 (Finsert_file_contents):
292 Use int, not EMACS_INT, where int is wide enough.
293 (READ_BUF_SIZE): Verify that it fits in int.
294 (Finsert_file_contents): Check that counts are in proper range,
295 rather than assuming fixnums fit into ptrdiff_t etc.
296 Don't assume fixnums fit into int.
125b3835 297 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
298 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
299 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
300 (string_char_to_byte, string_byte_to_char)
301 (string_make_multibyte, string_to_multibyte)
302 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
303 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
304 (substring_both, Fdelete, internal_equal, Ffillarray)
305 (Fclear_string, mapcar1)
306 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
307 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
308 (larger_vector, make_hash_table, maybe_resize_hash_table)
309 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
310 (Fmaphash, secure_hash):
311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
312 (concat): Check for string index and length overflow.
313 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
314 (Frequire):
315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
316 (larger_vector): New API (vec, incr_min, size_max) replaces old
317 one (vec, new_size, init). This catches size overflow.
318 INIT was removed because it was always Qnil.
319 All callers changed.
320 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
321 the upper bound on a hash table index size.
322 (make_hash_table, maybe_resize_hash_table): Use it.
323 (secure_hash): Computer start_byte and end_byte only after
324 they're known to be in ptrdiff_t range.
325 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
326 (Ffont_get_glyphs, Ffont_at):
327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
328 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
329 (Flist_fonts, Fopen_font):
330 Don't assume fixnum can fit in int.
331 (check_gstring): Don't assume index can fit in int.
332 (font_match_p): Check that fixnum is a character, not a nonnegative
333 fixnum, since the later code needs to stuff it into an int.
334 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
335 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
336 conversion overflow issues.
337 (Fopen_font): Check for integer out of range.
338 (Ffont_get_glyphs): Don't assume index can fit in int.
339 * font.h: Adjust decls to match defn changes elsewhere.
340 * fontset.c (reorder_font_vector): Redo score calculation to avoid
341 integer overflow.
342 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
343 printmax_t, where ptrdiff_t is wide enough.
344 (Finternal_char_font):
345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
346 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
347 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
348 (Fset_frame_position, x_set_frame_parameters)
349 (x_set_line_spacing, x_set_border_width)
350 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
351 Check that fixnums are in proper range for system types.
352 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
354 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
355 Use SAFE_ALLOCA_LISP, not alloca.
356 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
357 intptr_t is wide enough.
358 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
359 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
360 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
361 Check for fixnum out of range.
362 * ftfont.c (ftfont_list): Don't assume index fits in int.
363 Check that fixnums are in proper range for system types.
364 (ftfont_shape_by_flt):
365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
366 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
368 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
369 Check that fixnums are in proper range for system types.
370 * gnutls.h: Adjust decls to match defn changes elsewhere.
371 * gtkutil.c (xg_dialog_run):
372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
373 (update_frame_tool_bar):
374 Check that fixnums are in proper range for system types.
375 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 376 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
377 * indent.c (last_known_column, last_known_column_point):
378 (current_column_bol_cache):
379 (skip_invisible, current_column, check_display_width):
380 (check_display_width, scan_for_column, current_column_1)
381 (Findent_to, Fcurrent_indentation, position_indentation)
382 (indented_beyond_p, Fmove_to_column, compute_motion):
383 (Fcompute_motion, Fvertical_motion):
384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
385 (last_known_column_modified): Use EMACS_INT, not int.
386 (check_display_width):
387 (Fcompute_motion):
388 Check that fixnums and floats are in proper range for system types.
389 (compute_motion): Don't assume index or fixnum fits in int.
390 (compute_motion, Fcompute_motion):
391 Use int, not EMACS_INT, when it is wide enough.
392 (vmotion): Omit local var start_hpos that is always 0; that way
393 we don't need to worry about overflow in expressions involving it.
394 * indent.h: Adjust decls to match defn changes elsewhere.
395 (struct position):
396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
397 Use int, not EMACS_INT, where int is wide enough.
398 Remove unused members ovstring_chars_done and tab_offset;
399 all uses removed.
400 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
401 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
402 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
403 (make_gap, copy_text, insert, insert_and_inherit)
404 (insert_before_markers, insert_before_markers_and_inherit)
405 (insert_1, count_combining_before, count_combining_after)
406 (insert_1_both, insert_from_string)
407 (insert_from_string_before_markers, insert_from_string_1)
408 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
409 (adjust_after_replace, adjust_after_insert, replace_range)
410 (replace_range_2, del_range, del_range_1, del_range_byte)
411 (del_range_both, del_range_2, modify_region)
412 (prepare_to_modify_buffer, signal_before_change)
413 (signal_after_change, Fcombine_after_change_execute):
414 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
415 * intervals.c (traverse_intervals, rotate_right, rotate_left)
416 (balance_an_interval, split_interval_right, split_interval_left)
417 (find_interval, next_interval, update_interval)
418 (adjust_intervals_for_insertion, delete_node, delete_interval)
419 (interval_deletion_adjustment, adjust_intervals_for_deletion)
420 (static_offset_intervals, offset_intervals)
421 (merge_interval_right, merge_interval_left, make_new_interval)
422 (graft_intervals_into_buffer, temp_set_point_both)
423 (temp_set_point, set_point, adjust_for_invis_intang)
424 (set_point_both, move_if_not_intangible, get_property_and_range)
425 (get_local_map, copy_intervals, copy_intervals_to_string)
426 (compare_string_intervals, set_intervals_multibyte_1):
427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
428 * intervals.h: Adjust decls to match defn changes elsewhere.
429 (struct interval):
430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
431 * keyboard.c (this_command_key_count, this_single_command_key_start)
432 (before_command_key_count, before_command_echo_length, echo_now)
433 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
434 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
435 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
436 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
438 (last_non_minibuf_size, last_point_position, echo_truncate)
439 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
440 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
441 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
442 (stuff_buffered_input):
443 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
444 (last_auto_save, command_loop_1, read_char):
445 Use EMACS_INT, not int, to avoid integer overflow.
446 (record_char): Avoid overflow in total_keys computation.
447 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
448 * keyboard.h: Adjust decls to match defn changes elsewhere.
449 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
450 (Fkey_description, Fdescribe_vector, Flookup_key):
451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
452 (click_position): New function, to check that positions are in range.
453 (Fcurrent_active_maps):
454 (describe_command):
455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
456 (Faccessible_keymaps, Fkey_description):
457 (preferred_sequence_p):
458 Don't assume fixnum can fit into int.
459 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
460 Check for integer overflow in size calculations.
461 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
462 avoid mishandling large integers.
463 * lisp.h: Adjust decls to match defn changes elsewhere.
464 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
465 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
466 (struct Lisp_Marker):
467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
468 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
469 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
470 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
471 All callers changed.
472 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
473 Assume the arg has valid form, since it always does.
474 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
475 unsigned integer system type.
476 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
477 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
479 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
480 (duration_to_sec_usec): New decl.
481 * lread.c (read_from_string_index, read_from_string_index_byte)
482 (read_from_string_limit, readchar, unreadchar, openp)
483 (read_internal_start, read1, oblookup):
484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
485 (Fload, readevalloop, Feval_buffer, Feval_region):
486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
487 (openp): Check for out-of-range argument to 'access'.
488 (read1): Use int, not EMACS_INT, where int is wide enough.
489 Don't assume fixnum fits into int.
1ab7b8ac
PE
490 (read_filtered_event): Use duration_to_sec_usec
491 to do proper overflow checking on durations.
d311d28c
PE
492 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
493 in size calculation.
494 (Fexecute_kbd_macro):
495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
496 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
497 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
498 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
499 (set_marker_both, set_marker_restricted_both, marker_position)
500 (marker_byte_position, Fbuffer_has_markers_at):
501 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
502 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
503 * menu.c (ensure_menu_items): Renamed from grow_menu_items.
504 It now merely ensures that the menu is large enough, without
505 necessarily growing it, as this avoids some integer overflow issues.
506 All callers changed.
507 (keymap_panes, parse_single_submenu, Fx_popup_menu):
508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
509 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
510 Use SAFE_ALLOCA_LISP, not alloca.
511 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
512 to EMACS_INT. Check that fixnums are in proper range for system types.
513 * minibuf.c (minibuf_prompt_width, string_to_object)
514 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
515 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
517 (get_minibuffer, read_minibuf_unwind):
518 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
519 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
520 this simplifies overflow checking. All callers changed.
521 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
522 (Ftest_completion):
523 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
524 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
525 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
526 Check that fixnums are in proper range for system types.
527 (Fx_create_frame, Fx_show_tip):
528 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
529 * nsfont.m (ns_findfonts, nsfont_list_family):
530 Don't assume fixnum fits in long.
531 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
532 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
533 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
534 wide enough.
17fdb222 535 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
536 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
537 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
538 (PRINTDECLARE, PRINTPREPARE):
539 (strout, print_string):
540 (print, print_preprocess, print_check_string_charset_prop)
541 (print_object):
542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
543 (PRINTDECLARE):
544 (temp_output_buffer_setup, Fprin1_to_string, print_object):
545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
546 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
547 (PRINTFINISH): Use SAFE_ALLOCA, not alloca.
548 (printchar, strout): Use xpalloc to catch size calculation overflow.
549 (Fexternal_debugging_output): Use CHECK_CHARACTER, not CHECK_NUMBER,
550 to avoid mishandling large integers.
551 (print_error_message): Use SAFE_ALLOCA, not alloca.
552 (print_object): Use int, not EMACS_INT, where int is wide enough.
553 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
554 (Fset_process_window_size, Fformat_network_address)
555 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
556 (Fsignal_process, sigchld_handler):
557 Check that fixnums are in proper range for system types.
558 (Fformat_network_address, read_process_output, send_process)
559 (Fprocess_send_region, status_notify):
560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
561 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
562 (wait_reading_process_output, read_process_output, exec_sentinel):
563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
564 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
565 (Faccept_process_output): Use duration_to_sec_usec to do proper
566 overflow checking on durations.
b62b53e8
PE
567 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
568 configured --with-wide-int.
d311d28c
PE
569 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
570 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
571 * search.c (looking_at_1, string_match_1):
572 (fast_string_match, fast_c_string_match_ignore_case)
573 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
574 (scan_newline, find_before_next_newline, search_command)
575 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
576 (set_search_regs, wordify):
577 (Freplace_match):
578 (Fmatch_data):
579 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
580 (string_match_1, search_buffer, set_search_regs):
581 (Fmatch_data):
582 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
583 (wordify): Check for overflow in size calculation.
584 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
585 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
586 Check that fixnums are in proper range for system types.
587 * sound.c (struct sound_device)
588 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
590 (Fplay_sound_internal):
591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
592 * syntax.c (ST_COMMENT_STYLE, ST_STRING_STYLE):
593 In definitions, make it clearer that these values must be out of range
5895d7b9
PE
594 for the respective integer ranges. This fixes a bug with
595 ST_STRING_STYLE and non-ASCII characters.
d311d28c
PE
596 (struct lisp_parse_state, find_start_modiff)
597 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
598 (Fparse_partial_sexp):
599 Don't assume fixnums can fit in int.
600 (struct lisp_parse_state, find_start_pos, find_start_value)
601 (find_start_value_byte, find_start_begv)
602 (update_syntax_table, char_quoted, dec_bytepos)
603 (find_defun_start, prev_char_comend_first, back_comment):
604 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
605 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
607 (Finternal_describe_syntax_value): Check that match_lisp is a
608 character, not an integer, since the code stuffs it into int.
609 (scan_words, scan_sexps_forward):
610 Check that fixnums are in proper range for system types.
611 (Fforward_word):
612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
613 (scan_sexps_forward):
614 Use CHARACTERP, not INTEGERP, since the value must fit into int.
615 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
616 * syntax.h: Adjust decls to match defn changes elsewhere.
617 (struct gl_state_s):
618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
619 * sysdep.c (wait_for_termination_1, wait_for_termination)
620 (interruptible_wait_for_termination, mkdir):
621 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
622 (emacs_read, emacs_write):
623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
624 (system_process_attributes): Don't assume uid_t, gid_t, and
625 double all fit in int or even EMACS_INT.
626 * term.c (set_tty_color_mode):
627 Check that fixnums are in proper range for system types.
628 * termhooks.h (struct input_event):
629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
630 * textprop.c (validate_interval_range, interval_of)
631 (Fadd_text_properties, set_text_properties_1)
632 (Fremove_text_properties, Fremove_list_of_text_properties)
633 (Ftext_property_any, Ftext_property_not_all)
634 (copy_text_properties, text_property_list, extend_property_ranges)
635 (verify_interval_modification):
636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
637 (Fnext_single_char_property_change)
638 (Fprevious_single_char_property_change):
639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
640 (copy_text_properties):
641 Check for integer overflow in index calculation.
d311d28c
PE
642 * undo.c (last_boundary_position, record_point, record_insert)
643 (record_delete, record_marker_adjustment, record_change)
644 (record_property_change):
645 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
646 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
648 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
649 (Fx_hide_tip, Fx_file_dialog):
650 * w32menu.c (set_frame_menubar):
651 Use ptrdiff_t, not int, for consistency with rest of code.
652 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
653 (select_window, Fdelete_other_windows_internal)
654 (window_scroll_pixel_based, window_scroll_line_based)
655 (Frecenter, Fset_window_configuration):
656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
657 (Fset_window_hscroll, run_window_configuration_change_hook)
658 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 659 (Fscroll_other_window, Frecenter):
d311d28c
PE
660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
661 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
662 Don't assume fixnum fits in int.
663 (Fset_window_scroll_bars):
664 Check that fixnums are in proper range for system types.
665 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
666 (string_pos, c_string_pos, number_of_chars, init_iterator)
667 (in_ellipses_for_invisible_text_p, init_from_display_pos)
668 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
669 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
670 (face_before_or_after_it_pos, handle_invisible_prop)
671 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
672 (display_prop_intangible_p, string_buffer_position_lim)
673 (string_buffer_position, handle_composition_prop, load_overlay_strings)
674 (get_overlay_strings_1, get_overlay_strings)
675 (iterate_out_of_display_property, forward_to_next_line_start)
676 (back_to_previous_visible_line_start, reseat, reseat_to_string)
677 (get_next_display_element, set_iterator_to_next)
678 (get_visually_first_element, compute_stop_pos_backwards)
679 (handle_stop_backwards, next_element_from_buffer)
680 (move_it_in_display_line_to, move_it_in_display_line)
681 (move_it_to, move_it_vertically_backward, move_it_by_lines)
682 (add_to_log, message_dolog, message_log_check_duplicate)
683 (message2, message2_nolog, message3, message3_nolog
684 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
685 (current_message_1, truncate_echo_area, truncate_message_1)
686 (set_message, set_message_1, store_mode_line_noprop)
687 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
688 (text_outside_line_unchanged_p, check_point_in_composition)
689 (reconsider_clip_changes)
690 (redisplay_internal, set_cursor_from_row, try_scrolling)
691 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
692 (redisplay_window, find_last_unchanged_at_beg_row)
693 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
694 (trailing_whitespace_p, find_row_edges, display_line)
695 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
696 (display_mode_element, store_mode_line_string)
697 (pint2str, pint2hrstr, decode_mode_spec)
698 (display_count_lines, display_string, draw_glyphs)
699 (x_produce_glyphs, x_insert_glyphs)
700 (rows_from_pos_range, mouse_face_from_buffer_pos)
701 (fast_find_string_pos, mouse_face_from_string_pos)
702 (note_mode_line_or_margin_highlight, note_mouse_highlight):
703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
704 (safe_call, init_from_display_pos, handle_fontified_prop)
705 (handle_single_display_spec, load_overlay_strings)
706 (with_echo_area_buffer, setup_echo_area_for_printing)
707 (display_echo_area, echo_area_display)
708 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
709 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
710 (redisplay_window, dump_glyph_row, display_mode_line)
711 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 712 (handle_display_spec, display_prop_string_p):
d311d28c
PE
713 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
714 (handle_single_display_spec, build_desired_tool_bar_string)
715 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
716 (get_specified_cursor_type):
717 Check that fixnums are in proper range for system types.
718 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
719 (Flookup_image_map):
720 Don't assume fixnums fit in int.
721 (compare_overlay_entries):
722 Avoid mishandling comparisons due to subtraction overflow.
723 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
724 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
725 (handle_tool_bar_click):
726 Use int, not unsigned, since we prefer signed and the signedness
727 doesn't matter here.
728 (get_next_display_element, next_element_from_display_vector):
729 Use int, not EMACS_INT, when int is wide enough.
730 (start_hourglass): Use duration_to_sec_usec to do proper
731 overflow checking on durations.
732 * xfaces.c (Fbitmap_spec_p):
733 Check that fixnums are in proper range for system types.
734 (compare_fonts_by_sort_order):
735 Avoid mishandling comparisons due to subtraction overflow.
736 (Fx_family_fonts, realize_basic_faces):
737 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
738 (Fx_family_fonts):
739 Don't assume fixnum fits in int.
740 Use SAFE_ALLOCA_LISP, not alloca.
741 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
742 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
743 (face_at_buffer_position, face_for_overlay_string)
744 (face_at_string_position):
745 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
746 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
747 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
748 (Fx_show_tip):
749 Check that fixnums are in proper range for system types.
750 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
751 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
752 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
753 (Fx_change_window_property): Don't assume fixnums fit in int.
754 * xfont.c (xfont_chars_supported):
755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
756 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
757 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
758 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
759 * xml.c (parse_region):
760 * xrdb.c (magic_file_p):
761 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
762 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
763 (x_get_local_selection, x_reply_selection_request)
764 (x_handle_selection_request, wait_for_property_change):
765 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
766 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
767 short is wide enough.
768 (x_send_client_event): Don't assume fixnum fits in int.
769 * xterm.c (x_x_to_emacs_modifiers):
770 Don't assume EMACS_INT overflows nicely into int.
771 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
772 may come from Lisp.
773 (handle_one_xevent): NATNUMP can eval its arg twice.
774 (x_connection_closed):
775 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
776 * xterm.h: Adjust decls to match defn changes elsewhere.
777 (struct scroll_bar): Use struct vectorlike_header
778 rather than rolling our own approximation.
779 (SCROLL_BAR_VEC_SIZE): Remove; not used.
780
f701dc2a
PE
7812011-09-30 Paul Eggert <eggert@cs.ucla.edu>
782
4222c55d
PE
783 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
784 This fixes a Y2038 bug on 64-bit hosts.
785 * buffer.c (reset_buffer):
786 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
787 (Fclear_buffer_auto_save_failure):
788 Use 0, not -1, to represent an unset failure time, since time_t
789 might not be signed.
790
f701dc2a
PE
791 Remove dependency on glibc malloc internals.
792 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
793 Move back here from lisp.h, but with their new implementations.
794 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
795 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
796 * charset.c (charset_table_init): New static var.
797 (syms_of_charset): Use it instead of xmalloc. This removes a
798 dependency on glibc malloc internals. See Eli Zaretskii's comment in
799 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
800 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
801 Move back to alloc.c.
802 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
803 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
804
9ceebf39
JD
8052011-09-30 Jan Djärv <jan.h.d@swipnet.se>
806
807 * nsterm.m (windowDidResize): Call x_set_window_size only when
808 ns_in_resize is true. Otherwise set pixelwidth/height and
809 call change_frame_size (Bug#9628).
810
cb993c58
PE
8112011-09-30 Paul Eggert <eggert@cs.ucla.edu>
812
3930c88b
PE
813 Port --enable-checking=all to Fedora 14 x86-64.
814 * charset.c (syms_of_charset): Also account for glibc malloc's
815 internal overhead when calculating the initial malloc maximum.
816
cb993c58
PE
817 Port --enable-checking=all to Fedora 14 x86.
818 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
819 Move to lisp.h.
820 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
821 (overrun_check_realloc, overrun_check_free):
822 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
823 That way, xmalloc returns a properly-aligned pointer even if
824 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
825 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
826 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
827 into account when calculating the initial malloc maximum.
828 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
829 Move here from alloc.c, so that charset.c can use it too.
830 Properly align; the old code wasn't right for common 32-bit hosts
831 when configured with --enable-checking=all.
832 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
833 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
834
31bed486
EZ
8352011-09-29 Eli Zaretskii <eliz@gnu.org>
836
04c70788 837 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
838 use EDOM.
839
fbcaa2f3
EZ
8402011-09-28 Eli Zaretskii <eliz@gnu.org>
841
842 * xdisp.c (compute_display_string_end): If there's no display
843 string at CHARPOS, return -1.
844
845 * bidi.c (bidi_fetch_char): When compute_display_string_end
846 returns a negative value, treat the character as a normal
847 character not covered by a display string. (Bug#9624)
848
a239d4e9
JB
8492011-09-28 Juanma Barranquero <lekktu@gmail.com>
850
851 * lread.c (Fread_from_string): Fix typo in docstring.
852
88652fd5
EZ
8532011-09-27 Eli Zaretskii <eliz@gnu.org>
854
855 * xdisp.c (handle_invisible_prop): If invisible text ends on a
856 newline, reseat the iterator instead of bidi-iterating there one
857 character at a time. (Bug#9610)
04c70788
EZ
858 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail out when
859 past TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 860
ed497dd4
AS
8612011-09-27 Andreas Schwab <schwab@linux-m68k.org>
862
863 * lread.c (readevalloop): Use correct code for NBSP.
864 (read1): Likewise. (Bug#9608)
865
b2bf61aa
MA
8662011-09-25 Michael Albinus <michael.albinus@gmx.de>
867
868 * dbusbind.c (Fdbus_register_signal): When service is not
869 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
870
32bbb17c
GM
8712011-09-25 Glenn Morris <rgm@gnu.org>
872
873 * buffer.c (truncate-lines): Doc fix.
874
94e0933e
CY
8752011-09-24 Chong Yidong <cyd@stupidchicken.com>
876
877 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
878 (Fset_window_next_buffers): Doc fix.
879
cddde921
GM
8802011-09-24 Glenn Morris <rgm@gnu.org>
881
882 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
883
1260aef1
PE
8842011-09-24 Paul Eggert <eggert@cs.ucla.edu>
885
25b4bfa0
PE
886 Fix minor problems found by static checking.
887 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
888 * indent.c (Fvertical_motion): Fix == vs = typo.
889
e3cbd34b
EZ
8902011-09-24 Eli Zaretskii <eliz@gnu.org>
891
6bf7006f
EZ
892 * dispnew.c (syms_of_display) <redisplay-dont-pause>: Default
893 value is now t. Doc fix.
894
e3cbd34b 895 * indent.c (Fvertical_motion): Compute and apply the overshoot
04c70788 896 logic also when moving up, not only when moving down. Fix the
e3cbd34b 897 confusing name and values of the it_overshoot_expected variable;
04c70788 898 logic changed accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
899
900 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
901 CHARPOS is covered by a display string which includes newlines.
902 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
903 is covered by a display string with embedded newlines.
904
a3de0cbd
MA
9052011-09-24 Michael Albinus <michael.albinus@gmx.de>
906
907 * dbusbind.c (Fdbus_register_signal): Add match rule to
908 Vdbus_registered_objects_table. (Bug#9581)
909 (Fdbus_register_method, Vdbus_registered_objects_table): Fix
910 docstring.
911
b260039d
JM
9122011-09-24 Jim Meyering <meyering@redhat.com>
913
04c70788 914 Do not ignore write error for any output size.
b260039d
JM
915 The previous change was incomplete.
916 While it makes emacs --batch detect the vast majority of stdout
917 write failures, errors were still ignored whenever the output size is
918 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
919 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
920 && echo FAIL: ignored write error
921 FAIL: ignored write error
922 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
923 && echo FAIL: ignored write error
924 FAIL: ignored write error
925 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
926
8eca8a7c
AS
9272011-09-23 Andreas Schwab <schwab@linux-m68k.org>
928
929 * emacs.c (Fkill_emacs): In noninteractive mode exit
930 non-successfully if a write error occurred on stdout. (Bug#9574)
931
3341db62
EZ
9322011-09-21 Eli Zaretskii <eliz@gnu.org>
933
934 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
935 the xassert test.
936
937 * dispextern.h (struct it): Update the comment documenting what
938 can it->OBJECT be.
939
8c203dbf
EZ
9402011-09-20 Eli Zaretskii <eliz@gnu.org>
941
942 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
943 a display string, extend search for cursor position to end of row.
944 (find_row_edges): If the row ends in a newline from a display
945 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
946 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
947 (Fcurrent_bidi_paragraph_direction): Fix search for previous
948 non-empty line. Fixes confusing cursor motion with arrow keys at
949 the beginning of a line that starts with whitespace.
8c203dbf 950
a4824228
LMI
9512011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
952
953 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
954 (bug#9493).
955
33ed493b
CY
9562011-09-18 Chong Yidong <cyd@stupidchicken.com>
957
958 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
959 boolean (Bug#9154).
960
56cd55c8
EZ
9612011-09-18 Eli Zaretskii <eliz@gnu.org>
962
963 * xdisp.c (display_line): Record maximum and minimum buffer
964 positions even if no glyphs were produced (e.g., by a zero-width
965 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
966 buffer positions that will be removed from the glyph row because
967 they don't fit.
c02dcedf
EZ
968 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
969 column is beyond frame width: don't subtract 1 "pixel" when
970 computing width of the stretch.
3e62b7e0
EZ
971 (reseat_at_next_visible_line_start): Undo the change made on
972 2011-09-17 that saved paragraph information and restored it after
973 the call to `reseat'. (Bug#9545)
56cd55c8 974
5ed99d36 9752011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
976
977 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
978 and turn window cursor on if cleared (Bug#9415).
979
5ed99d36 9802011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
981
982 * search.c (boyer_moore): Take unibyte characters from pattern
983 literally. (Bug#9458)
984
9bade7b2
EZ
9852011-09-18 Eli Zaretskii <eliz@gnu.org>
986
987 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
988
e5e9d610
PE
9892011-09-18 Paul Eggert <eggert@cs.ucla.edu>
990
87e4427a
PE
991 Fix minor problem found by static checking.
992 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
993 initialized, to pacify gcc -Wuninitialized.
994
e5e9d610
PE
995 * fileio.c: Report proper errno when syscall falls.
996 (Finsert_file_contents): Save and restore errno,
997 so that report_file_error outputs the correct diagnostic.
998 (Fwrite_region) [CLASH_DETECTION]: Likewise.
999
a1674f0b
EZ
10002011-09-18 Eli Zaretskii <eliz@gnu.org>
1001
1002 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
1003
fbfb6dd4
EZ
10042011-09-17 Eli Zaretskii <eliz@gnu.org>
1005
1006 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
1007 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
1008
bb187662
EZ
10092011-09-17 Eli Zaretskii <eliz@gnu.org>
1010
1137e8b8
EZ
1011 * xdisp.c (reseat_at_next_visible_line_start): Keep information
1012 about the current paragraph and restore it after the call to
1013 reseat.
1014
1015 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
1016 (bidi_find_paragraph_start): Search back for paragraph beginning
1017 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
1018 (bidi_move_to_visually_next): Only trigger paragraph-related
1019 computations when the last character is a newline or at EOB, not
1020 just any NEUTRAL_B. (Bug#9470)
1021
bb187662
EZ
1022 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
1023 truncated lines if point is covered by a display string. (Bug#9524)
1024
2e621251
PE
10252011-09-16 Paul Eggert <eggert@cs.ucla.edu>
1026
1027 * xselect.c: Relax test for outgoing X longs (Bug#9498).
1028 (cons_to_x_long): New function.
1029 (lisp_data_to_selection_data): Use it. Correct the test for
1030 short-versus-long data; it was negated. Break out of vector
1031 loop, for efficiency, when a long datum is discovered.
1032
91a15bc6
SM
10332011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
1034
1035 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
1036
b41c3a35
EZ
10372011-09-16 Eli Zaretskii <eliz@gnu.org>
1038
1039 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
1040 GCC PR/17406) by declaring this function with external scope.
1041
7812ba2d
PE
10422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
1043
1044 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
1045 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
1046
cf7edc2a
AS
10472011-09-15 Andreas Schwab <schwab@linux-m68k.org>
1048
1049 * editfns.c (Fformat): Correctly handle text properties on "%%".
1050
bd01620e
EZ
10512011-09-15 Eli Zaretskii <eliz@gnu.org>
1052
1053 * xterm.c (x_draw_composite_glyph_string_foreground):
1054 * w32term.c (x_draw_composite_glyph_string_foreground):
1055 * term.c (encode_terminal_code):
1056 * composite.c (composition_update_it, get_composition_id):
1057 * xdisp.c (get_next_display_element)
1058 (fill_composite_glyph_string): Add comments about special meaning
1059 of TAB characters in a composition.
1060
a02719a3
PE
10612011-09-15 Paul Eggert <eggert@cs.ucla.edu>
1062
1063 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
1064 This occurs when processing a multibyte format.
1065 Problem reported by Wolfgang Jenker.
a02719a3 1066
72589a3c
JB
10672011-09-15 Johan Bockgård <bojohan@gnu.org>
1068
1069 * xdisp.c (try_cursor_movement): Only check for exact match if
1070 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
1071
1c14176c
PE
10722011-09-14 Paul Eggert <eggert@cs.ucla.edu>
1073
1074 Remove unused external symbols.
1075 * dispextern.h (calc_pixel_width_or_height): Remove decl.
1076 * xdisp.c (calc_pixel_width_or_height): Now static.
1077 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
1078 * indent.c (check_display_width):
1079 * w32term.c: Fix comment to match code.
1080 * xterm.c, xterm.h (x_catching_errors): Remove.
1081
d2eea5b5
PE
10822011-09-14 Paul Eggert <eggert@cs.ucla.edu>
1083
1084 * xselect.c: Use signed conversions more consistently (Bug#9498).
1085 (selection_data_to_lisp_data): Assume incoming selection data are
1086 signed integers, not unsigned. This is to be consistent with
1087 outgoing selection data, which was modified to use signed integers
1088 in as part of the fix to Bug#9196 in response to Jan D.'s comment
1089 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
1090 expects long, not unsigned long.
1091
46888499
EZ
10922011-09-14 Eli Zaretskii <eliz@gnu.org>
1093
1094 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
1095 computation of loop end. Reported by Johan Bockgård
1096 <bojohan@gnu.org>.
1097
ef8ef9fb
CY
10982011-09-13 Chong Yidong <cyd@stupidchicken.com>
1099
1100 * frame.c (Fother_visible_frames_p): Function deleted.
1101
fa819fed
EZ
11022011-09-12 Eli Zaretskii <eliz@gnu.org>
1103
1104 * indent.c (compute_motion): Process display vector front to back
1105 rather than the other way around. (Bug#2496)
1106
2ba8e008
SM
11072011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
1108
1109 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
1110
20f53c69
CY
11112011-09-11 Chong Yidong <cyd@stupidchicken.com>
1112
1113 * minibuf.c (Fread_from_minibuffer): Doc fix.
1114
d562d7a4
EZ
11152011-09-11 Eli Zaretskii <eliz@gnu.org>
1116
1117 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
1118 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
1119
1c4d7f3d
LMI
11202011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
1121
1122 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
1123 value for non-existent files.
1124
b885bf36
EZ
11252011-09-11 Eli Zaretskii <eliz@gnu.org>
1126
1127 * fileio.c (Finsert_file_contents): If the file cannot be opened,
1128 set its "size" to -1. This will set the modtime_size field of
1129 the corresponding buffer to -1, which is what
1130 verify-visited-file-modtime expects for files that do not exist.
1131 (Bug#9139)
1132
6612f0bf
PE
11332011-09-11 Paul Eggert <eggert@cs.ucla.edu>
1134
1135 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
1136 here ...
1137 * lisp.h: ... from here. push_key_description is no longer
1138 defined in keyboard.c, so its declaration should not be in
1139 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
1140 logically belongs with push_key_description.
1141
dfb3f755
PE
11422011-09-10 Paul Eggert <eggert@cs.ucla.edu>
1143
1144 * buffer.h: Include <sys/types.h> instead of <time.h>.
1145 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
1146 Problem reported by Herbert J. Skuhra.
1147
3134906c
LMI
11482011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
1149
1150 * xml.c (parse_region): Make the parsing work for
1151 non-comment-starting XML files again (bug#9144).
1152
8d903f4e
AS
11532011-09-10 Andreas Schwab <schwab@linux-m68k.org>
1154
1155 * image.c (gif_load): Fix calculation of bottom and right corner.
1156 (Bug#9468)
1157
80ad64f4
EZ
11582011-09-10 Eli Zaretskii <eliz@gnu.org>
1159
1160 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
1161 redisplay in small windows.
1162
208a048d
EZ
11632011-09-09 Eli Zaretskii <eliz@gnu.org>
1164
1165 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
1166
9b1c252e
MR
11672011-09-08 Martin Rudalics <rudalics@gmx.at>
1168
1169 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
1170 Operate on live windows only.
1171
2949f33b
JB
11722011-09-08 Juanma Barranquero <lekktu@gmail.com>
1173
1174 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
1175
e08dcafd
EZ
11762011-09-07 Eli Zaretskii <eliz@gnu.org>
1177
1178 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
1179 only under bidi iteration.
1180
115b96bd
JD
11812011-09-07 Jan Djärv <jan.h.d@swipnet.se>
1182
1183 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
1184
c8199d0f
PE
11852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 isnan: Fix porting problem to Solaris 10 with bundled gcc.
1188 Without this fix, the command to link temacs failed due to an
1189 undefined symbol __builtin_isnan. This is because
1190 /usr/include/iso/math_c99.h #defines isnan(x) to
1191 __builtin_isnan(x), but the bundled gcc, which identifies itself
1192 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
1193 a __builtin_isnan.
1194 * floatfns.c (isnan): #undef, and then #define to a clone of
1195 what's in data.c.
1196 (Fisnan): Always define, since it's always available now.
1197 (syms_of_floatfns): Always define isnan at the Lisp level.
1198
e39b275c 11992011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
1200
1201 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
1202
b2db44d9 12032011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 1204
f4af5137 1205 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
1206 The previous code assumed that file offsets (off_t values) fit in
1207 EMACS_INT variables, which is not true on typical 32-bit hosts.
1208 The code messed up by falsely reporting buffer overflow in cases
1209 such as (insert-file-contents "big" nil 1 2) into an empty buffer
1210 when "big" contains more than 2**29 bytes, even though this
1211 inserts just one byte and does not overflow the buffer.
1212 (Finsert_file_contents): Store file offsets as off_t
1213 values, not as EMACS_INT values. Check for overflow when
1214 converting between EMACS_INT and off_t. When checking for
1215 buffer overflow or for overlap, take the offsets into account.
1216 Don't use EMACS_INT for small values where int suffices.
1217 When checking for overlap, fix a typo: ZV was used where
1218 ZV_BYTE was intended.
1219 (Fwrite_region): Don't assume off_t fits into 'long'.
1220 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
1221
ecfc0a49
MA
12222011-09-05 Michael Albinus <michael.albinus@gmx.de>
1223
1224 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
1225
6511acf2 12262011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 1227
0999621a 1228 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
1229
1230 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 1231 (esprintf, exprintf, evxprintf): New functions.
62f19c19
PE
1232 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
1233 (cmd_error): kbd macro iterations count is now EMACS_INT, not int.
1234 (modify_event_symbol): Do not assume that the length of
1235 name_alist_or_stem is safe to alloca and fits in int.
1236 (Fexecute_extended_command): Likewise for function name and binding.
1237 (Frecursion_depth): Wrap around reliably on integer overflow.
1238 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
1239 since some callers pass EMACS_INT values.
1240 (Fsingle_key_description): Don't crash if symbol name contains more
1241 than MAX_ALLOCA bytes.
1242 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
1243 (get_minibuffer): Arg is now EMACS_INT, not int.
1244 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 1245 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
1246 * window.h (command_loop_level, minibuf_level): Reflect API changes.
1247
2be7d702
PE
1248 * dbusbind.c (signature_cat): New function.
1249 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
1250 Do not overrun buffer; instead, report string overflow.
1251
9d1df220
PE
1252 * dispnew.c (add_window_display_history): Don't overrun buffer.
1253 Truncate instead; this is OK since it's just a log.
1254
33ef5c64
PE
1255 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
1256 even if the time zone offset is outlandishly large.
1257 Don't mishandle offset == INT_MIN.
1258
66c6fdd5
PE
1259 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
1260 when creating daemon; the previous buffer-overflow check was incorrect.
1261
d749b01b
PE
1262 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
1263 which has the guts of the old verror function.
1264
b5cd1905
PE
1265 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
1266 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
1267
6e1a67fb
PE
1268 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
1269 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 1270 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 1271 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
1272 length of string rather than counting it via multiple sprintfs;
1273 that's simpler and more reliable.
c21721cc
PE
1274 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
1275 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
1276 sprintf, in case result does not fit in int.
1277
c57b67fc
PE
1278 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
1279 (fontset_from_font): Print it.
1280
8a401434
PE
1281 * frame.c (tty_frame_count): Now printmax_t, not int.
1282 (make_terminal_frame, set_term_frame_name): Print it.
1283 (x_report_frame_params): In X, window IDs are unsigned long,
1284 not signed long, so print them as unsigned.
1285 (validate_x_resource_name): Check for implausibly long names,
1286 and don't assume name length fits in 'int'.
1287 (x_get_resource_string): Don't blindly alloca invocation name;
1288 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
1289 not fit in int.
1290
6e1a67fb
PE
1291 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
1292 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
1293 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
1294
0df02bf3
PE
1295 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
1296 Use esprintf, not sprintf, in case result does not fit in int.
1297
48e30793
PE
1298 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1299 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
1300 it as a large positive number.
1301 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
1302 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
1303
a66ff6d8
PE
1304 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
1305 in case result does not fit in int.
1306
aca216ff
PE
1307 * print.c (float_to_string): Detect width overflow more reliably.
1308 (print_object): Make sprintf buffer a bit bigger, to avoid potential
1309 buffer overrun. Don't assume list length fits in 'int'. Treat
1310 print length of 0 as 0, not as infinity; to be consistent with other
1311 uses of print length in this function. Don't overflow print length
1312 index. Don't assume hash table size fits in 'long', or that
1313 vectorlike size fits in 'unsigned long'.
1314
31c286f7
PE
1315 * process.c (make_process): Use printmax_t, not int, to format
1316 process-name gensyms.
1317
55e5faa1
PE
1318 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
1319
80f2e268
PE
1320 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
1321 to avoid potential buffer overrun.
1322
670741ab
PE
1323 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
1324 if X resource line is longer than 512 bytes.
1325
b7163a50
PE
1326 * xfns.c (x_window): Make sprintf buffer a bit bigger
1327 to avoid potential buffer overrun.
1328
ae58ff1f
PE
1329 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
1330
c43c8a6a
PE
1331 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
1332
3f8236f4
PE
13332011-09-04 Paul Eggert <eggert@cs.ucla.edu>
1334
53e9fe90 1335 Integer overflow fixes for scrolling, etc.
6511acf2
PE
1336 Without these, Emacs silently mishandles large integers sometimes.
1337 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
1338 it were "C-u 1 M-x recenter" on a typical 64-bit host.
1339
6511acf2
PE
1340 * xdisp.c (try_window_id): Check Emacs fixnum range before
1341 converting to 'int'.
806add1d 1342
6511acf2 1343 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
1344 Check that an Emacs fixnum is in range before assigning it to 'int'.
1345 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
1346 values converted from Emacs fixnums.
1347 (Frecenter): Don't wrap around a line count if it is out of 'int'
1348 range; instead, treat it as an extreme value.
1349 (Fset_window_configuration, compare_window_configurations):
1350 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
1351
6511acf2
PE
1352 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
1353 that can exceed INT_MAX. Check that EMACS_INT value is in range
1354 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
1355 (match_limit): Don't assume that a fixnum can fit in 'int'.
1356
6511acf2 1357 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
1358 exceed INT_MAX.
1359
6511acf2 1360 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
1361 (Fvertical_motion): Don't wrap around LINES values that don't fit
1362 in 'int'. Instead, treat them as extreme values. This is good
1363 enough for windows, which can't have more than INT_MAX lines anyway.
1364
fcb901a7
LMI
13652011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
1366
0f2f6b6d
LMI
1367 * Require libxml/parser.h to avoid compilation warning.
1368
fcb901a7
LMI
1369 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
1370
1371 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
1372 since this reportedly can destroy thread storage.
1373
6e20a0d4
CY
13742011-08-30 Chong Yidong <cyd@stupidchicken.com>
1375
1376 * syntax.c (find_defun_start): Update all cache variables if
1377 exiting early (Bug#9401).
1378
148ae00e
EZ
13792011-08-30 Eli Zaretskii <eliz@gnu.org>
1380
f6cfbd8f
EZ
1381 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
1382
148ae00e
EZ
1383 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
1384 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
1385 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
1386
1387 * term.c (tty_append_glyph): New function.
1388 (produce_stretch_glyph): Static function and its prototype deleted.
1389
1390 * dispextern.h (produce_stretch_glyph, tty_append_glyph): Add
1391 prototypes.
1392
c4a07a4c
PE
13932011-08-29 Paul Eggert <eggert@cs.ucla.edu>
1394
1395 * image.c (parse_image_spec): Check for nonnegative, not for positive,
1396 when checking :margin (Bug#9390).
1397 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
1398 Renamed from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
1399 so that the name doesn't mislead. All uses changed.
1400
6bc8cd65
JB
14012011-08-28 Johan Bockgård <bojohan@gnu.org>
1402
1403 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
1404 set_tty_hooks.
1405
dca4927e
EZ
14062011-08-27 Eli Zaretskii <eliz@gnu.org>
1407
1408 * xdisp.c (move_it_to): Don't bail out early when reaching
1409 position beyond to_charpos, if we are scanning backwards.
1410 (move_it_vertically_backward): When DY == 0, make sure we get to
1411 the first character in the line after the newline.
1412
f2cad773
PE
14132011-08-27 Paul Eggert <eggert@cs.ucla.edu>
1414
1415 * ccl.c: Improve and simplify overflow checking (Bug#9196).
1416 (ccl_driver): Do not generate an out-of-range pointer.
1417 (Fccl_execute_on_string): Remove unnecessary check for
1418 integer overflow, noted by Stefan Monnier in
1419 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
1420 Remove a FIXME that didn't need fixing.
1421 Simplify the newly-introduced buffer reallocation code.
1422
0cae2cdb
JB
14232011-08-27 Juanma Barranquero <lekktu@gmail.com>
1424
1425 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
1426
5fc295a4 14272011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 1428
70c60eb2 1429 Integer and memory overflow issues (Bug#9196).
726e0ab1 1430
d31850da
PE
1431 * doc.c (get_doc_string): Rework so that
1432 get_doc_string_buffer_size is the actual buffer size, rather than
1433 being 1 less than the actual buffer size; this makes xpalloc more
1434 convenient.
1435
a69fbedb
PE
1436 * image.c (x_allocate_bitmap_record, cache_image):
1437 * xselect.c (Fx_register_dnd_atom):
1438 Simplify previous changes by using xpalloc.
1439
fe5c5d37
PE
1440 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
1441 since either will do and ptrdiff_t is convenient with xpalloc.
1442
0065d054
PE
1443 * charset.c (charset_table_size)
1444 (struct charset_sort_data.priority): Now ptrdiff_t.
1445 (charset_compare): Don't overflow if priorities differ greatly.
1446 (Fsort_charsets): Don't assume list length fits in int.
1447 Check for size-calculation overflow when allocating sort data.
1448 (syms_of_charset): Allocate an initial charset table that is
1449 just under 64 KiB, to avoid problems with glibc malloc and mmap.
1450
1451 * cmds.c (internal_self_insert): Check for size-calculation overflow.
1452
1453 * composite.h (struct composition.glyph_len): Now int, not unsigned.
1454 The actual value is always <= INT_MAX, and leaving it unsigned made
1455 overflow checking harder.
1456
1457 * dispextern.h (struct glyph_matrix.rows_allocated)
1458 (struct face_cache.size): Now ptrdiff_t, for convenience in use
1459 with xpalloc. The values are still always <= INT_MAX.
1460
1461 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
1462
1463 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
1464 (SAFE_NALLOCA): New macro.
1465
1466 * region-cache.c (struct boundary.pos, find_cache_boundary)
1467 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
1468 (set_cache_region, invalidate_region_cache)
1469 (revalidate_region_cache, know_region_cache, region_cache_forward)
1470 (region_cache_backward, pp_cache):
1471 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
1472 so that ptrdiff_t * can be passed to xpalloc.
1473 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
1474 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
1475 (pp_cache): Don't assume cache_len fits in int.
1476 * region-cache.h: Adjust extern decls to match.
1477
1478 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
1479 EMACS_INT, since either will do, for xpalloc.
1480
1481 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
1482 (xnmalloc, xnrealloc, xpalloc): New functions.
1483
726e0ab1
PE
1484 * bidi.c (bidi_shelve_header_size): New constant.
1485 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
1486 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
1487
51f30bc5 1488 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
1489 * buffer.c (overlays_at, overlays_in, record_overlay_string)
1490 (overlay_strings):
1491 Don't update size of array until after memory allocation succeeds,
1492 because xmalloc/xrealloc may not return.
0065d054
PE
1493 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
1494 now that we have proper integer overflow checking.
1495 (record_overlay_string, overlay_strings): Catch overflows when
1496 calculating size of overlay_str_buf.
726e0ab1 1497
0065d054
PE
1498 * callproc.c (Fcall_process): Check for size overflow when
1499 calculating size of args2.
1500 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
1501 Normally we prefer signed values, but sticking with ptrdiff_t would
1502 require adding more-complicated checks.
726e0ab1
PE
1503
1504 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
1505 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
1506 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 1507 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
1508
1509 * character.c (Fstring): Check for size-calculation overflow.
1510
1511 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
1512 unnecessary integer overflow. Check for size overflow.
1513 (encode_coding_object): Don't update size until xmalloc succeeds.
1514
1515 * composite.c (get_composition_id): Check for overflow in glyph
1516 length calculations.
1517
1518 Integer and memory overflow fixes for display code.
1519 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
1520 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
1521 (scrolling_window): Check for overflow in size calculations.
1522 (line_draw_cost, realloc_glyph_pool, add_row_entry):
1523 Don't assume glyph table len fits in int.
1524 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
1525 (row_table_size): Now ptrdiff_t, not int.
1526 (scrolling_window): Avoid overflow in size calculations.
1527 Don't update size until allocation succeeds.
1528 * fns.c (concat): Check for overflow in size calculations.
1529 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
1530 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1531 (NEXT_ALMOST_PRIME_LIMIT): New constant.
1532
1533 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
1534 (get_doc_string): Check for size calculation overflow.
1535 Don't update size until allocation succeeds.
1536 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
1537 EMACS_INT, where ptrdiff_t will do.
1538 (Fsubstitute_command_keys): Check for string overflow.
1539
1540 * editfns.c (set_time_zone_rule): Don't assume environment length
1541 fits in int.
1542 (message_length): Now ptrdiff_t, not int.
1543 (Fmessage_box): Don't update size until allocation succeeds.
1544 Don't assume message length fits in int.
1545 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
1546
0065d054
PE
1547 * emacs.c (main): Do not reallocate argv, since there is a null at
1548 the end that can be overwritten, and this way there's no need to
1549 worry about size-calculation overflow.
1550 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
1551
1552 * eval.c (init_eval_once, grow_specpdl): Don't update size until
1553 alloc succeeds.
1554 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
1555
1556 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
1557 (x_set_scroll_bar_width, x_figure_window_size):
1558 Check for integer overflow.
1559 (x_set_alpha): Do not assume XINT fits in int.
1560
1561 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
1562 This is for the members text_lines, text_cols, total_lines, total_cols,
1563 where the system imposes an 'int' limit.
1564
1565 * fringe.c (Fdefine_fringe_bitmap):
1566 Don't update size until alloc works.
1567
1568 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
1569 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
1570
1571 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
1572 Check for size-calculation overflow.
1573 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
1574 do, as we prefer signed integers.
1575 (id_to_widget.max_size, id_to_widget.used)
1576 (xg_store_widget_in_map, xg_remove_widget_from_map)
1577 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
1578 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
1579 Use and return ptrdiff_t, not int.
1580 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
1581 * gtkutil.h: Change prototypes to match the above.
1582
1583 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
1584 are duplicate now that they've been promoted to lisp.h.
1585 (x_allocate_bitmap_record, x_alloc_image_color)
1586 (make_image_cache, cache_image, xpm_load):
1587 Don't update size until alloc is done.
1588 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
1589 (x_detect_edges):
3256efce 1590 Check for size calculation overflow.
726e0ab1
PE
1591 (ct_colors_allocated_max): New constant.
1592 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
1593 overflow.
3256efce 1594
726e0ab1
PE
1595 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
1596 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
1597 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
1598 Use ptrdiff_t, not int, to count maps.
1599 (read_char_minibuf_menu_prompt): Check for overflow in size
1600 calculations. Don't update size until allocation succeeds. Redo
1601 calculations to avoid overflow.
1602 * keyboard.h: Change prototypes to match the above.
1603
1604 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
1605 to count maps.
1606 (current_minor_maps): Check for size calculation overflow.
1607 * keymap.h: Change prototypes to match the above.
1608
1609 * lread.c (read1, init_obarray): Don't update size until alloc done.
1610
1611 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
1612 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
1613
726e0ab1
PE
1614 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
1615 Now ptrdiff_t, not int.
1616 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
1617 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
1618
1619 * process.c (Fnetwork_interface_list): Check for overflow
1620 in size calculation.
1621
1622 * region-cache.c (move_cache_gap): Check for size calculation overflow.
1623
1624 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
1625 overflow. Don't bother calling xmalloc when xrealloc will do.
1626
1627 * search.c (Freplace_match): Check for size calculation overflow.
1628 (Fset_match_data): Don't assume list lengths fit in 'int'.
1629
1630 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
1631 for command line length. Do not attempt to address one before the
1632 beginning of an array, as that's not portable.
1633
1634 * term.c (max_frame_lines): Remove; unused.
1635 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
1636 not int.
1637 (encode_terminal_code, calculate_costs): Check for size
1638 calculation overflow.
1639 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
1640 table lengths and related sizes. Don't update size until alloc
1641 done. Redo calculations to avoid overflow.
1642 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
1643
1644 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
1645 subtracting pointers.
1646 (gobble_line): Check for overflow more carefully. Don't update size
1647 until alloc done.
1648
1649 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
1650 Don't update size until alloc done.
1651 Redo size calculations to avoid overflow.
1652 Check for size calculation overflow.
0065d054 1653 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
1654
1655 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
1656 Use ptrdiff_t, not int, for sizes.
1657 (store_mode_line_noprop_char): Don't update size until alloc done.
1658
0065d054
PE
1659 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
1660 Use ptrdiff_t, not int, for sizes.
1661 (Finternal_make_lisp_face, cache_face):
1662 Check for size calculation overflow.
1663 (cache_face): Treat size calculation overflows as if they were
1664 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
1665
1666 * xfns.c (x_encode_text, x_set_name_internal)
1667 (Fx_change_window_property): Use ptrdiff_t, not int, to count
1668 sizes, since they can exceed INT_MAX in size. Check for size
1669 calculation overflow.
1670
0065d054
PE
1671 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
1672 (xg_select): Check for size calculation overflow.
726e0ab1
PE
1673 Don't update size until alloc done.
1674
0065d054 1675 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 1676 as sprintf is limited to int lengths.
1d526e2f 1677
252c5ee1
PE
1678 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
1679 (X_LONG_MIN): New macros.
864d7ce7
PE
1680 Use them to make the following changes clearer.
1681 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
1682 This change doesn't affect the value now, but it may help remind
1683 future maintainers not to raise the value too much later.
1684 (SELECTION_QUANTUM): Remove, replacing with ...
1685 (selection_quantum): ... new function, which avoids overflow.
1686 All uses changed.
1687 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
1688 assumption that selection length fits in 'int'.
1689 (x_reply_selection_request, x_handle_selection_request)
1690 (x_get_window_property, receive_incremental_selection)
1691 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
1692 (lisp_data_to_selection_data, clean_local_selection_data):
1693 Use ptrdiff_t, not int, to record length of selection.
1694 (x_reply_selection_request, x_get_window_property)
1695 (receive_incremental_selection, x_property_data_to_lisp):
1696 Redo calculations to avoid overflow.
1697 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 1698 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
1699 something.
1700 (x_get_window_property, receive_incremental_selection)
1701 (lisp_data_to_selection_data, x_property_data_to_lisp):
1702 Check for size-calculation overflow.
1703 (x_get_window_property, receive_incremental_selection)
1704 (lisp_data_to_selection_data, Fx_register_dnd_atom):
1705 Don't store size until memory allocation succeeds.
1706 (x_get_window_property): Plug memory leak on memory exhaustion.
1707 Don't double-block input; malloc is safe here. Don't assume 2**34
1708 - 4 fits in unsigned long. Add an xassert to check
1709 XGetWindowProperty overflow. Be more careful about overflow
1710 calculations, and distinguish size from memory overflow better.
1711 (receive_incremental_selection): When tracing, don't assume
1712 unsigned int is less than INT_MAX.
1713 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
1714 harmful) conversions of unsigned short to int.
1715 (lisp_data_to_selection_data): Don't assume that integers
1716 in the range -65535 through -1 fit in an X unsigned short.
1717 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
1718 result parameters unless successful. Rely on cons_to_unsigned
1719 to report problems with elements; the old code wasn't right anyway.
1720 (x_check_property_data): Check for int overflow; we cannot use
1721 a wider type due to X limits.
1722 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
1723
726e0ab1 1724 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 1725
0065d054
PE
1726 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
1727 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
1728 (x_color_cells): Don't store size until memory allocation succeeds.
1729 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 1730 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
1731 (x_term_init): Don't assume length fits in int (sprintf is limited
1732 to int size).
bc18e09d 1733
ebfa62c0
PE
1734 Use ptrdiff_t for composition IDs.
1735 * character.c (lisp_string_width):
1736 * composite.c (composition_table_size, n_compositions)
1737 (get_composition_id, composition_gstring_from_id):
1738 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
1739 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
1740 * window.c (Frecenter):
1741 Use ptrdiff_t, not int, for composition IDs.
1742 * composite.c (get_composition_id): Check for integer overflow.
1743 * composite.h: Adjust prototypes to match the above changes.
1744
d3411f89
PE
1745 Use ptrdiff_t for hash table indexes.
1746 * category.c (hash_get_category_set):
1747 * ccl.c (ccl_driver):
1748 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
1749 * coding.c (coding_system_charset_list, detect_coding_system):
1750 * coding.h (struct coding_system.id):
1751 * composite.c (get_composition_id, gstring_lookup_cache):
1752 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
1753 * image.c (xpm_get_color_table_h):
1754 * lisp.h (hash_lookup, hash_put):
1755 * minibuf.c (Ftest_completion):
1756 Use ptrdiff_t for hash table indexes, not int (which is too
1757 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
1758 32-bit --with-wide-int hosts).
1759
e097a6fa
PE
1760 * charset.c (Fdefine_charset_internal): Check for integer overflow.
1761 Add a FIXME comment about memory leaks.
1762 (syms_of_charset): Don't assume xmalloc returns.
1763
5637687f
PE
1764 Don't assume that stated character widths fit in int.
1765 * character.c (Fchar_width, c_string_width, lisp_string_width):
1766 * character.h (CHAR_WIDTH):
1767 * indent.c (MULTIBYTE_BYTES_WIDTH):
1768 Use sanitize_char_width to avoid undefined and/or bad behavior
1769 with outlandish widths.
1770 * character.h (sanitize_tab_width): Renamed from sanitize_width,
1771 now that we have two such functions. All uses changed.
1772 (sanitize_char_width): New inline function.
1773
a2271ba2
PE
1774 Don't assume that tab-width fits in int.
1775 * character.h (sanitize_width): New inline function.
1776 (SANE_TAB_WIDTH): New macro.
1777 (ASCII_CHAR_WIDTH): Use it.
1778 * indent.c (sane_tab_width): Remove. All uses replaced by
1779 SANE_TAB_WIDTH (current_buffer).
1780 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
1781
18c52557
PE
1782 * fileio.c: Integer overflow issues with file modes.
1783 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
1784
caeeedc1
PE
1785 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
1786 Remove unreachable code.
1787 (read_hex, load_charset_map_from_file): Check for integer overflow.
1788
50849c52
PE
1789 * xterm.c: don't go over XClientMessageEvent limit
1790 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
1791 (x_send_scroll_bar_event): Likewise. Check that the size does not
1792 exceed limits imposed by XClientMessageEvent, as well as the usual
1793 ptrdiff_t and size_t limits.
1794
b13995db
PE
1795 * keyboard.c: Overflow, signedness and related fixes.
1796 (make_lispy_movement): Use same integer type in forward decl
1797 that is used in the definition.
1798 (read_key_sequence, keyremap_step):
1799 Change bufsize argument back to int, undoing my 2011-03-30 change.
1800 We prefer signed types, and int is wide enough here.
1801 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
1802 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
1803 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
1804 length, not size_t. Use ptrdiff_t for index, not int.
1805 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
1806 possibility of integer overflow.
1807
13464394
PE
1808 Overflow, signedness and related fixes for images.
1809
1810 * dispextern.h (struct it.stack[0].u.image.image_id)
1811 (struct_it.image_id, struct image.id, struct image_cache.size)
1812 (struct image_cache.used, struct image_cache.ref_count):
1813 * gtkutil.c (update_frame_tool_bar):
1814 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
1815 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
1816 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
1817 * nsmenu.m (update_frame_tool_bar):
1818 * xdisp.c (calc_pixel_width_or_height):
1819 * xfns.c (image_cache_refcount):
1820 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
1821 on typical 64-bit hosts.
1822
1823 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
1824 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
1825 Omit unnecessary casts to int.
1826 (parse_image_spec): Check that integers fall into 'int' range
1827 when the callers expect that.
1828 (image_ascent): Redo ascent calculation to avoid int overflow.
1829 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
1830 (lookup_image): Remove unnecessary tests.
1831 (xbm_image_p): Locals are now of int, not EMACS_INT,
1832 since parse_image_check makes sure they fit into int.
1833 (png_load, gif_load, svg_load_image):
1834 Prefer int to unsigned where either will do.
1835 (tiff_handler): New function, combining the cores of the
1836 old tiff_error_handler and tiff_warning_handler. This
1837 function is rewritten to use vsnprintf and thereby avoid
1838 stack buffer overflows. It uses only the features of vsnprintf
1839 that are common to both POSIX and native Microsoft.
1840 (tiff_error_handler, tiff_warning_handler): Use it.
1841 (tiff_load, gif_load, imagemagick_load_image):
1842 Don't assume :index value fits in 'int'.
1843 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
1844 (imagemagick_load_image): Check that crop parameters fit into
1845 the integer types that MagickCropImage accepts. Don't assume
1846 Vimagemagick_render_type has a nonnegative value. Don't assume
1847 size_t fits in 'long'.
1848 (gs_load): Use printmax_t to print the widest integers possible.
1849 Check for integer overflow when computing image height and width.
1850
c11821d4
EZ
18512011-08-26 Eli Zaretskii <eliz@gnu.org>
1852
1853 * xdisp.c (redisplay_window): Don't force window start if point
1854 will be invisible in the resulting window. (Bug#9324)
1855
0c95fcf7
EZ
18562011-08-25 Eli Zaretskii <eliz@gnu.org>
1857
1858 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
1859 the display spec is of the form `(space ...)'.
1860 (handle_display_spec): Return the value returned by
1861 handle_single_display_spec, not just 1 or zero.
1862 (handle_single_display_spec): If the display spec is of the form
1863 `(space ...)', and specifies display in the text area, return 2
1864 rather than 1.
fee65a97 1865 (try_cursor_movement): Check for the need to scroll more
e25be792
EZ
1866 accurately, and prefer exact match for point under bidi. Don't
1867 advance `row' beyond the last row of the window.
0c95fcf7
EZ
1868
1869 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
1870 into disp_prop; all users changed.
1871
1872 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
1873 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
1874 for the text covered by the display property.
1875
e4ed06f1
CY
18762011-08-25 Chong Yidong <cyd@stupidchicken.com>
1877
1878 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
1879 Change return value to nil.
1880 (Frecord_buffer): Delete unused function.
1881
f67cdd7f
EZ
18822011-08-24 Eli Zaretskii <eliz@gnu.org>
1883
5980d4c6
EZ
1884 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
1885 buffers, return left-to-right.
8610fe8b
EZ
1886 (set_cursor_from_row): Consider candidate row a win if its glyph
1887 represents a newline and point is on that newline. Fixes cursor
1888 positioning on the newline at EOL of R2L text within L2R
1889 paragraph, and vice versa.
1890 (try_cursor_movement): Check continued rows, in addition to
1891 continuation rows. Fixes unwarranted scroll when point enters a
1892 continued line of R2L text within an L2R paragraph, or vice versa.
1893 (cursor_row_p): Consider the case of point being equal to
1894 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
1895 from the end of a short line to the beginning of a continued line
1896 of R2L text within L2R paragraph.
1897 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
1898 composed characters.
5980d4c6 1899
f67cdd7f
EZ
1900 * bidi.c (bidi_check_type): Use xassert.
1901 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
1902 members.
1903
bca633fb
EZ
19042011-08-23 Eli Zaretskii <eliz@gnu.org>
1905
1906 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
1907 a character.
1908
4a5885a7
CY
19092011-08-23 Chong Yidong <cyd@stupidchicken.com>
1910
1911 * nsfont.m (ns_otf_to_script): Fix typo.
1912
0902a04e
KH
19132011-08-22 Kenichi Handa <handa@m17n.org>
1914
1915 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
1916 extra slot even if the purpose is char-code-property-table.
1917
1a2e6670
EZ
19182011-08-23 Eli Zaretskii <eliz@gnu.org>
1919
8ddde651
EZ
1920 * xdisp.c (redisplay_window): When computing centering_position,
1921 account for the height of the header line. (Bug#8874)
1922
425cc014
EZ
1923 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
1924 instead of CHAR_TO_BYTE. Fixes a crash when a completion
1925 candidate is selected by the mouse, and that candidate has a
1926 composed character under the mouse.
1927
1a2e6670
EZ
1928 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
1929 coordinates reported by pos-visible-in-window-p for a composed
1930 character in column zero.
1931
8b76d6f8
SM
19322011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
1933
1934 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
1935
dac347dd
EZ
19362011-08-22 Eli Zaretskii <eliz@gnu.org>
1937
1938 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
1939 consider it a hit if to_charpos is anywhere in the range of the
1940 composed buffer positions.
1941
e013fb34
CY
19422011-08-22 Chong Yidong <cyd@stupidchicken.com>
1943
1944 * image.c (gif_load): Don't assume that each subimage has the same
1945 dimensions as the base image. Handle disposal method that is
1946 "undefined" by the gif spec (Bug#9335).
1947
bd1ba3e8
CY
19482011-08-20 Chong Yidong <cyd@stupidchicken.com>
1949
1950 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 1951 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 1952
54a1215b
EZ
19532011-08-19 Eli Zaretskii <eliz@gnu.org>
1954
823564e5
EZ
1955 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
1956 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
1957 from an Org mode buffer to a Speedbar frame.
1958
54a1215b
EZ
1959 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
1960 a composition, take its buffer position from IT->cmp_it.charpos.
1961 Fixes cursor positioning at the beginning of a line that begins
1962 with a composed character.
1963
9778ebcc
EZ
19642011-08-18 Eli Zaretskii <eliz@gnu.org>
1965
0be6ee06
EZ
1966 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
1967 character bidirectional type, use STRONG_L instead. Fixes crashes
1968 in a buffer produced by `describe-categories'.
1969
9778ebcc
EZ
1970 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
1971 members before the level stack, so they would be saved and
1972 restored when copying iterator state. Fixes incorrect reordering
1973 around TABs covered by display properties.
1974
156bffbe
AS
19752011-08-18 Andreas Schwab <schwab@linux-m68k.org>
1976
1977 * process.c (Fnetwork_interface_list): Correctly determine buffer
1978 size.
1979
72ad093b
CY
19802011-08-17 Chong Yidong <cyd@stupidchicken.com>
1981
1982 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
1983 (internal_condition_case_2, internal_condition_case_n):
1984 Remove unnecessary aborts (Bug#9081).
72ad093b 1985
35774242
EZ
19862011-08-17 Eli Zaretskii <eliz@gnu.org>
1987
1988 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
1989 has no `load' handler, try opening the file locally. (Bug#9311)
1990
db76dd85
KB
19912011-08-16 Ken Brown <kbrown@cornell.edu>
1992
1993 * gmalloc.c: Expand comment.
1994
b215eee5
EZ
19952011-08-16 Eli Zaretskii <eliz@gnu.org>
1996
1997 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
1998 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
1999
a4579d33
KB
20002011-08-16 Ken Brown <kbrown@cornell.edu>
2001
2002 Fix memory allocation problems in Cygwin build (Bug#9273).
2003
2004 * unexcw.c ( __malloc_initialized): Declare external variable.
2005 (fixup_executable): Force the dumped emacs to reinitialize malloc.
2006
8b76d6f8
SM
2007 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
2008 New variables.
a4579d33
KB
2009 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
2010 dumped emacs.
2011 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
2012 in the static heap.
2013 [CYGWIN] (special_realloc): New function.
2014 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
2015 requests to realloc storage in the static heap.
2016
3ebec551
PE
20172011-08-15 Paul Eggert <eggert@cs.ucla.edu>
2018
2019 * bidi.c (bidi_initialize): Remove unused local.
2020
9fd8be00
EZ
20212011-08-15 Eli Zaretskii <eliz@gnu.org>
2022
474a8465
EZ
2023 * biditype.h: File removed.
2024
2025 * bidimirror.h: File removed.
2026
2027 * deps.mk (bidi.o): Remove biditype.h and
2028 bidimirror.h.
2029
2030 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
2031 bidimirror.h.
2032
2033 * dispextern.h: Fix a typo in the comment to bidi_type_t.
2034
2035 * chartab.c: Improve commentary for the uniprop_table API.
2036
32413314
EZ
2037 * bidi.c (bidi_paragraph_init): Support zero value of
2038 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
2039 (bidi_initialize): Use uniprop_table instead of including
2040 biditype.h and bidimirror.h.
32413314 2041
9fd8be00
EZ
2042 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
2043 coordinates of the iterator when restoring from ppos_it.
2044 (Bug#9296)
2045
5cf2b69b
KH
20462011-08-14 Kenichi Handa <handa@m17n.org>
2047
2048 * process.c (create_process): Call setup_process_coding_systems
72ad093b 2049 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 2050
daf17d00
EZ
20512011-08-14 Eli Zaretskii <eliz@gnu.org>
2052
2053 * xdisp.c (move_it_in_display_line_to): Don't invoke
2054 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
2055 ppos_it. Fixes vertical cursor motion when line beginning is
2056 covered by an image. (Bug#9296)
2057
08e3161a
JD
20582011-08-14 Jan Djärv <jan.h.d@swipnet.se>
2059
2060 * nsterm.h (ns_run_ascript): Declare.
2061 (NSAPP_DATA2_RUNASSCRIPT): Define.
2062
2063 * nsfns.m (as_script, as_result, as_status): New static variables.
2064 (ns_run_ascript): New function.
5e617bc2 2065 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
2066 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
2067 the event loop. Get status from as_status (Bug#7276).
2068
2069 * nsterm.m (sendEvent): If event is NSApplicationDefined and
2070 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
2071 the event loop (Bug#7276).
2072
a3720aa2
AS
20732011-08-14 Andreas Schwab <schwab@linux-m68k.org>
2074
2075 * gnutls.c (QCgnutls_bootprop_priority)
2076 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
2077 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
2078 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
2079 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
2080 (QCgnutls_bootprop_verify_hostname_error)
2081 (QCgnutls_bootprop_callbacks_verify): Rename from
2082 Qgnutls_bootprop_..., all uses changed.
2083
2084 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
2085 uses changed.
2086
0a0d27fb
PE
20872011-08-14 Paul Eggert <eggert@cs.ucla.edu>
2088
19d5c50c
PE
2089 * xfaces.c (Qframe_set_background_mode): Now static.
2090 * dispextern.h (Qframe_set_background_mode): Remove decl.
2091
0a0d27fb
PE
2092 * process.c (Fnetwork_interface_info): Declare local only if needed.
2093
377538cb
JD
20942011-08-13 Jan Djärv <jan.h.d@swipnet.se>
2095
2096 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
2097 (Fnetwork_interface_list): Allocate in increments of bytes instead
2098 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
2099 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
2100 sockaddr.
2101 (struct ifflag_def): notrailers is smart on OSX.
2102 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
2103 Get hardware address with getifaddrs if available.
2104
08fff70c
EZ
21052011-08-12 Eli Zaretskii <eliz@gnu.org>
2106
2107 * xdisp.c (iterate_out_of_display_property): xassert that
2108 IT->position is set to within IT->object's boundaries. Break from
2109 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
2110 when IT->position is set up wrongly due to some bug.
2111 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
2112 (push_display_prop): Allow GET_FROM_STRING as IT->method on
2113 entry. Force push_it to save on the stack the current
2114 buffer/string position, to be restored by pop_it. Fix flags in
2115 the iterator structure wrt the object coming from a display
2116 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
2117 properties. (Bug#9284)
2118
7be1c708 21192011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 2120
7be1c708
CY
2121 * fontset.c (fontset_get_font_group): Add proper type checks.
2122 (Bug#9172)
aac0c6e3 2123
7be1c708 21242011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 2125
7be1c708
CY
2126 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
2127 and LC_VERSION_MIN_MACOSX.
2128 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
2129 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 2130
97bb72a6
EZ
21312011-08-08 Eli Zaretskii <eliz@gnu.org>
2132
2133 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
2134 no-display-properties-and-no-overlays under bidi display.
2135 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 2136 properties and overlays.
97bb72a6 2137
d5617611
CY
21382011-08-08 Chong Yidong <cyd@stupidchicken.com>
2139
37e11a63
CY
2140 * editfns.c (Fset_time_zone_rule): Document relationship with the
2141 setenv function.
2142
d5617611
CY
2143 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
2144 the font entity extracted from the cache (Bug#8109).
2145
58872834
CY
21462011-08-07 Chong Yidong <cyd@stupidchicken.com>
2147
2148 * composite.c (autocmp_chars): Don't reset point. That is done by
2149 restore_point_unwind (Bug#5984).
2150
75bfc667
JL
21512011-08-07 Juri Linkov <juri@jurta.org>
2152
2153 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
2154 to show the arg `TIME' instead of `TIMEVAL'.
2155
d1410150
EZ
21562011-08-06 Eli Zaretskii <eliz@gnu.org>
2157
2158 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
2159 display property strides EOL and includes a newline, as in
2160 longlines-mode. (Bug#9254)
75b771e4
EZ
2161 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
2162 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
2163
2164 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
2165 is non-zero, even if the data buffer is NULL. Fixes a crash in
2166 vertical-motion with longlines-mode. (Bug#9254)
2167
35928349
EZ
21682011-08-05 Eli Zaretskii <eliz@gnu.org>
2169
ec7cc85b
EZ
2170 * bidi.c <bidi_cache_total_alloc>: Now static.
2171 (bidi_initialize): Initialize bidi_cache_total_alloc.
2172
8b76d6f8 2173 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
2174 cache. (Bug#9221)
2175
2176 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
2177 amount allocated this far in `bidi_cache_total_alloc'.
2178 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
2179 non-zero, only free the data buffer without restoring the cache
2180 contents. All callers changed.
2181
2182 * dispextern.h (bidi_unshelve_cache): Update prototype.
2183
2184 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
2185 (move_it_in_display_line, move_it_to)
2186 (move_it_vertically_backward, move_it_by_lines): Replace the call
2187 to xfree to an equivalent call to bidi_unshelve_cache.
2188 (move_it_in_display_line_to): Fix logic of returning
412b6358 2189 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 2190
e2e2423b
EZ
21912011-08-05 Eli Zaretskii <eliz@gnu.org>
2192
2193 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
2194 came from a string character with a `cursor' property. (Bug#9229)
2195
ae9e757a
JD
21962011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2197
2198 * Makefile.in (LIB_PTHREAD): New variable.
2199 (LIBES): Add LIB_PTHREAD (Bug#9216).
2200
2201 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
2202 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
2203
213bd7f2
AS
22042011-08-04 Andreas Schwab <schwab@linux-m68k.org>
2205
2206 * regex.c (re_iswctype): Remove some redundant boolean
2207 conversions.
2208
99aaf75f
JD
22092011-08-04 Jan Djärv <jan.h.d@swipnet.se>
2210
2211 * xterm.c (x_find_topmost_parent): New function.
2212 (x_set_frame_alpha): Find topmost parent window with
2213 x_find_topmost_parent and set the property there also (bug#9181).
2214 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
2215
c74e9d86
PE
22162011-08-04 Paul Eggert <eggert@cs.ucla.edu>
2217
2218 * callproc.c (Fcall_process): Avoid vfork clobbering
2219 the local vars buffer, coding_systems, current_dir.
2220
640c8776
SM
22212011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
2222
2223 * keymap.c (Fmake_composed_keymap): Move to subr.el.
2224
f26d0e4c
PE
22252011-08-03 Paul Eggert <eggert@cs.ucla.edu>
2226
8a10d76c
PE
2227 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
2228 so that it is not optimized away.
2229
f26d0e4c
PE
2230 * xdisp.c (compute_display_string_pos): Remove unused local.
2231
55439c61
EZ
22322011-08-02 Eli Zaretskii <eliz@gnu.org>
2233
2234 Fix slow cursor motion and scrolling in large buffers with
2235 selective display, like Org Mode buffers. (Bug#9218)
2236
2237 * dispextern.h (struct bidi_it): New member disp_prop_p.
2238
2239 * xdisp.c: Remove one-slot cache of display string positions.
2240 (compute_display_string_pos): Accept an additional argument
5e617bc2 2241 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
2242 for a display string or property. If found, set DISP_PROP_P
2243 non-zero.
2244
2245 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
2246 DISP_PROP_P, and pass it to compute_display_string_pos.
2247 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
2248 non-zero. All callers of bidi_fetch_char changed.
2249
fb33fa43
SM
22502011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
2251
2252 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
2253
b099e063
DM
22542010-12-03 Don March <don@ohspite.net>
2255
2256 * keymap.c (Fdefine_key): Fix non-prefix key error message when
2257 last character M-[char] is translated to ESC [char] (bug#7541).
2258
5cc7f7af
KH
22592011-08-02 Kenichi Handa <handa@m17n.org>
2260
d0fffa3f 2261 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
2262
2263 * chartab.c (uniprop_table): Make it non-static.
2264
525d5e6e
EZ
22652011-08-01 Eli Zaretskii <eliz@gnu.org>
2266
2267 * xdisp.c (forward_to_next_line_start): Accept additional argument
2268 BIDI_IT_PREV, and store into it the state of the bidi iterator had
2269 on the newline.
2270 (reseat_at_next_visible_line_start): Use the bidi iterator state
2271 returned by forward_to_next_line_start to restore the state of
2272 it->bidi_it after backing up to previous newline. (Bug#9212)
2273
31011111
AS
22742011-07-30 Andreas Schwab <schwab@linux-m68k.org>
2275
2276 * regex.c (re_comp): Protoize.
2277 (re_exec): Fix return type.
2278 (regexec): Fix type of `ret'. (Bug#9203)
2279
476371c4
PE
22802011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2281
e5d76069
PE
2282 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
2283 This is needed if max-image-size is a floating-point number.
2284
9a79b20c
AS
22852011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2286
2287 * print.c (print_object): Print empty symbol as ##.
2288
2289 * lread.c (read1): Read ## as empty symbol.
2290
d8c2fa78
AA
22912011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
2292
2293 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
2294 setting frame foreground color (Bug#9175).
2295 (x_set_background_color): Likewise.
2296
ffe57a7a
AA
2297 * nsmenu.m (-setText): Size tooltip dimensions precisely to
2298 contents (Bug#9176).
2299 (EmacsTooltip -init): Remove bezels and add shadows to
2300 tooltip windows.
2301
bf3492a5
AA
2302 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
2303 or scroll bar (Bug#8470).
2304
d55e9c53
AA
2305 * nsfont.m (nsfont_open): Remove assignment to voffset and
2306 unnecessary vars hshink, expand, hd, full_height, min_height.
2307 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
2308
2309 * nsterm.h (nsfont_info): Remove voffset field.
2310
d8c2fa78 23112011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
2312
2313 Implement strike-through and overline on NextStep (Bug#8863).
2314
2315 * nsfont.m (nsfont_open): Use underline position provided by font,
2316 instead of hard-coded value of 2.
2317 (nsfont_draw): Call ns_draw_text_decoration instead.
2318
2319 * nsterm.h: Add declaration for ns_draw_text_decoration.
2320
2321 * nsterm.m (ns_draw_text_decoration): New function for drawing
2322 underline, overline, and strike-through.
2323 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
2324 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 2325 accommodate underlining, etc.
4843aac3 2326
4cc60b9b
EZ
23272011-07-28 Eli Zaretskii <eliz@gnu.org>
2328
bc7ece87
EZ
2329 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
2330 default.
4cc60b9b 2331
476371c4
PE
23322011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2333
66606eea
PE
2334 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
2335 Without this fix, if a signal arrives just after memory fills up,
2336 'malloc' might be invoked reentrantly.
2337
476371c4
PE
2338 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
2339 In other words, assume that every image size is allowed, on non-X
2340 hosts. This assumption is probably wrong, but it lets Emacs compile.
2341
f3fcc40d
AS
23422011-07-28 Andreas Schwab <schwab@linux-m68k.org>
2343
2344 * regex.c (re_iswctype): Convert return values to boolean.
2345
350c992f
EZ
23462011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
2347
2348 * xdisp.c (compute_display_string_pos): Don't use cached display
2349 string position if the buffer had its restriction changed.
2350 (Bug#9184)
2351
5266b4bb
PE
23522011-07-28 Paul Eggert <eggert@cs.ucla.edu>
2353
2354 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
2355
2573a837 23562011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 2357
41f55ccd 2358 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 2359
39e378da
PE
2360 * bidi.c: Integer size and overflow fixes.
2361 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
2362 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
2363 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2364 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
2365 (bidi_find_other_level_edge):
2366 Use ptrdiff_t instead of EMACS_INT where either will do.
2367 This works better on 32-bit hosts configured --with-wide-int.
2368 (bidi_cache_ensure_space): Check for size-calculation overflow.
2369 Use % rather than repeated addition, for better worst-case speed.
2370 Don't set bidi_cache_size until after xrealloc returns, because it
2371 might not return.
2372 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
2373 (bidi_cache_ensure_space): Also check that the bidi cache size
2374 does not exceed that of the largest Lisp string or buffer. See Eli
2375 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 2376
5e927815
PE
2377 * alloc.c (__malloc_size_t): Remove.
2378 All uses replaced by size_t. See Andreas Schwab's note
2379 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
2380
ca4aa935
PE
2381 * image.c: Improve checking for integer overflow.
2382 (check_image_size): Assume that f is nonnull, since
2383 it is always nonnull in practice. This is one less thing to
2384 worry about when checking for integer overflow later.
2385 (x_check_image_size): New function, which checks for integer
2386 overflow issues inside X.
2387 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
2388 This removes the need for a memory_full check.
2389 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
2390 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
2391 (xbm_read_bitmap_data): Change locals back to 'int', since
2392 their values must fit in 'int'.
2393 (xpm_load_image, png_load, tiff_load):
2394 Invoke x_create_x_image_and_pixmap earlier,
2395 to avoid much needless work if the image is too large.
2396 (tiff_load): Treat overly large images as if
2397 x_create_x_image_and_pixmap failed, not as malloc failures.
2398 (gs_load): Use x_check_image_size.
2399
5f8f9cc2
PE
2400 * gtkutil.c: Omit integer casts.
2401 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
2402 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
2403
5adf60bc
PE
2404 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
2405
c8907a93
PE
2406 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
2407 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
2408 would wrongly return t on a 64-bit host.
2409
e3c25c68
PE
2410 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
2411 The plain *_OVERFLOW macros run afoul of GCC bug 49705
2412 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
2413 and therefore cause GCC to emit a bogus diagnostic in some cases.
2414
3f791afe
PE
2415 * image.c: Integer signedness and overflow and related fixes.
2416 This is not an exhaustive set of fixes, but it's time to
2417 record what I've got.
2418 (lookup_pixel_color, check_image_size): Remove redundant decls.
2419 (check_image_size): Don't assume that arbitrary EMACS_INT values
2420 fit in 'int', or that arbitrary 'double' values fit in 'int'.
2421 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
2422 (tiff_load, imagemagick_load_image):
2423 Check for overflow in size calculations.
2424 (x_create_x_image_and_pixmap): Remove unnecessary test for
2425 xmalloc returning NULL; that can't happen.
2426 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
2427 (xpm_color_bucket): Use better integer hashing function.
2428 (xpm_cache_color): Don't possibly over-allocate memory.
2429 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
2430 (gif_memory_source):
2431 Use ptrdiff_t, not int or size_t, to record sizes.
2432 (png_load): Don't assume values greater than 2**31 fit in 'int'.
2433 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
2434 either works, as we prefer signed integers.
2435 (tiff_read_from_memory, tiff_write_from_memory):
2436 Return tsize_t, not size_t, since that's what the TIFF API wants.
2437 (tiff_read_from_memory): Don't fail simply because the read would
2438 go past EOF; instead, return a short read.
2439 (tiff_load): Omit no-longer-needed casts.
2440 (Fimagemagick_types): Don't assume size fits into 'int'.
2441
3cc5a532
PE
2442 Improve hashing quality when configured --with-wide-int.
2443 * fns.c (hash_string): New function, taken from sxhash_string.
2444 Do not discard information about ASCII character case; this
2445 discarding is no longer needed.
2446 (sxhash-string): Use it. Change sig to match it. Caller changed.
2447 * lisp.h: Declare it.
2448 * lread.c (hash_string): Remove, since we now use fns.c's version.
2449 The fns.c version returns a wider integer if --with-wide-int is
2450 specified, so this should help the quality of the hashing a bit.
2451
b312a492
PE
2452 * emacs.c: Integer overflow minor fix.
2453 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
2454 Define only if GNU_LINUX.
2455 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
2456
dfd153ae
PE
2457 * dispnew.c: Integer signedness and overflow fixes.
2458 Remove unnecessary forward decls, that were a maintenance hassle.
2459 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
2460 All uses changed.
2461 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
2462 (scrolling_window): Use ptrdiff_t, not int, for byte count.
2463 (prepare_desired_row, line_draw_cost):
2464 Use int, not unsigned, where either works.
2465 (save_current_matrix, restore_current_matrix):
2466 Use ptrdiff_t, not size_t, where either works.
2467 (init_display): Check for overflow more accurately, and without
2468 relying on undefined behavior.
2469
a81d11a3
PE
2470 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
2471 Remove, replacing with the new symbols in lisp.h. All uses changed.
2472 * fileio.c (make_temp_name):
2473 * filelock.c (lock_file_1, lock_file):
2474 * xdisp.c (message_dolog):
2475 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
2476 Use pMd etc. instead.
2477 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
2478 replacing the pWIDE etc. symbols removed from editfns.c.
2479
3300e6fd
PE
2480 * keyboard.h (num_input_events): Now uintmax_t.
2481 This is (very slightly) less likely to mess up due to wraparound.
2482 All uses changed.
2483
fd05c7e9
PE
2484 * buffer.c: Integer signedness fixes.
2485 (alloc_buffer_text, enlarge_buffer_text):
2486 Use ptrdiff_t rather than size_t when either will do, as we prefer
2487 signed integers.
2488
903fe15d
PE
2489 * alloc.c: Integer signedness and overflow fixes.
2490 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
2491 (__malloc_size_t): Default to size_t, not to int.
2492 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
2493 (Fgarbage_collect, mark_object_loop_halt, mark_object):
2494 Prefer ptrdiff_t to size_t when either would do, as we prefer
2495 signed integers.
2496 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
2497 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
2498 Now const. Initialize with values that are in range even if char
2499 is signed.
2500 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
2501 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
2502 These functions do the right thing with sizes > 2**32.
2503 (check_depth): Now ptrdiff_t, not int.
2504 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
2505 Adjust to new way of storing sizes. Check for size overflow bugs
2506 in rest of code.
2507 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
2508 slightly wrong anyway, as it missed one instance of
2509 XMALLOC_OVERRUN_CHECK_OVERHEAD.
2510 (refill_memory_reserve): Omit needless cast to size_t.
2511 (mark_object_loop_halt): Mark as externally visible.
2512
ac82cc6a
PE
2513 * xselect.c: Integer signedness and overflow fixes.
2514 (Fx_register_dnd_atom, x_handle_dnd_message):
2515 Use ptrdiff_t, not size_t, since we prefer signed.
2516 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
2517 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
2518 x_dnd_atoms_size and x_dnd_atoms_length.
2519
c2d1e36d
PE
2520 * doprnt.c: Prefer signed to unsigned when either works.
2521 * eval.c (verror):
2522 * doprnt.c (doprnt):
2523 * lisp.h (doprnt):
2524 * xdisp.c (vmessage):
2525 Use ptrdiff_t, not size_t, when using or implementing doprnt,
2526 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
2527 prefer signed arithmetic to avoid comparison confusion.
2528 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
2529 but is a bit tricky.
2530
0e926e56
PE
2531 Assume freestanding C89 headers, string.h, stdlib.h.
2532 * data.c, doprnt.c, floatfns.c, print.c:
2533 Include float.h unconditionally.
2534 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
2535 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
2536 * regex.c: Likewise for stddef.h, string.h.
2537 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
2538 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
2539 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
2540 (STDC_HEADERS): Remove obsolete defines.
2541 * sysdep.c: Include limits.h unconditionally.
2542
9cfdb3ec
PE
2543 Assume support for memcmp, memcpy, memmove, memset.
2544 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
2545 * regex.c (memcmp, memcpy):
2546 Remove; we assume C89 now.
2547
2548 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
2549 (__malloc_safe_bcopy): Remove; no longer needed.
2550
cf950e6b 2551 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
2552 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
2553 well either way, and we prefer signed to unsigned.
2554
dbf38e02
LMI
25552011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
2556
2557 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
2558 closes the connection while we're reading (bug#9182).
2559
d6f0886c 25602011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 2561
d6f0886c
JD
2562 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
2563 are specified (Bug#9168).
24e0f6b1 2564
2eb1f9e6
PE
25652011-07-25 Paul Eggert <eggert@cs.ucla.edu>
2566
2567 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
2568 Found by GCC static checking and --with-wide-int on a 32-bit host.
2569
22381272 25702011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
2571
2572 * xdisp.c (compute_display_string_pos): Fix logic of caching
2573 previous display string position. Initialize cached_prev_pos to
2574 -1. Fixes slow-down at the beginning of a buffer.
2575
f25e39b4
EZ
25762011-07-24 Eli Zaretskii <eliz@gnu.org>
2577
2578 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
2579 for attrs[LFACE_FONTSET_INDEX].
2580
04c4b52e
PE
25812011-07-23 Paul Eggert <eggert@cs.ucla.edu>
2582
2583 * xml.c (parse_region): Remove unused local
2584 that was recently introduced.
2585
c1734fbd
EZ
25862011-07-23 Eli Zaretskii <eliz@gnu.org>
2587
be18c5a5
EZ
2588 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
2589 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
2590
c1734fbd
EZ
2591 * xdisp.c (move_it_in_display_line_to): Record the best matching
2592 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
2593 exit if none of the characters scanned was an exact match.
2594 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
2595 when exact match is impossible due to invisible text, and the
2596 lines are truncated.
2597
a258d627
JD
25982011-07-23 Jan Djärv <jan.h.d@swipnet.se>
2599
2600 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
2601 for OSX >= 10.7.
2602
b6d5a689
EZ
26032011-07-22 Eli Zaretskii <eliz@gnu.org>
2604
0f74f785
EZ
2605 Fix a significant slow-down of cursor motion with C-n, C-p,
2606 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
2607 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 2608 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
2609 (next_element_from_buffer): Call compute_stop_pos_backwards to
2610 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
2611 base_level_stop.
2612 (reseat): Don't look for prev_stop, as that could mean a very long
2613 run.
2614 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
2615 <cached_disp_overlay_modiff>: Cache for last found display string
2616 position.
551918c1 2617 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
2618 about the same buffer in the same area of character positions, and
2619 the buffer wasn't changed since the time the display string
2620 position was cached.
551918c1 2621
b2d0c91a
EZ
26222011-07-22 Eli Zaretskii <eliz@gnu.org>
2623
2624 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
2625 is an integer, which is important for empty lines. (Bug#9149)
2626
043604ee
CY
26272011-07-22 Chong Yidong <cyd@stupidchicken.com>
2628
2629 * frame.c (Fmodify_frame_parameters): In tty case, update the
2630 default face if necessary (Bug#4238).
2631
da4adb04
CY
26322011-07-21 Chong Yidong <cyd@stupidchicken.com>
2633
2634 * editfns.c (Fstring_to_char): No need to explain what a character
2635 is in the docstring (Bug#6576).
2636
9abd0532
LMI
26372011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2638
2639 * xml.c (parse_region): Make sure we always return a tree.
2640
36881d16
HK
26412011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
2642
2643 * xml.c (parse_region): If a document contains only comments,
2644 return that, too.
2645
1e98674d
LMI
26462011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
2647
2648 * xml.c (make_dom): Return comments, too.
2649
590bd467
PE
26502011-07-19 Paul Eggert <eggert@cs.ucla.edu>
2651
2652 Port to OpenBSD.
2653 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
2654 and the surrounding thread.
2655 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
2656 rather than fgets, and retry after EINTR. Otherwise, 'emacs
2657 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
2658 timer goes off.
2659 * s/openbsd.h (BROKEN_SIGIO): Define.
2660 * unexelf.c (unexec) [__OpenBSD__]:
2661 Don't update the .mdebug section of the Alpha COFF symbol table.
2662
f41628b2
LMI
26632011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
2664
2665 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
2666 (bug#8460).
2667
b59b67c5
PE
26682011-07-18 Paul Eggert <eggert@cs.ucla.edu>
2669
15e3a074
PE
2670 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
2671 This fixes some race conditions on the permissions of any newly
2672 created file.
2673
41bed37d
PE
2674 * alloc.c (valid_pointer_p): Use pipe, not open.
2675 This fixes some permissions issues when debugging.
2676
b59b67c5
PE
2677 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
2678 If fchown fails to set both uid and gid, try to set just gid,
2679 as that is sometimes allowed. Adjust the file's mode to eliminate
2680 setuid or setgid bits that are inappropriate if fchown fails.
2681
925a6be7
SM
26822011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2683
2684 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
2685 to compare Lisp_Objects.
2686 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
2687 global_gnutls_log_level, don't mistake it for a Lisp_Object.
2688 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
2689
52968808
AS
26902011-07-17 Andreas Schwab <schwab@linux-m68k.org>
2691
0a6a104b
AS
2692 * lread.c (read_integer): Unread even EOF character.
2693 (read1): Likewise. Properly record start position of symbol.
2694
52968808
AS
2695 * lread.c (read1): Read `#:' as empty uninterned symbol if no
2696 symbol character follows.
2697
9e381cdd
PE
26982011-07-17 Paul Eggert <eggert@cs.ucla.edu>
2699
2700 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
2701 This works around a problem with the previous change to Fcopy_file.
2702 Recent glibc declares fchown with __attribute__((warn_unused_result)),
2703 and without this change, GCC might complain about discarding
2704 fchown's return value.
2705
b5641435
JB
27062011-07-16 Juanma Barranquero <lekktu@gmail.com>
2707
2708 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
2709
a8031457
PE
27102011-07-16 Paul Eggert <eggert@cs.ucla.edu>
2711
2712 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
2713
dd889327
LMI
27142011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
2715
750c33f7
LMI
2716 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
2717 it's used from the C level.
2718
dd889327
LMI
2719 * process.c: Use the same condition for POLL_FOR_INPUT in both
2720 keyboard.c and process.c (bug#1858).
2721
87e86684
LM
27222011-07-09 Lawrence Mitchell <wence@gmx.li>
2723
2724 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
2725 (Fgnutls_boot): Use it.
2726
64348f40
AS
27272011-07-15 Andreas Schwab <schwab@linux-m68k.org>
2728
2729 * doc.c (Fsubstitute_command_keys): Revert last change.
2730
1d698799
LMI
27312011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
2732
f863868c
LMI
2733 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
2734 quotes the next character, and doesn't affect other longer
2735 sequences (bug#8935).
2736
1d698799
LMI
2737 * lread.c (syms_of_lread): Clarify that is isn't only
2738 `eval-buffer' and `eval-defun' that's affected by
2739 `lexical-binding' (bug#8460).
2740
aa4b6df6
EZ
27412011-07-15 Eli Zaretskii <eliz@gnu.org>
2742
2743 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
2744 bidi redisplay when a line includes both an image and is
2745 truncated.
2746
5d856da6
PE
27472011-07-14 Paul Eggert <eggert@cs.ucla.edu>
2748
ad6042bb
PE
2749 Fix minor problems found by static checking.
2750 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
2751 (elsz): Now a signed constant, not a size_t var. We prefer signed
2752 types to unsigned, to avoid integer comparison confusion. Without
2753 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
2754 "cannot optimize loop, the loop counter may overflow", a symptom
2755 of the confusion.
f00bbb22 2756 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
2757 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
2758
6468f31c
LMI
27592011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2760
49080b10
LMI
2761 * search.c (Fre_search_backward): Mention `case-fold-search' in
2762 all the re_search_* functions (bug#8138).
2763
6468f31c
LMI
2764 * keyboard.c (Fopen_dribble_file): Document when the file is
2765 closed (bug#8056).
2766
c965adc5
EZ
27672011-07-14 Eli Zaretskii <eliz@gnu.org>
2768
df9733bf
EZ
2769 * bidi.c (bidi_dump_cached_states): Fix format of displaying
2770 bidi_cache_idx.
2771
0bb23927
EZ
2772 Support bidi reordering of display and overlay strings.
2773 * xdisp.c (compute_display_string_pos)
2774 (compute_display_string_end): Accept additional argument STRING.
2775 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
2776 (reseat_to_string): Initialize bidi_it->string.s and
2777 bidi_it->string.schars.
2778 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
2779 NULL (avoids a crash in bidi_paragraph_init).
2780 Initialize itb.string.lstring.
0bb23927
EZ
2781 (init_iterator): Call bidi_init_it only of a valid
2782 buffer position was specified. Initialize paragraph_embedding to
2783 L2R.
2784 (reseat_to_string): Initialize the bidi iterator.
2785 (display_string): If we need to ignore text properties of
2786 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
2787 original value of -1 will not work with bidi.)
2788 (compute_display_string_pos): First arg is now struct
2789 `text_pos *'; all callers changed. Support display properties on
2790 Lisp strings.
2791 (compute_display_string_end): Support display properties on Lisp
2792 strings.
2793 (init_iterator, reseat_1, reseat_to_string): Initialize the
2794 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
2795 when iterating on a string not from display properties).
640c8776
SM
2796 (compute_display_string_pos, compute_display_string_end):
2797 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
2798 arrow keys.
2799 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
2800 base_level_stop; instead, set base_level_stop to BEGV.
2801 Fixes crashes in vertical-motion.
0bb23927
EZ
2802 (next_element_from_buffer): Improve commentary for when
2803 the iterator is before prev_stop.
2804 (init_iterator): Initialize bidi_p from the default value of
2805 bidi-display-reordering, not from buffer-local value. Use the
2806 buffer-local value only if initializing for buffer iteration.
2807 (handle_invisible_prop): Support invisible properties on strings
2808 that are being bidi-reordered.
2809 (set_iterator_to_next): Support bidi reordering of C strings and
2810 Lisp strings.
2811 (next_element_from_string): Support bidi reordering of Lisp
2812 strings.
2813 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
2814 (display_string): Support display of R2L glyph rows.
2815 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
2816 (init_iterator): Don't initialize it->bidi_p for strings
2817 here.
2818 (reseat_to_string): Initialize it->bidi_p for strings here.
2819 (next_element_from_string, next_element_from_c_string)
2820 (next_element_from_buffer): Add xassert's for correspondence
2821 between IT's object being iterated and it->bidi_it.string
2822 structure.
2823 (face_before_or_after_it_pos): Support bidi iteration.
2824 (next_element_from_c_string): Handle the case of the first string
2825 character that is not the first one in the visual order.
2826 (get_visually_first_element): New function, refactored from common
2827 parts of next_element_from_buffer, next_element_from_string, and
2828 next_element_from_c_string.
2829 (tool_bar_lines_needed, redisplay_tool_bar)
2830 (display_menu_bar): Force left-to-right direction. Add a FIXME
2831 comment for making that be controlled by a user option.
2832 (push_it, pop_it): Save and restore the state of the
2833 bidi iterator. Save and restore the bidi_p flag.
2834 (pop_it): Iterate out of display property for string iteration as
2835 well.
2836 (iterate_out_of_display_property): Support iteration over strings.
2837 (handle_single_display_spec): Set up it->bidi_it for iteration
2838 over a display string, and call bidi_init_it.
2839 (handle_single_display_spec, next_overlay_string)
2840 (get_overlay_strings_1, push_display_prop): Set up the bidi
2841 iterator for displaying display or overlay strings.
2842 (forward_to_next_line_start): Don't use the shortcut if
2843 bidi-iterating.
2844 (back_to_previous_visible_line_start): If handle_display_prop
2845 pushed the iterator stack, restore the internal state of the bidi
2846 iterator by calling bidi_pop_it same number of times.
2847 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
2848 and we are bidi-iterating, don't decrement the iterator position;
2849 instead, set the first_elt flag in the bidi iterator, to produce
2850 the same effect.
2851 (reseat_1): Remove redundant setting of string_from_display_prop_p.
2852 (push_display_prop): xassert that we are iterating a buffer.
2853 (push_it, pop_it): Save and restore paragraph_embedding member.
2854 (handle_single_display_spec, next_overlay_string)
2855 (get_overlay_strings_1, reseat_1, reseat_to_string)
2856 (push_display_prop): Set up the `unibyte' member of bidi_it.string
2857 correctly. Don't assume unibyte strings are not bidi-reordered.
2858 (compute_display_string_pos)
2859 (compute_display_string_end): Fix handling the case of C string.
2860 (push_it, pop_it): Save and restore from_disp_prop_p.
2861 (handle_single_display_spec, push_display_prop): Set the
2862 from_disp_prop_p flag.
2863 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
2864 (pop_it): Call iterate_out_of_display_property only if we are
2865 popping after iteration over a string that came from a display
2866 property. Fix a typo in popping stretch info. Add an assertion
2867 for verifying that the iterator position is in sync with the bidi
2868 iterator.
2869 (handle_single_display_spec, get_overlay_strings_1)
2870 (push_display_prop): Fix initialization of paragraph direction for
2871 string when that of the parent object is not yet determined.
2872 (reseat_1): Call bidi_init_it to resync the bidi
2873 iterator with IT's position. (Bug#7616)
2874 (find_row_edges): If ROW->start.pos gives position
2875 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
2876 (handle_stop, back_to_previous_visible_line_start, reseat_1):
2877 Reset the from_disp_prop_p flag.
2878 (SAVE_IT, RESTORE_IT): New macros.
2879 (pos_visible_p, face_before_or_after_it_pos)
2880 (back_to_previous_visible_line_start)
2881 (move_it_in_display_line_to, move_it_in_display_line)
2882 (move_it_to, move_it_vertically_backward, move_it_by_lines)
2883 (try_scrolling, redisplay_window, display_line): Use them when
2884 saving a temporary copy of the iterator and restoring it back.
2885 (back_to_previous_visible_line_start, reseat_1)
2886 (init_iterator): Empty the bidi cache "stack".
2887 (move_it_in_display_line_to): If iterator ended up at
2888 EOL, but we never saw any buffer positions smaller than
2889 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
2890 motion in bidi-reordered lines.
2891 (move_it_in_display_line_to): Record prev_method and prev_pos
2892 immediately before the call to set_iterator_to_next. Fixes cursor
2893 motion in bidi-reordered lines with stretch glyphs and strings
2894 displayed in margins. (Bug#8133) (Bug#8867)
2895 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
2896 TO_CHARPOS.
640c8776
SM
2897 (pos_visible_p): Support positions in bidi-reordered lines.
2898 Save and restore bidi cache.
0bb23927
EZ
2899
2900 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
2901 (bidi_paragraph_info): Delete unused struct.
2902 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
2903 (bidi_cache_start): New variable.
2904 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
2905 to zero.
2906 (bidi_cache_fetch_state, bidi_cache_search)
2907 (bidi_cache_find_level_change, bidi_cache_iterator_state)
2908 (bidi_cache_find, bidi_peek_at_next_level)
2909 (bidi_level_of_next_char, bidi_find_other_level_edge)
2910 (bidi_move_to_visually_next): Compare cache index with
2911 bidi_cache_start rather than with zero.
2912 (bidi_fetch_char): Accept new argument STRING; all callers
2913 changed. Support iteration over a string. Support strings with
2914 display properties. Support unibyte strings. Fix the type of
2915 `len' according to what STRING_CHAR_AND_LENGTH expects.
2916 (bidi_paragraph_init, bidi_resolve_explicit_1)
2917 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
2918 (bidi_level_of_next_char, bidi_move_to_visually_next):
2919 Support iteration over a string.
0bb23927
EZ
2920 (bidi_set_sor_type, bidi_resolve_explicit_1)
2921 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
2922 can now be zero (for strings); special values 0 and -1 were
2923 changed to -1 and -2, respectively.
2924 (bidi_char_at_pos): New function.
2925 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
2926 Call it instead of FETCH_MULTIBYTE_CHAR.
2927 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
2928 initialized to valid values.
2929 (bidi_init_it): Don't initialize charpos and bytepos with invalid
2930 values.
2931 (bidi_level_of_next_char): Allow the sentinel "position" to pass
2932 the test for valid cached positions. Fix the logic for looking up
2933 the sentinel state in the cache. GCPRO the Lisp string we are
2934 iterating.
2935 (bidi_push_it, bidi_pop_it): New functions.
2936 (bidi_initialize): Initialize the bidi cache start stack pointer.
2937 (bidi_cache_ensure_space): New function, refactored from part of
2938 bidi_cache_iterator_state. Don't assume the required size is just
2939 one BIDI_CACHE_CHUNK away.
2940 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
2941 (bidi_count_bytes, bidi_char_at_pos): New functions.
2942 (bidi_cache_search): Don't assume bidi_cache_last_idx is
2943 always valid if bidi_cache_idx is valid.
2944 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
2945 is valid if it's going to be used.
2946 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
2947 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
2948 (bidi_cache_find_level_change, bidi_cache_ensure_space)
2949 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
2950 (bidi_find_other_level_edge, bidi_cache_start_stack):
2951 All variables related to cache indices are now EMACS_INT.
c965adc5 2952
0bb23927
EZ
2953 * dispextern.h (struct bidi_string_data): New structure.
2954 (struct bidi_it): New member `string'. Make flag members be 1-bit
2955 fields, and put them last in the struct.
640c8776
SM
2956 (compute_display_string_pos, compute_display_string_end):
2957 Update prototypes.
0bb23927
EZ
2958 (bidi_push_it, bidi_pop_it): Add prototypes.
2959 (struct iterator_stack_entry): New members bidi_p,
2960 paragraph_embedding, and from_disp_prop_p.
2961 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
2962 (bidi_shelve_cache, bidi_unshelve_cache):
2963 Declare prototypes.
0bb23927
EZ
2964
2965 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
2966 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
2967 and vector-like objects.
2968
2969 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
2970 cache around display iteration.
2971
2972 * window.c (Fwindow_end, window_scroll_pixel_based)
2973 (displayed_window_lines, Frecenter): Save and restore the bidi
2974 cache around display iteration.
2975
3bbd2265
LMI
29762011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2977
2978 * editfns.c (Fdelete_region): Clarify the use of the named
2979 parameters (bug#6788).
2980
adc47434
MR
29812011-07-14 Martin Rudalics <rudalics@gmx.at>
2982
2983 * indent.c (Fvertical_motion): Set and restore w->pointm when
2984 saving and restoring the window's buffer (Bug#9006).
2985
837c31f8
LMI
29862011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
2987
2988 * editfns.c (Fstring_to_char): Clarify just what is returned
2989 (bug#6576). Text by Eli Zaretskii.
2990
ac389d0c
JB
29912011-07-13 Juanma Barranquero <lekktu@gmail.com>
2992
2993 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
2994
0be0ce47
EZ
29952011-07-13 Eli Zaretskii <eliz@gnu.org>
2996
2997 * buffer.c (mmap_find): Fix a typo.
2998
cd18e7e3
JB
29992011-07-13 Johan Bockgård <bojohan@gnu.org>
3000
3001 Fix execution of x selection hooks.
3002 * xselect.c (Qx_lost_selection_functions)
3003 (Qx_sent_selection_functions): New vars.
3004 (syms_of_xselect): DEFSYM them.
3005 (x_handle_selection_request): Pass Qx_sent_selection_functions
3006 rather than Vx_sent_selection_functions to Frun_hook_with_args.
3007 (x_handle_selection_clear,x_clear_frame_selections):
3008 Pass Qx_lost_selection_functions rather than
3009 Vx_lost_selection_functions to Frun_hook_with_args.
3010
47ea7f44
PE
30112011-07-13 Paul Eggert <eggert@cs.ucla.edu>
3012
ac389d0c 3013 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
3014 The old code sometimes used this field without initializing it.
3015
47ea7f44
PE
3016 * alloc.c (gc_sweep): Don't read past end of array.
3017 In theory, the old code could also have corrupted Emacs internals,
3018 though it'd be very unlikely.
3019
bc985c87
AS
30202011-07-12 Andreas Schwab <schwab@linux-m68k.org>
3021
3022 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 3023 argument. (Bug#4026)
bc985c87 3024
0cf34688
LMI
30252011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
3026
b3dadd76
LMI
3027 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
3028 key" (bug#4257).
3029
0cf34688
LMI
3030 * window.c (Fset_window_start): Doc fix (bug#4199).
3031 (Fset_window_hscroll): Ditto.
3032
270768cd
PE
30332011-07-12 Paul Eggert <eggert@cs.ucla.edu>
3034
077e3dda 3035 Fix minor new problems caught by GCC 4.6.1.
270768cd 3036 * term.c (init_tty): Remove unused local.
490011a6 3037 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 3038 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 3039 not used otherwise.
270768cd 3040
b1f58454
CY
30412011-07-12 Chong Yidong <cyd@stupidchicken.com>
3042
3043 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
3044
22b9578d
LMI
30452011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
3046
6e70ab07
LMI
3047 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
3048 are the mini-buffer and the echo area (bug#3320).
3049
22b9578d
LMI
3050 * term.c (init_tty): Remove support for supdup, c10 and perq
3051 terminals, which are no longer supported (bug#1482).
3052
8974cc9f
JB
30532011-07-10 Johan Bockgård <bojohan@gnu.org>
3054
3055 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
3056
a560d974
JD
30572011-07-10 Jan Djärv <jan.h.d@swipnet.se>
3058
3059 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
3060 for non-popups (Bug#3642).
3061
1dae0f0a
AS
30622011-07-10 Andreas Schwab <schwab@linux-m68k.org>
3063
268c2c36 3064 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 3065 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
3066 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
3067 * cm.c (losecursor): Likewise.
1dae0f0a
AS
3068 * data.c (fmod): Likewise.
3069 * dispnew.c (swap_glyphs_in_rows): Likewise.
3070 * emacs.c (memory_warning_signal): Likewise.
3071 * floatfns.c (float_error): Likewise.
3072 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
3073 (otf_open, font_otf_capability, generate_otf_features)
3074 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
3075 Likewise.
3076 * image.c (pbm_read_file): Likewise.
3077 * indent.c (string_display_width): Likewise.
3078 * intervals.c (check_for_interval, search_for_interval)
3079 (inc_interval_count, count_intervals, root_interval)
3080 (adjust_intervals_for_insertion, make_new_interval): Likewise.
3081 * lread.c (defalias): Likewise.
268c2c36 3082 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
3083 * regex.c (set_image_of_range_1, set_image_of_range)
3084 (regex_grow_registers): Likewise.
3085 * sysdep.c (strerror): Likewise.
3086 * termcap.c (valid_filename_p, tprint, main): Likewise.
3087 * tparam.c (main): Likewise.
3088 * unexhp9k800.c (run_time_remap, save_data_space)
3089 (update_file_ptrs, read_header, write_header, calculate_checksum)
3090 (copy_file, copy_rest, display_header): Likewise.
3091 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
3092 Likewise.
3093 * xdisp.c (check_it): Likewise.
3094 * xfaces.c (register_color, unregister_color, unregister_colors):
3095 Likewise.
3096 * xfns.c (print_fontset_result): Likewise.
3097 * xrdb.c (member, fatal, main): Likewise.
3098
99033785
PE
30992011-07-10 Paul Eggert <eggert@cs.ucla.edu>
3100
3101 Fix minor problems found by static checking (Bug#9031).
3102 * chartab.c (char_table_set_range, map_sub_char_table):
3103 Remove unused locals.
3104 (uniprop_table): Now static.
3105 * composite.c (_work_char): Remove unused static var.
3106
9cb2ac56
JB
31072011-07-09 Juanma Barranquero <lekktu@gmail.com>
3108
3109 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
3110
f25661f0
JD
31112011-07-09 Jan Djärv <jan.h.d@swipnet.se>
3112
3113 * gtkutil.c (qttip_cb): Remove code without function.
3114
8278c4fe
EZ
31152011-07-09 Eli Zaretskii <eliz@gnu.org>
3116
3117 * w32.c (pthread_sigmask): New stub.
3118
1692ae2d 31192011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 3120
8a6ebd58 3121 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
3122 sigprocmask is portable only for single-threaded applications, and
3123 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
3124 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
3125 (LIBES): Use it.
3126 * callproc.c (Fcall_process):
3127 * process.c (create_process):
3128 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
3129 Use pthread_sigmask, not sigprocmask.
123403e4 3130
1b854618
JD
31312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3132
3133 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
3134 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
3135 wrong (Bug#8591).
3136
3fe4b549
JD
31372011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3138
0ce7e563
JD
3139 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
3140 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
3141 (xg_hide_tooltip): Fix comment.
3142
3fe4b549
JD
3143 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
3144 in registerServicesMenuSendTypes.
3145 (validRequestorForSendType): Don't check ns_return_types.
3146
3147 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
3148 ns_return_type.
3149
5df75e47
JR
31502011-07-08 Jason Rumney <jasonr@gnu.org>
3151
3152 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
3153 frame struct members of non-existent frames (Bug#6284).
3154
699c10bd
JD
31552011-07-08 Jan Djärv <jan.h.d@swipnet.se>
3156
4393663b
JD
3157 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
3158 variable firstTime not needed on OSX >= 10.6.
3159 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
3160 >= 10.5. Use setKnobProportion, setDoubleValue.
3161
3162 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
3163 (MAC_OS_X_VERSION_10_5): Define if not defined.
3164 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
3165 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
3166 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
3167
3168 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
3169 cString and lossyCString on OSX >= 10.4
3170
3171 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
3172 sizeToFit on OSX >= 10.2.
3173
3174 * nsimage.m (allocInitFromFile): Don't use deprecated method
3175 bestRepresentationForDevice on OSX >= 10.6.
3176
3177 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
3178 to avoid warning.
3179
3180 * emacs.c: Declare unexec_init_emacs_zone.
3181
a63e0781
JD
3182 * nsgui.h: Fix compiler warning about gnulib redefining verify.
3183
699c10bd
JD
3184 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
3185
3186 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
3187 on svcsMenu (Bug#8842).
3188
3189 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
3190 ns_return_types.
3191 (Fns_list_services): Just return Qnil on 10.6, code not working there.
3192
3193 * nsterm.m (QUTF8_STRING): Declare.
3194 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
3195 (validRequestorForSendType): Return type is (id).
3196 Change indexOfObjectIdenticalTo to indexOfObject.
3197 Check if we have local selection before returning self (Bug#8842).
3198 (writeSelectionToPasteboard): Put local selection into paste board
3199 if we have a local selection (Bug#8842).
3200 (syms_of_nsterm): DEFSYM QUTF8_STRING.
3201
3202 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
3203 (ns_get_local_selection): Declare.
3204
54e10184
LMI
32052011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
3206
9888ff71
LMI
3207 * keymap.c (describe_map_tree): Don't insert a double newline at
3208 the end of the buffer (bug#1169) and return whether we inserted
3209 something.
3210
54e10184
LMI
3211 * callint.c (Fcall_interactively): Change "reading args" to
3212 "providing args" to try to clarify what it does (bug#1010).
3213
15fa4783
KH
32142011-07-07 Kenichi Handa <handa@m17n.org>
3215
3216 * composite.c (composition_compute_stop_pos): Ignore a static
3217 composition starting before CHARPOS (Bug#8915).
3218
3219 * xdisp.c (handle_composition_prop): Likewise.
3220
a8815b00
EZ
32212011-07-07 Eli Zaretskii <eliz@gnu.org>
3222
3223 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
3224 (Bug#9015)
3225
ef7b981d 32262011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
3227
3228 * character.h (unicode_category_t): New enum type.
3229
3230 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
3231 (Qchar_code_property_table): New variable.
3232 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
3233 (UNIPROP_COMPRESSED_FORM_P): New macros.
3234 (char_table_ascii): Uncompress the compressed values.
3235 (sub_char_table_ref): New arg is_uniprop. Callers changed.
3236 Uncompress the compressed values.
ac389d0c 3237 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
3238 (char_table_ref_and_range): Uncompress the compressed values.
3239 (sub_char_table_set): New arg is_uniprop. Callers changed.
3240 Uncompress the compressed values.
3241 (sub_char_table_set_range): Args changed. Callers changed.
3242 (char_table_set_range): Adjuted for the above change.
3243 (map_sub_char_table): Delete args default_val and parent. Add arg
3244 top. Give decoded values to a Lisp function.
640c8776 3245 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
3246 values to a Lisp function. Gcpro more variables.
3247 (uniprop_table_uncompress)
3248 (uniprop_decode_value_run_length): New functions.
3249 (uniprop_decoder, uniprop_decoder_count): New variables.
3250 (uniprop_get_decoder, uniprop_encode_value_character)
3251 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
3252 New functions.
3253 (uniprop_encoder, uniprop_encoder_count): New variables.
3254 (uniprop_get_encoder, uniprop_table)
3255 (Funicode_property_table_internal, Fget_unicode_property_internal)
3256 (Fput_unicode_property_internal): New functions.
3257 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
3258 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 3259 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
3260 char-code-property-alist.
3261
640c8776 3262 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
3263 Vunicode_category_table.
3264
640c8776 3265 * font.c (font_range): Adjust for the change of
c805dec0
KH
3266 Vunicode_category_table.
3267
76b397fb
DN
32682011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
3269
3270 * m/iris4d.h: Remove file, move contents ...
3271 * s/irix6-5.h: ... here.
3272
22b4128e
PE
32732011-07-06 Paul Eggert <eggert@cs.ucla.edu>
3274
3275 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
3276 * alloc.c (mark_buffer):
3277 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
3278 (clone_per_buffer_values): Don't assume that
22b4128e
PE
3279 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
3280 This isn't true in general, and it's particularly not true
3281 if Emacs is configured with --with-wide-int.
3282 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
3283 New macros, used in the buffer.c change.
3284
869795d6
JD
32852011-07-05 Jan Djärv <jan.h.d@swipnet.se>
3286
3287 * xsettings.c: Use both GConf and GSettings if both are available.
3288 (store_config_changed_event): Add comment.
3289 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
3290 (store_tool_bar_style_changed): New functions.
5e617bc2 3291 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
3292 (struct xsettings): Move font inside HAVE_XFT.
3293 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 3294 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 3295 Move inside HAVE_XFT.
640c8776 3296 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
3297 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
3298 also.
3299 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 3300 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 3301 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
3302 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
3303 (parse_settings): Move check for font inside HAVE_XFT.
3304 (read_settings, apply_xft_settings): Add comment.
3305 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
3306 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
3307 call store_font_name_changed.
3308 (xft_settings_event): Add comment.
3309 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
3310 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
3311 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
3312 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
3313 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
3314 (xsettings_get_system_font, xsettings_get_system_normal_font):
3315 Add comment.
869795d6 3316
d8ed26bd
PE
33172011-07-05 Paul Eggert <eggert@cs.ucla.edu>
3318
3319 Random fixes. E.g., (random) never returned negative values.
3320 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
3321 subseconds part to the entropy, as that's a bit more random.
3322 Prefer signed to unsigned, since the signedness doesn't matter and
3323 in general we prefer signed. When given a limit, use a
3324 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
3325 latter isn't right if USE_2_TAGS_FOR_INTS.
3326 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
3327 not 0..VALMASK. Don't discard "excess" bits that random () returns.
3328
cabf1cac
SM
33292011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3330
3331 * textprop.c (text_property_stickiness):
3332 Obey Vtext_property_default_nonsticky.
3333 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
3334 * w32fns.c (syms_of_w32fns):
3335 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
3336
6e9b2be9
PE
33372011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
3340 This is more efficient than Ffile_directory_p and avoids a minor race.
3341
90186c68
LMI
33422011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
3343
7c301272
LMI
3344 * buffer.c (Foverlay_put): Say what the return value is
3345 (bug#7835).
3346
c4f2d8d4
LMI
3347 * fileio.c (barf_or_query_if_file_exists): Check first if the file
3348 is a directory before asking whether to use the file name
3349 (bug#7564).
ad637907
LMI
3350 (barf_or_query_if_file_exists): Make the "File is a directory"
3351 error be more correct.
c4f2d8d4 3352
90186c68
LMI
3353 * fns.c (Frequire): Remove the mention of the .gz files, since
3354 that's installation-specific, but keep the mention of
3355 `get-load-suffixes'.
3356
da64016e
PE
33572011-07-04 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
3360 Report string overflow if the output is too long.
3361
7d47b580
JB
33622011-07-04 Juanma Barranquero <lekktu@gmail.com>
3363
a555cb87
JB
3364 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
3365 (syms_of_gnutls): Remove duplicate DEFSYM for
3366 Qgnutls_bootprop_verify_hostname_error, an error for
3367 Qgnutls_bootprop_verify_error (which is no longer used).
3368
7d47b580
JB
3369 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
3370 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
3371 Also (re)move comments that are misplaced or no longer relevant.
3372
1e49bfab
LMI
33732011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3374
3375 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
3376
1485f4c0
CY
33772011-07-03 Chong Yidong <cyd@stupidchicken.com>
3378
3379 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
3380 and background color parameters if they have been changed.
3381
a9ab721e
LMI
33822011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
3383
3384 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
3385
cf7cff57
PE
33862011-07-03 Paul Eggert <eggert@cs.ucla.edu>
3387
2e13213d
PE
3388 * xsettings.c (SYSTEM_FONT): Define only when used.
3389 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
3390
cf7cff57
PE
3391 * keymap.c (access_keymap_1): Now static.
3392
7a8e04f7
CY
33932011-07-02 Chong Yidong <cyd@stupidchicken.com>
3394
3395 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
3396 leave any prefix arg for the up event (Bug#1586).
3397
61352f62
LMI
33982011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
3399
69bb1ef7
LMI
3400 * lread.c (syms_of_lread): Mention single symbols defined by
3401 `defvar' or `defconst' (bug#7154).
3402
61352f62 3403 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 3404 (Frequire): Mention get-load-suffixes.
61352f62 3405
28545e04
MR
34062011-07-02 Martin Rudalics <rudalics@gmx.at>
3407
3408 * window.h (window): Remove clone_number slot.
3409 * window.c (Fwindow_clone_number, Fset_window_clone_number):
3410 Remove.
3411 (make_parent_window, make_window, saved_window)
3412 (Fset_window_configuration, save_window_save): Don't deal with
3413 clone numbers.
3414 * buffer.c (Qclone_number): Remove declaration.
3415 (sort_overlays, overlay_strings): Don't deal with clone numbers.
3416
3349e122
SM
34172011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
3418
3419 Add multiple inheritance to keymaps.
3420 * keymap.c (Fmake_composed_keymap): New function.
3421 (Fset_keymap_parent): Simplify.
3422 (fix_submap_inheritance): Remove.
3423 (access_keymap_1): New function extracted from access_keymap to handle
3424 embedded parents and handle lists of maps.
3425 (access_keymap): Use it.
3426 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
3427 (Fcopy_keymap): Handle embedded parents.
3428 (Fcommand_remapping, define_as_prefix): Simplify.
3429 (Fkey_binding): Simplify.
3430 (syms_of_keymap): Move minibuffer-local-completion-map,
3431 minibuffer-local-filename-completion-map,
3432 minibuffer-local-must-match-map, and
3433 minibuffer-local-filename-must-match-map to Elisp.
3434 (syms_of_keymap): Defsubr make-composed-keymap.
3435 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
3436 (parse_menu_item): Trivial simplification.
3437
3279eb87
GM
34382011-07-01 Glenn Morris <rgm@gnu.org>
3439
3440 * Makefile.in (SETTINGS_LIBS): Fix typo.
3441
4550efdf
KI
34422011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
3443
3444 * coding.c (Fencode_coding_string): Record the last coding system
3445 used, as the function doc string says (bug#8738).
3446
0949d2b6
JD
34472011-07-01 Jan Djärv <jan.h.d@swipnet.se>
3448
3449 * xsettings.c (store_monospaced_changed): Take new font as arg and
3450 check for change against current_mono_font.
3451 (EMACS_TYPE_SETTINGS): Remove this and related defines.
3452 (emacs_settings_constructor, emacs_settings_get_property)
3453 (emacs_settings_set_property, emacs_settings_class_init)
3454 (emacs_settings_init, gsettings_obj): Remove.
3455 (something_changedCB): New function for HAVE_GSETTINGS.
3456 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
3457 with value as argument.
3458 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
3459 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 3460 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
3461 "changed".
3462
3463 * xgselect.c: Add defined (HAVE_GSETTINGS).
3464 (xgselect_initialize): Ditto.
3465
3466 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
3467 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
3468 xg_select.
3469
bbc6b304
PE
34702011-07-01 Paul Eggert <eggert@cs.ucla.edu>
3471
3472 * eval.c (struct backtrace): Simplify and port the data structure.
3473 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
3474 signed bit field, as this assumption is not portable and it makes
3475 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
3476 "char debug_on_exit : 1" as this is not portable either; instead,
3477 use the portable "unsigned int debug_on_exit : 1". Remove unused
3478 member evalargs. Remove obsolete comments about cc bombing out.
3479
9851bfc5
JD
34802011-06-30 Jan Djärv <jan.h.d@swipnet.se>
3481
51bb811f 3482 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
3483 Let HAVE_GSETTINGS override HAVE_GCONF.
3484 (store_monospaced_changed): New function.
3485 (EMACS_SETTINGS): A new type derived from GObject to handle
3486 GSettings notifications.
3487 (emacs_settings_constructor, emacs_settings_get_property)
3488 (emacs_settings_set_property, emacs_settings_class_init):
3489 New functions.
3490 (gsettings_client, gsettings_obj): New variables.
3491 (GSETTINGS_SCHEMA): New define.
3492 (something_changedCB): Call store_monospaced_changed.
3493 (init_gsettings): New function.
3494 (xsettings_initialize): Call init_gsettings.
3495 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
3496 to NULL.
3497
640c8776 3498 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
3499 GCONF_CFLAGS/LIBS.
3500
5386012d
MR
35012011-06-29 Martin Rudalics <rudalics@gmx.at>
3502
3503 * window.c (resize_root_window, grow_mini_window)
3504 (shrink_mini_window): Rename Qresize_root_window to
3505 Qwindow_resize_root_window and Qresize_root_window_vertically to
3506 Qwindow_resize_root_window_vertically.
3507
f13e0b08
PE
35082011-06-28 Paul Eggert <eggert@cs.ucla.edu>
3509
3510 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
3511
94515237
JB
35122011-06-27 Juanma Barranquero <lekktu@gmail.com>
3513
3514 * makefile.w32-in: Redesign dependencies so they reflect more
3515 clearly which files are directly included by each source file,
3516 and not through other includes.
3517
e43b6e43
MR
35182011-06-27 Martin Rudalics <rudalics@gmx.at>
3519
3520 * buffer.c (Qclone_number): Declare static and DEFSYM it.
3521 (sort_overlays, overlay_strings): When an overlay's clone number
3522 matches the window's clone number process the overlay even if
3523 the overlay's window property doesn't match the current window.
3524
d68443dc
MR
3525 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
3526 (Fwindow_hchild): Rename to Fwindow_left_child.
3527 (Fwindow_next): Rename to Fwindow_next_sibling.
3528 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
3529 (resize_window_check): Rename to window_resize_check.
3530 (resize_window_apply): Rename to window_resize_apply.
3531 (Fresize_window_apply): Rename to Fwindow_resize_apply.
3532 (Fdelete_other_windows_internal, resize_frame_windows)
3533 (Fsplit_window_internal, Fdelete_window_internal)
3534 (grow_mini_window, shrink_mini_window)
3535 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 3536
c7e73be5
JD
35372011-06-26 Jan Djärv <jan.h.d@swipnet.se>
3538
3539 * emacsgtkfixed.h: State that this is only used with Gtk+3.
3540 (emacs_fixed_set_min_size): Remove.
3541 (emacs_fixed_new): Take frame as argument.
3542
3543 * emacsgtkfixed.c: State that this is only used with Gtk+3.
3544 (_EmacsFixedPrivate): Remove minwidth/height.
3545 Add struct frame *f.
3546 (emacs_fixed_init): Initialize priv->f.
3547 (get_parent_class, emacs_fixed_set_min_size): Remove.
3548 (emacs_fixed_new): Set priv->f to argument.
3549 (emacs_fixed_get_preferred_width)
3550 (emacs_fixed_get_preferred_height): Use min_width/height from
3551 frames size_hint to set minimum and natural (Bug#8919).
3552 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
3553 and use min_width/height from frames size_hint to set
3554 min_width/height (Bug#8919).
3555
3556 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
3557 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
3558 Fix indentation.
c7e73be5 3559
cf99dcf8
EZ
35602011-06-26 Eli Zaretskii <eliz@gnu.org>
3561
3562 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
3563 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
3564 called at ZV.
3565
029529ac
CY
35662011-06-26 Chong Yidong <cyd@stupidchicken.com>
3567
3568 * process.c (wait_reading_process_output): Bypass select if
3569 waiting for a cell while ignoring keyboard input, and input is
3570 pending. Suggested by Jan Djärv (Bug#8869).
3571
7a7ef429
PE
35722011-06-25 Paul Eggert <eggert@cs.ucla.edu>
3573
3574 Use gnulib's dup2 module instead of rolling our own.
3575 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
3576
11fdef7d 35772011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
3578
3579 * dispnew.c (scrolling_window): Before scrolling, turn off a
3580 mouse-highlight in the window being scrolled.
3581
cd3520a4
JB
35822011-06-24 Juanma Barranquero <lekktu@gmail.com>
3583
3584 Move DEFSYM to lisp.h and use everywhere.
3585
3586 * character.h (DEFSYM): Move declaration...
3587 * lisp.h (DEFSYM): ...here.
3588
3589 * gnutls.c:
3590 * minibuf.c:
3591 * w32menu.c:
3592 * w32proc.c:
3593 * w32select.c: Don't include character.h.
3594
3595 * alloc.c (syms_of_alloc):
3596 * buffer.c (syms_of_buffer):
3597 * bytecode.c (syms_of_bytecode):
3598 * callint.c (syms_of_callint):
3599 * casefiddle.c (syms_of_casefiddle):
3600 * casetab.c (init_casetab_once):
3601 * category.c (init_category_once, syms_of_category):
3602 * ccl.c (syms_of_ccl):
3603 * cmds.c (syms_of_cmds):
3604 * composite.c (syms_of_composite):
3605 * dbusbind.c (syms_of_dbusbind):
3606 * dired.c (syms_of_dired):
3607 * dispnew.c (syms_of_display):
3608 * doc.c (syms_of_doc):
3609 * editfns.c (syms_of_editfns):
3610 * emacs.c (syms_of_emacs):
3611 * eval.c (syms_of_eval):
3612 * fileio.c (syms_of_fileio):
3613 * fns.c (syms_of_fns):
3614 * frame.c (syms_of_frame):
3615 * fringe.c (syms_of_fringe):
3616 * insdel.c (syms_of_insdel):
3617 * keymap.c (syms_of_keymap):
3618 * lread.c (init_obarray, syms_of_lread):
3619 * macros.c (syms_of_macros):
3620 * msdos.c (syms_of_msdos):
3621 * print.c (syms_of_print):
3622 * process.c (syms_of_process):
3623 * search.c (syms_of_search):
3624 * sound.c (syms_of_sound):
3625 * syntax.c (init_syntax_once, syms_of_syntax):
3626 * terminal.c (syms_of_terminal):
3627 * textprop.c (syms_of_textprop):
3628 * undo.c (syms_of_undo):
3629 * w32.c (globals_of_w32):
3630 * window.c (syms_of_window):
3631 * xdisp.c (syms_of_xdisp):
3632 * xfaces.c (syms_of_xfaces):
3633 * xfns.c (syms_of_xfns):
3634 * xmenu.c (syms_of_xmenu):
3635 * xsettings.c (syms_of_xsettings):
3636 * xterm.c (syms_of_xterm): Use DEFSYM.
3637
4228cf16
TZ
36382011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
3639
cd3520a4 3640 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 3641
7fcccf1e
PE
36422011-06-23 Paul Eggert <eggert@cs.ucla.edu>
3643
7efb4e0e
PE
3644 Integer and buffer overflow fixes (Bug#8873).
3645
ff5844ad
PE
3646 * print.c (printchar, strout): Check for string overflow.
3647 (PRINTPREPARE, printchar, strout):
3648 Don't set size unless allocation succeeds.
3649
90532f02
PE
3650 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
3651 for sizes. Check for string overflow more accurately.
3652 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
3653
6d84508d
PE
3654 * macros.c: Integer and buffer overflow fixes.
3655 * keyboard.h (struct keyboard.kbd_macro_bufsize):
3656 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
3657 Use ptrdiff_t, not int, for sizes.
3658 Don't increment bufsize until after realloc succeeds.
3659 Check for size-calculation overflow.
3660 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
3661
437b2cb4
PE
3662 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
3663
8b9ac8b4
PE
3664 * lread.c: Integer overflow fixes.
3665 (read_integer): Radix is now EMACS_INT, not int,
3666 to improve quality of diagnostics for out-of-range radices.
3667 Calculate buffer size correctly for out-of-range radices.
3668 (read1): Check for integer overflow in radices, and in
3669 read-circle numbers.
82cb60d3
PE
3670 (read_escape): Avoid int overflow.
3671 (Fload, openp, read_buffer_size, read1)
3672 (substitute_object_recurse, read_vector, read_list, map_obarray):
3673 Use ptrdiff_t, not int, for sizes.
3674 (read1): Use EMACS_INT, not int, for sizes.
20270765 3675 Check for size overflow.
8b9ac8b4 3676
7fcccf1e
PE
3677 * image.c (cache_image): Check for size arithmetic overflow.
3678
bfbbd7e7
PE
3679 * lread.c: Integer overflow issues.
3680 (saved_doc_string_size, saved_doc_string_length)
3681 (prev_saved_doc_string_size, prev_saved_doc_string_length):
3682 Now ptrdiff_t, not int.
3683 (read1): Don't assume doc string length fits in int. Check for
3684 out-of-range doc string lengths.
3685 (read_list): Don't assume file position fits in int.
39019e54 3686 (read_escape): Check for hex character overflow.
bfbbd7e7 3687
4e323265
LL
36882011-06-22 Leo Liu <sdl.web@gmail.com>
3689
3690 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
3691 Move to minibuffer.el.
3692
85fece3e
PE
36932011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3694
20b84ce9 3695 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
3696 The following patches are for when GLYPH_DEBUG && !XASSERT.
3697 * dispextern.h (trace_redisplay_p, dump_glyph_string):
3698 * dispnew.c (flush_stdout):
3699 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
3700 Mark as externally visible.
3701 * dispnew.c (check_window_matrix_pointers): Now static.
3702 * dispnew.c (window_to_frame_vpos):
3703 * xfns.c (unwind_create_frame):
3704 * xterm.c (x_check_font): Remove unused local.
3705 * scroll.c (CHECK_BOUNDS):
3706 * xfaces.c (cache_fache): Rename local to avoid shadowing.
3707 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
3708 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
3709 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
3710 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
3711 Now static.
3712 (debug_method_add): Use va_list and vsprintf rather than relying
3713 on undefined behavior with wrong number of arguments.
3714 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
3715 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
3716 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
3717 since we're not interested in debugging glyphs with old libraries.
3718 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
3719 GCC 4.6.0's static checking.
3720
0766b489
PE
37212011-06-22 Paul Eggert <eggert@cs.ucla.edu>
3722
31fd4b32
PE
3723 Integer overflow and signedness fixes (Bug#8873).
3724 A few related buffer overrun fixes, too.
3725
b79e8648
PE
3726 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
3727
0766b489
PE
3728 * dispextern.h (struct face.stipple):
3729 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
3730 (x_bitmap_mask, x_allocate_bitmap_record)
3731 (x_create_bitmap_from_data, x_create_bitmap_from_file)
3732 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
3733 (x_create_bitmap_from_xpm_data):
3734 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
3735 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
3736 (.bitmaps_last):
3737 * xfaces.c (load_pixmap):
3738 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
3739 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
3740 (.bitmaps_last, struct x_output.icon_bitmap):
3741 Use ptrdiff_t, not int, for bitmap indexes.
3742 (x_allocate_bitmap_record): Check for size overflow.
3743 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
3744
b081724f
PE
3745 Use ptrdiff_t, not int, for overlay counts.
3746 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
3747 * editfns.c (overlays_around, get_pos_property):
3748 * textprop.c (get_char_property_and_overlay):
3749 * xdisp.c (next_overlay_change, note_mouse_highlight):
3750 * xfaces.c (face_at_buffer_position):
21514da7
PE
3751 * buffer.c (OVERLAY_COUNT_MAX): New macro.
3752 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
3753 (Fnext_overlay_change, Fprevious_overlay_change)
3754 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 3755 Use ptrdiff_t, not int, for sizes.
21514da7 3756 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 3757
3de73e5e
PE
3758 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
3759
2606c57b
PE
3760 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
3761 (x_session_initialize): Do not assume string length fits in int.
3762
aaafe47a
PE
3763 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
3764 This is unlikely, but can occur if DPI is outlandish.
3765
2674ddc8 3766 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
3767 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
3768
28154962
PE
3769 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
3770 * xrdb.c (magic_file_p, search_magic_path):
3771 Omit last arg SUFFIX; it was always 0. All callers changed.
3772 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
3773
7de51af5
PE
3774 * xfont.c (xfont_match): Avoid need for strlen.
3775
25ed6cc3
PE
3776 * xfns.c: Don't assume strlen fits in int.
3777 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
3778
4eab31dd
PE
3779 * xdisp.c (message_log_check_duplicate): Return intmax_t,
3780 not unsigned long, as we prefer signed integers. All callers changed.
3781 Detect integer overflow in repeat count.
3782 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 3783 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 3784
171e2a58
PE
3785 * termcap.c: Don't assume sizes fit in int and never overflow.
3786 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
3787 (gobble_line): Check for size-calculation overflow.
3788
ad39faca 3789 * minibuf.c (Fread_buffer):
6e5bb2dc 3790 * lread.c (intern, intern_c_string):
74ca2eb3
PE
3791 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
3792 Don't assume string length fits in int.
3793
52c61c22 3794 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
3795 * gtkutil.c (style_changed_cb): Avoid need for strlen.
3796
b5b8c9e5
PE
3797 * font.c: Don't assume string length fits in int.
3798 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
3799 Use ptrdiff_t, not int.
ccd6111c
PE
3800 (font_intern_prop): Don't assume string length fits in int.
3801 Don't assume integer property fits in fixnum.
3802 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 3803
882f0d81 3804 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 3805 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
3806 Reformulate so as not to need the command string.
3807 Invoke gzip -cd rather than gunzip, as it's more portable.
3808 (lock_info_type, lock_file_1, lock_file):
3809 Don't assume pid_t and time_t fit in unsigned long.
3810 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
3811 (current_lock_owner): Prefer signed type for sizes.
3812 Use memcpy, not strncpy, where memcpy is what is really wanted.
3813 Don't assume (via atoi) that time_t and pid_t fit in int.
3814 Check for time_t and/or pid_t out of range, e.g., via a network share.
3815 Don't alloca where an auto var works fine.
3816
93f4cf88
PE
3817 * fileio.c: Fix some integer overflow issues.
3818 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
3819 Don't assume string length fits in int.
3820 (directory_file_name): Don't assume string length fits in long.
3821 (make_temp_name): Don't assume pid fits in int, or that its print
3822 length is less than 20.
3823
f3e92b69
PE
3824 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
3825
1bfdaf10
PE
3826 * coding.c (make_subsidiaries): Don't assume string length fits in int.
3827
35016e9a
PE
3828 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
3829
3d1e65a1
PE
3830 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
3831 We prefer signed integers, even for size calculations.
3832
0b963a93
PE
3833 * emacs.c: Don't assume string length fits in 'int'.
3834 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
3835 (main): Don't invoke strlen when not needed.
3836
573f4b54
PE
3837 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
3838 (XD_DEBUG_MESSAGE): Don't waste a byte.
3839
989f33ba
PE
3840 * callproc.c (getenv_internal_1, getenv_internal)
3841 (Fgetenv_internal):
965d34eb
PE
3842 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
3843
e4d29b33
PE
3844 * lread.c (invalid_syntax): Omit length argument.
3845 All uses changed. This doesn't fix a bug, but it simplifies the
3846 code away from its former Hollerith-constant appearance, and it's
3847 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 3848 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 3849
eb49b136
PE
3850 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
3851 This didn't break anything, but it didn't help either.
3852 It's confusing to put a bogus integer in a place where the actual
3853 value does not matter.
9f62aeb1 3854 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 3855 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 3856
15375a22
PE
3857 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
3858 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
3859 implementation.
b61cc01c
PE
3860 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
3861 We prefer signed types, and the value cannot exceed the EMACS_INT
3862 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
3863 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
3864 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
3865 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 3866
53b2623d
PE
3867 * indent.c (sane_tab_width): New function.
3868 (current_column, scan_for_column, Findent_to, position_indentation)
3869 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 3870 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 3871
51cab52b 3872 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 3873
f2ed8a70
PE
3874 * lisp.h (lint_assume): New macro.
3875 * composite.c (composition_gstring_put_cache):
3876 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
3877
abe80cc6
PE
3878 * editfns.c, insdel.c:
3879 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 3880
b02c740e
PE
3881 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
3882
ebc96716
PE
3883 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
3884
b4e50fa0 3885 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 3886 Use much-faster test for byte-length change.
311d5d7c 3887 Don't assume string byte-length fits in 'int'.
a4cf38e4 3888 Check that character arg fits in 'int'.
85461888 3889 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 3890
c0c1ee9f
PE
3891 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
3892
a498d7f4
PE
3893 * fns.c (concat): Catch string overflow earlier.
3894 Do not rely on integer wraparound.
3895
51cab52b
PE
3896 * dispextern.h (struct it.overlay_strings_charpos)
3897 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
3898 * xdisp.c (forward_to_next_line_start)
3899 (back_to_previous_visible_line_start)
3900 (reseat_at_next_visible_line_start, next_element_from_buffer):
3901 Don't arbitrarily truncate the value of 'selective' to int.
3902
76031fad
PE
3903 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
3904
5eb55db9
PE
3905 * composite.c: Don't truncate sizes to 'int'.
3906 (composition_gstring_p, composition_reseat_it)
3907 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
3908 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
3909 not EMACS_UINT, for indexes.
5eb55db9 3910
0703a717
PE
3911 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
3912
d6202519
PE
3913 * buffer.c: Include <verify.h>.
3914 (struct sortvec.priority, struct sortstr.priority):
8961a454 3915 Now EMACS_INT, not int.
c20998a7 3916 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
3917 (struct sortstr.size, record_overlay_string)
3918 (struct sortstrlist.size, struct sortlist.used):
3919 Don't truncate size to int.
3920 (record_overlay_string): Check for size-calculation overflow.
d6202519 3921 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 3922
d5a19415
JM
39232011-06-22 Jim Meyering <meyering@redhat.com>
3924
029529ac 3925 Don't leak an XBM-image-sized buffer
d5a19415
JM
3926 * image.c (xbm_load): Free the image buffer after using it.
3927
a9041e6c
PE
39282011-06-21 Paul Eggert <eggert@cs.ucla.edu>
3929
3930 Port to Sun C.
3931 * composite.c (find_automatic_composition): Omit needless 'return 0;'
3932 that Sun C diagnosed.
3933 * fns.c (secure_hash): Fix pointer signedness issue.
3934 * intervals.c (static_offset_intervals): New function.
3935 (offset_intervals): Use it.
3936
7f3f739f
LL
39372011-06-21 Leo Liu <sdl.web@gmail.com>
3938
3939 * deps.mk (fns.o):
3940 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
3941 sha512.h.
3942
3943 * fns.c (secure_hash): Rename from crypto_hash_function and change
3944 the first arg to accept symbols.
5b66d427 3945 (Fsecure_hash): New primitive.
7f3f739f
LL
3946 (syms_of_fns): New symbols.
3947
76147d94
DD
39482011-06-20 Deniz Dogan <deniz@dogan.se>
3949
3950 * process.c (Fset_process_buffer): Clarify return value in
3951 docstring.
3952
7d7d0045
CY
39532011-06-18 Chong Yidong <cyd@stupidchicken.com>
3954
3955 * dispnew.c (add_window_display_history): Use BVAR.
3956
3957 * xdisp.c (debug_method_add): Use BVAR.
3958 (check_window_end, dump_glyph_matrix, dump_glyph)
3959 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
3960
3961 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
3962 Likewise.
3963
3964 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
3965 check till after the cache is created in init_frame_faces.
3966
ff2bc410
SM
39672011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
3968
3969 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
3970
28177add
PE
39712011-06-16 Paul Eggert <eggert@cs.ucla.edu>
3972
dd3482fe
PE
3973 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
3974 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
3975 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
3976
393d71f3 3977 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
3978 * fileio.c (Finsert_file_contents):
3979 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
3980 Remove the old (too-loose) buffer overflow checks.
3981 They weren't needed, since make_gap checks for buffer overflow.
3982 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
3983 The old code merely checked for Emacs fixnum overflow, and relied
3984 on undefined (wraparound) behavior. The new code avoids undefined
3985 behavior, and also checks for ptrdiff_t and/or size_t overflow.
3986
2e6813b0 3987 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
3988 Tune. Don't use wider integers than needed. Don't use alloca.
3989 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 3990
599a9e4f
PE
3991 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
3992
99561444
PE
3993 * insdel.c, lisp.h (buffer_overflow): New function.
3994 (insert_from_buffer_1, replace_range, replace_range_2):
3995 * insdel.c (make_gap_larger):
3996 * editfns.c (Finsert_char):
3997 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
3998
28177add
PE
3999 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
4000
e69dafad
PE
40012011-06-15 Paul Eggert <eggert@cs.ucla.edu>
4002
a7af7fde 4003 Integer overflow and signedness fixes (Bug#8873).
ff672d2c 4004
b1c46f02
PE
4005 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
4006 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
4007
e69dafad
PE
4008 * fileio.c: Don't assume EMACS_INT fits in off_t.
4009 (emacs_lseek): New static function.
4010 (Finsert_file_contents, Fwrite_region): Use it.
4011 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
4012
566684ea
PE
4013 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
4014
e6966cd6
PE
4015 * fns.c: Don't overflow int when computing a list length.
4016 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
4017 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
4018 truncation on 64-bit hosts. Check for QUIT every
4019 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
4020 faster and is responsive enough.
4021 (Flength): Report an error instead of overflowing an integer.
4022 (Fsafe_length): Return a float if the value is not representable
4023 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 4024 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 4025 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 4026
dd0b0efb
PE
4027 * alloc.c: Check that resized vectors' lengths fit in fixnums.
4028 (header_size, word_size): New constants.
4029 (allocate_vectorlike): Don't check size overflow here.
4030 (allocate_vector): Check it here instead, since this is the only
4031 caller of allocate_vectorlike that could cause overflow.
4032 Check that the new vector's length is representable as a fixnum.
4033
86fe5cfe
PE
4034 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
4035 The previous code was bogus. For example, next_almost_prime (32)
4036 returned 39, which is undesirable as it is a multiple of 3; and
4037 next_almost_prime (24) returned 25, which is a multiple of 5 so
4038 why was the code bothering to check for multiples of 7?
4039
80e88859
PE
4040 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
4041
4a2f0ad6
PE
4042 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
4043
f66c7cf8
PE
4044 Variadic C functions now count arguments with ptrdiff_t.
4045 This partly undoes my 2011-03-30 change, which replaced int with size_t.
4046 Back then I didn't know that the Emacs coding style prefers signed int.
4047 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
4048 were being counted with int, which may truncate counts on 64-bit
4049 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
4050 * lisp.h (struct Lisp_Subr.function.aMANY)
4051 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
4052 Arg counts are now ptrdiff_t, not size_t.
4053 All variadic functions and their callers changed accordingly.
4054 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
4055 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
4056 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
4057 * callint.c (Fcall_interactively): Check arg count for overflow,
4058 to avoid potential buffer overrun. Use signed char, not 'int',
4059 for 'varies' array, so that we needn't bother to check its size
4060 calculation for overflow.
4061 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
4062 * eval.c (apply_lambda):
4063 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
4064 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
4065 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
4066
a1759b76
PE
4067 * callint.c (Fcall_interactively): Don't use index var as event count.
4068
d96be9fc
PE
4069 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
4070 * mem-limits.h (SIZE): Remove; no longer used.
4071
a690a978 4072 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 4073
578c21e6
PE
4074 Remove unnecessary casts.
4075 * xterm.c (x_term_init):
4076 * xfns.c (x_set_border_pixel):
4077 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
4078 These aren't needed now that we assume ANSI C.
4079
96f53c6c
PE
4080 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
4081 It's more likely to cause problems (due to unsigned overflow)
4082 than to cure them.
4083
83c77d31
PE
4084 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
4085
ee2079f1
PE
4086 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
4087
6da65536
PE
4088 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
4089
7147c4a4
PE
4090 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
4091
193e32d9
PE
4092 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
4093
e5533da6
PE
4094 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
4095
9910e595
PE
4096 GLYPH_CODE_FACE returns EMACS_INT, not int.
4097 * dispextern.h (merge_faces):
4098 * xfaces.c (merge_faces):
01103c44
PE
4099 * xdisp.c (get_next_display_element, next_element_from_display_vector):
4100 Don't assume EMACS_INT fits in int.
9910e595 4101
2638320e
PE
4102 * character.h (CHAR_VALID_P): Remove unused parameter.
4103 * fontset.c, lisp.h, xdisp.c: All uses changed.
4104
045eb8d9
PE
4105 * editfns.c (Ftranslate_region_internal): Omit redundant test.
4106
c1f134b5
PE
4107 * fns.c (concat): Minor tuning based on overflow analysis.
4108 This doesn't fix any bugs. Use int to hold character, instead
4109 of constantly refetching from Emacs object. Use XFASTINT, not
4110 XINT, for value known to be a character. Don't bother comparing
4111 a single byte to 0400, as it's always less.
4112
395fcb93 4113 * floatfns.c (Fexpt):
327eeec8
PE
4114 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
4115
abbd3d23
PE
4116 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
4117 for characters.
4118
684a03ef
PE
4119 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
4120
0fed43f3
PE
4121 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
4122 Without this fix, on a 64-bit host (aset S 0 4294967386) would
4123 incorrectly succeed when S was a string, because 4294967386 was
4124 truncated before it was used.
4125
8fd02eb7
PE
4126 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
4127 Otherwise, an out-of-range integer could cause undefined behavior
4128 on a 64-bit host.
4129
f8c86b69
PE
4130 * composite.c: Use int, not EMACS_INT, for characters.
4131 (fill_gstring_body, composition_compute_stop_pos): Use int, not
4132 EMACS_INT, for values that are known to be in character range.
4133 This doesn't fix any bugs but is the usual style inside Emacs and
4134 may generate better code on 32-bit machines.
4135
34206dd2
PE
4136 Make sure a 64-bit char is never passed to ENCODE_CHAR.
4137 This is for reasons similar to the recent CHAR_STRING fix.
4138 * charset.c (Fencode_char): Check that character arg is actually
4139 a character. Pass an int to ENCODE_CHAR.
4140 * charset.h (ENCODE_CHAR): Verify that the character argument is no
4141 wider than 'int', as a compile-time check to prevent future regressions
4142 in this area.
4143
c5958d4c 4144 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
4145
4146 Make sure a 64-bit char is never passed to CHAR_STRING.
4147 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
4148 by silently ignoring the top 32 bits, allowing some values
4149 that were far too large to be valid characters.
4150 * character.h: Include <verify.h>.
4151 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
4152 arguments are no wider than unsigned, as a compile-time check
4153 to prevent future regressions in this area.
4154 * data.c (Faset):
01103c44 4155 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
4156 (Fsubst_char_in_region):
4157 * fns.c (concat):
4158 * xdisp.c (decode_mode_spec_coding):
4159 Adjust to CHAR_STRING's new requirement.
4160 * editfns.c (Finsert_char, Fsubst_char_in_region):
4161 * fns.c (concat): Check that character args are actually
4162 characters. Without this test, these functions did the wrong
4163 thing with wildly out-of-range values on 64-bit hosts.
4164
d37ca623
PE
4165 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
4166 These casts should not be needed on 32-bit hosts, either.
4167 * keyboard.c (read_char):
4168 * lread.c (Fload): Remove casts to unsigned.
4169
ea204efb
PE
4170 * lisp.h (UNSIGNED_CMP): New macro.
4171 This fixes comparison bugs on 64-bit hosts.
4172 (ASCII_CHAR_P): Use it.
4173 * casefiddle.c (casify_object):
01103c44 4174 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
4175 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
4176 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
4177 * dispextern.h (FACE_FROM_ID):
4178 * keyboard.c (read_char): Use UNSIGNED_CMP.
4179
41cb286c
PE
4180 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
4181 not to EMACS_INT, to avoid GCC warning.
4182
4a1b9832
PE
4183 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
4184
55daad71
PE
4185 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
4186 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
4187 isn't needed on 32-bit machines.
8f95c75c 4188
01103c44
PE
4189 * buffer.c (Fgenerate_new_buffer_name):
4190 Use EMACS_INT for count, not int.
0ceccced 4191 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
4192
4193 * data.c (Qcompiled_function): Now static.
4194
c6f072e7
PE
4195 * window.c (window_body_lines): Now static.
4196
20ce5912
PE
4197 * image.c (gif_load): Rename local to avoid shadowing.
4198
9c4c5f81
PE
4199 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
4200 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
4201 * alloc.c (make_save_value): Integer argument is now of type
4202 ptrdiff_t, not int.
4203 (mark_object): Use ptrdiff_t, not int.
4204 * lisp.h (pD): New macro.
4205 * print.c (print_object): Use it.
4206
c0c5c8ae
PE
4207 * alloc.c: Use EMACS_INT, not int, to count objects.
4208 (total_conses, total_markers, total_symbols, total_vector_size)
4209 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
4210 (total_free_floats, total_floats, total_free_intervals)
4211 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
4212 Now EMACS_INT, not int. All uses changed.
4213 (Fgarbage_collect): Compute overall total using a double, so that
4214 integer overflow is less likely to be a problem. Check for overflow
4215 when converting back to an integer.
5a25e253
PE
4216 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
4217 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
4218 These were 'int' variables that could overflow on 64-bit hosts;
4219 they were never used, so remove them instead of repairing them.
211a0b2a 4220 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
4221 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
4222 Previously, this ceilinged at INT_MAX, but that doesn't work on
4223 64-bit machines.
e46bb31a 4224 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 4225
c78baabf 4226 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 4227 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
4228 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
4229 when a (possibly-narrower) signed value would do just as well.
4230 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 4231
c9d624c6
PE
4232 * alloc.c: Catch some string size overflows that we were missing.
4233 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
4234 for convenience in STRING_BYTES_MAX.
4235 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
4236 The definition here is exact; the one in lisp.h was approximate.
4237 (allocate_string_data): Check for string overflow. This catches
4238 some instances we weren't catching before. Also, it catches
4239 size_t overflow on (unusual) hosts where SIZE_MAX <= min
4240 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
4241 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 4242
c9d624c6
PE
4243 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
4244 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 4245 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 4246
353032ce
PE
4247 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
4248
2bccce07
PE
4249 * alloc.c (Fmake_string): Check for out-of-range init.
4250
0ac30604
SM
42512011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
4252
4253 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
4254
c195f2de
JD
42552011-06-14 Jan Djärv <jan.h.d@swipnet.se>
4256
4257 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
4258 xg_get_default_scrollbar_width.
4259
4260 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
4261 (int_gtk_range_get_value): Move to the scroll bar part of the file.
4262 (style_changed_cb): Call update_theme_scrollbar_width and call
4263 x_set_scroll_bar_default_width and xg_frame_set_char_size for
4264 all frames (Bug#8505).
4265 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
4266 Call gtk_window_set_resizable if HAVE_GTK3.
4267 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
4268 and height if HAVE_GTK3 (Bug#8505).
4269 (scroll_bar_width_for_theme): New variable.
4270 (update_theme_scrollbar_width): New function.
4271 (xg_get_default_scrollbar_width): Move code to
4272 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
4273 (xg_initialize): Call update_theme_scrollbar_width.
4274
4275 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
4276
4277 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
4278
e10ac9f1
MR
42792011-06-12 Martin Rudalics <rudalics@gmx.at>
4280
4281 * frame.c (make_frame): Call other_buffer_safely instead of
4282 other_buffer.
4283
4284 * window.c (temp_output_buffer_show): Call display_buffer with
4285 second argument Vtemp_buffer_show_specifiers and reset latter
4286 immediately after the call.
4287 (Vtemp_buffer_show_specifiers): New variable.
4288 (auto_window_vscroll_p, next_screen_context_lines)
4289 (Vscroll_preserve_screen_position): Remove leading asterisks from
4290 doc-strings.
4291
2d3c217e 42922011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 4293
7b7f97e8 4294 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
4295 * buffer.c (Qclone_number): Remove for now, as it's unused.
4296 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
4297 (record_buffer): Remove unused local.
4298 * frame.c (other_visible_frames, frame_buffer_list): Now static.
4299 (set_frame_buffer_list): Remove; unused.
4300 * frame.h (other_visible_frames): Remove decl.
4301 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
4302 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
4303 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
4304 if HAVE_GPM.
4305 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
4306 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
4307 Define only if HAVE_GPM.
4308 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
4309 (update_hints_inhibit): Remove; never set. All uses removed.
4310 * widgetprv.h (emacsFrameClassRec): Remove decl.
4311 * window.c (delete_deletable_window): Now returns void, since it
4312 wasn't returning anything.
4313 (compare_window_configurations): Remove unused locals.
4314 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
4315 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
4316 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
4317 the same widths as pointers. This follows up on the 2011-05-06 patch.
4318 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
4319 * xterm.h: Likewise.
4320 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
4321
1384b89e
JB
43222011-06-12 Juanma Barranquero <lekktu@gmail.com>
4323
4324 * makefile.w32-in: Update dependencies.
4325 (LISP_H): Add lib/intprops.h.
4326
1100a63c
CY
43272011-06-11 Chong Yidong <cyd@stupidchicken.com>
4328
4329 * image.c (gif_load): Add animation frame delay to the metadata.
4330 (syms_of_image): Use DEFSYM. New symbol `delay'.
4331
6198ccd0
MR
43322011-06-11 Martin Rudalics <rudalics@gmx.at>
4333
4334 * window.c (delete_deletable_window): Re-add.
4335 (Fset_window_configuration): Rewrite to handle dead buffers and
4336 consequently deletable windows.
4337 (window_tree, Fwindow_tree): Remove. Supply functionality in
4338 window.el.
4339 (compare_window_configurations): Simplify code.
4340
b6e3633c
AS
43412011-06-11 Andreas Schwab <schwab@linux-m68k.org>
4342
1ab0dee5
AS
4343 * image.c (imagemagick_load_image): Fix type mismatch.
4344 (Fimagemagick_types): Likewise.
4345
b6e3633c
AS
4346 * window.h (replace_buffer_in_windows): Declare.
4347
9397e56f
MR
43482011-06-11 Martin Rudalics <rudalics@gmx.at>
4349
4350 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
4351 Qclone_number. Remove external declaration of Qdelete_window.
4352 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
4353 code.
640c8776
SM
4354 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
4355 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
4356 (Fother_buffer): Rewrite doc-string. Major rewrite for new
4357 buffer list implementation.
4358 (other_buffer_safely): New function.
4359 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
4360 calls to replace_buffer_in_windows and
4361 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
4362 if allowed.
4363 (record_buffer): Inhibit quitting and rewrite using quittable
4364 functions. Run Qbuffer_list_update_hook if allowed.
4365 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
4366 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
4367 Move switch-to-buffer to window.el.
9397e56f
MR
4368 (bury-buffer): Move to window.el.
4369 (Vbuffer_list_update_hook): New variable.
4370
4371 * lisp.h (other_buffer_safely): Add prototype in buffer.c
4372 section.
4373
4374 * window.h (resize_frame_windows): Move up in code.
4375 (Fwindow_frame): Remove EXFUN.
4376 (replace_buffer_in_all_windows): Remove prototype.
4377 (replace_buffer_in_windows_safely): Add prototype.
4378
4379 * window.c: Declare Qdelete_window static again. Move down
4380 declaration of select_count.
4381 (Fnext_window, Fprevious_window): Rewrite doc-strings.
4382 (Fother_window): Move to window.el.
4383 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
4384 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
4385 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
4386 window.el.
4387 (replace_buffer_in_windows): Implement by calling
4388 Qreplace_buffer_in_windows.
4389 (replace_buffer_in_all_windows): Remove with some functionality
4390 moved into replace_buffer_in_windows_safely.
4391 (replace_buffer_in_windows_safely): New function.
4392 (select_window_norecord, select_frame_norecord): Move in front
4393 of run_window_configuration_change_hook. Remove now obsolete
4394 declarations.
640c8776
SM
4395 (Fset_window_buffer): Rewrite doc-string.
4396 Call Qrecord_window_buffer.
9397e56f
MR
4397 (keys_of_window): Move binding for other-window to window.el.
4398
b50691aa
CY
43992011-06-11 Chong Yidong <cyd@stupidchicken.com>
4400
4401 * dispextern.h (struct image): Replace data member, whose int_val
4402 and ptr_val fields were not used by anything, with a single
4403 lisp_val object.
4404
4405 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
4406 (gif_clear_image, gif_load, imagemagick_load_image)
4407 (gs_clear_image, gs_load): Callers changed.
4408
3f754b86
PE
44092011-06-10 Paul Eggert <eggert@cs.ucla.edu>
4410
cca69397
PE
4411 * buffer.h: Include <time.h>, for time_t.
4412 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
4413
109e28d0
PE
4414 Fix minor problems found by static checking.
4415
60737f02
PE
4416 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
4417
4b66faf3
PE
4418 Make identifiers static if they are not used in other modules.
4419 * data.c (Qcompiled_function, Qframe, Qvector):
4420 * image.c (QimageMagick, Qsvg):
4421 * minibuf.c (Qmetadata):
4422 * window.c (resize_window_check, resize_root_window): Now static.
4423 * window.h (resize_window_check, resize_root_window): Remove decls.
4424
109e28d0
PE
4425 * window.c (window_deletion_count, delete_deletable_window):
4426 Remove; unused.
46a4ce9e
PE
4427 (window_body_lines): Now static.
4428 (Fdelete_other_windows_internal): Mark vars as initialized.
4429 Make sure 'resize_failed' is initialized.
4430 (run_window_configuration_change_hook): Rename local to avoid shadowing.
4431 (resize_window_apply): Remove unused local.
4432 * window.h (delete_deletable_window): Remove decl.
4433
109e28d0 4434 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
4435 (imagemagick_load_image): Fix pointer signedness problem by changing
4436 last arg from unsigned char * to char *. All uses changed.
4437 Also, fix a local for similar reasons.
4438 Remove unused locals. Remove locals to avoid shadowing.
4439 (fn_rsvg_handle_free): Remove; unused.
4440 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 4441 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 4442
3f754b86
PE
4443 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
4444
2547adb1
CY
44452011-06-10 Chong Yidong <cyd@stupidchicken.com>
4446
4447 * image.c (gif_load): Fix omitted cast error introduced by
4448 2011-06-06 change.
4449
2c8e37d4
MR
44502011-06-10 Martin Rudalics <rudalics@gmx.at>
4451
4452 * window.h (resize_proportionally, orig_total_lines)
4453 (orig_top_line): Remove from window structure.
4454 (set_window_height, set_window_width, change_window_heights)
4455 (Fdelete_window): Remove prototypes.
4456 (resize_frame_windows): Remove duplicate declaration.
4457
440a42e3
EZ
44582011-06-10 Eli Zaretskii <eliz@gnu.org>
4459
4460 * window.h (resize_frame_windows, resize_window_check)
4461 (delete_deletable_window, resize_root_window)
4462 (resize_frame_windows): Declare prototypes.
4463
4464 * window.c (resize_window_apply): Make definition be "static" to
4465 match the prototype.
4466
562dd5e9
MR
44672011-06-10 Martin Rudalics <rudalics@gmx.at>
4468
4469 * window.c: Remove declarations of Qwindow_size_fixed,
4470 window_min_size_1, window_min_size_2, window_min_size,
4471 size_window, window_fixed_size_p, enlarge_window, delete_window.
4472 Remove static from declaration of Qdelete_window, it's
4473 temporarily needed by Fbury_buffer.
4474 (replace_window): Don't assign orig_top_line and
4475 orig_total_lines.
4476 (Fdelete_window, delete_window): Remove. Window deletion is
4477 handled by window.el.
640c8776
SM
4478 (window_loop): Remove DELETE_OTHER_WINDOWS case.
4479 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
4480 (Fdelete_other_windows): Remove. Deleting other windows is
4481 handled by window.el.
4482 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
4483 handled in window.el.
4484 (window_min_size_2, window_min_size_1, window_min_size): Remove.
4485 Window minimum sizes are handled in window.el.
4486 (shrink_windows, size_window, set_window_height)
4487 (set_window_width, change_window_heights, window_height)
4488 (window_width, CURBEG, CURSIZE, enlarge_window)
4489 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
4490 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
4491 handled in window.el.
4492 (make_dummy_parent): Rename to make_parent_window and give it a
4493 second argument horflag.
4494 (make_window): Don't set resize_proportionally any more.
4495 (Fsplit_window): Remove. Windows are split in window.el.
4496 (save_restore_action, save_restore_orig_size)
4497 (shrink_window_lowest_first, save_restore_orig_size): Remove.
4498 Resize mini windows in window.el.
4499 (grow_mini_window, shrink_mini_window): Implement by calling
4500 Qresize_root_window_vertically, resize_window_check and
4501 resize_window_apply.
640c8776
SM
4502 (saved_window, Fset_window_configuration, save_window_save):
4503 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
4504 resize_proportionally.
4505 (window_min_height, window_min_width): Move to window.el.
4506 (keys_of_window): Move bindings for delete-other-windows,
4507 split-window, delete-window and enlarge-window to window.el.
4508
4509 * buffer.c: Temporarily extern Qdelete_window.
4510 (Fbury_buffer): Temporarily call Qdelete_window instead of
4511 Fdelete_window (Fbury_buffer will move to window.el soon).
4512
4513 * frame.c (set_menu_bar_lines_1): Remove code handling
4514 orig_top_line and orig_total_lines.
4515
4516 * dispnew.c (adjust_frame_glyphs_initially): Don't use
4517 set_window_height but set heights directly.
4518 (change_frame_size_1): Use resize_frame_windows.
4519
4520 * xdisp.c (init_xdisp): Don't use set_window_height but set
4521 heights directly.
4522
640c8776
SM
4523 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
4524 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
4525 run_window_configuration_change_hook.
4526
4527 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
4528 instead of change_window_heights and run
4529 run_window_configuration_change_hook.
4530
1a13852e
MR
45312011-06-09 Martin Rudalics <rudalics@gmx.at>
4532
4533 * window.c (replace_window): Rename second argument REPLACEMENT to
4534 NEW. New third argument SETFLAG. Rewrite.
4535 (delete_window, make_dummy_parent): Call replace_window with
4536 third argument 1.
4537 (window_list_1): Move down in code.
4538 (run_window_configuration_change_hook): Move set_buffer part
4539 before select_frame_norecord part in order to unwind correctly.
4540 Rename count1 to count.
4541 (recombine_windows, delete_deletable_window, resize_root_window)
4542 (Fdelete_other_windows_internal)
4543 (Frun_window_configuration_change_hook, make_parent_window)
4544 (resize_window_check, resize_window_apply, Fresize_window_apply)
4545 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
4546 (Fdelete_window_internal, Fresize_mini_window_internal):
4547 New functions.
1a13852e
MR
4548 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
4549
f3d1777e
MR
45502011-06-08 Martin Rudalics <rudalics@gmx.at>
4551
496e208e
MR
4552 * window.h (window): Add some new members to window structure -
4553 normal_lines, normal_cols, new_total, new_normal, clone_number,
4554 splits, nest, prev_buffers, next_buffers.
4555 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 4556 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 4557
f3d1777e
MR
4558 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
4559 Remove.
496e208e
MR
4560 (make_dummy_parent): Set new members of windows structure.
4561 (make_window): Move down in code. Handle new members of window
4562 structure.
4563 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
4564 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
4565 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
4566 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
4567 (Fset_window_next_buffers, Fset_window_clone_number):
4568 New functions.
496e208e
MR
4569 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
4570 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
4571 Doc-string fixes.
4572 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
4573 Argument WINDOW can be now internal window too.
4574 (Fwindow_use_time): Move up in code.
4575 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
4576 Rewrite doc-string.
4577 (Fset_window_configuration, saved_window)
4578 (Fcurrent_window_configuration, save_window_save): Handle new
4579 members of window structure.
b9e809c2
MR
4580 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
4581 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
4582 (syms_of_window): New Lisp objects Qrecord_window_buffer,
4583 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
4584 Qget_mru_window, Qresize_root_window,
4585 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
4586 Qauto_buffer_name; staticpro them.
f3d1777e 4587
abde8f8c
MR
45882011-06-07 Martin Rudalics <rudalics@gmx.at>
4589
4590 * window.c (Fwindow_total_size, Fwindow_left_column)
4591 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
4592 (Fwindow_list_1): New functions.
4593 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
4594 (Fwindow_width, Fscroll_left, Fscroll_right):
4595 Use window_body_cols instead of window_box_text_cols.
4596 (delete_window, Fset_window_configuration):
4597 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
4598 (delete_all_subwindows): Take a window as argument and not a
4599 structure. Rewrite.
190b47e6
MR
4600 (window_loop): Remove handling of GET_LRU_WINDOW and
4601 GET_LARGEST_WINDOW.
4602 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
4603
4604 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
4605 window_box_text_cols. delete_all_subwindows now takes a
4606 Lisp_Object as argument.
abde8f8c 4607
640c8776
SM
4608 * indent.c (compute_motion, Fcompute_motion):
4609 Use window_body_cols instead of window_box_text_cols.
abde8f8c 4610
fa8a67e6
MR
4611 * frame.c (delete_frame): Call delete_all_subwindows with root
4612 window as argument.
4613
a54e3482
DC
46142011-06-07 Daniel Colascione <dan.colascione@gmail.com>
4615
4616 * fns.c (Fputhash): Document return value.
4617
60002bf5
CY
46182011-06-06 Chong Yidong <cyd@stupidchicken.com>
4619
4620 * image.c (gif_load): Implement gif89a spec "no disposal" method.
4621
0c671da6 46222011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 4623
b862a52a 4624 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 4625
be44ca6c
PE
4626 Check for overflow when converting integer to cons and back.
4627 * charset.c (Fdefine_charset_internal, Fdecode_char):
4628 Use cons_to_unsigned to catch overflow.
4629 (Fencode_char): Use INTEGER_TO_CONS.
4630 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
4631 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
4632 * data.c (long_to_cons, cons_to_long): Remove.
4633 (cons_to_unsigned, cons_to_signed): New functions.
4634 These signal an error for invalid or out-of-range values.
4635 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
4636 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
4637 * font.c (Ffont_variation_glyphs):
4638 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
4639 * lisp.h: Include <intprops.h>.
4640 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
4641 (cons_to_signed, cons_to_unsigned): New decls.
4642 (long_to_cons, cons_to_long): Remove decls.
4643 * undo.c (record_first_change): Use INTEGER_TO_CONS.
4644 (Fprimitive_undo): Use CONS_TO_INTEGER.
4645 * xfns.c (Fx_window_property): Likewise.
4646 * xselect.c: Include <limits.h>.
4647 (x_own_selection, selection_data_to_lisp_data):
4648 Use INTEGER_TO_CONS.
4649 (x_handle_selection_request, x_handle_selection_clear)
4650 (x_get_foreign_selection, Fx_disown_selection_internal)
4651 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
4652 (lisp_data_to_selection_data): Use cons_to_unsigned.
4653 (x_fill_property_data): Use cons_to_signed.
4654 Report values out of range.
4655
d1f3d2af
PE
4656 Check for buffer and string overflow more precisely.
4657 * buffer.h (BUF_BYTES_MAX): New macro.
4658 * lisp.h (STRING_BYTES_MAX): New macro.
4659 * alloc.c (Fmake_string):
4660 * character.c (string_escape_byte8):
4661 * coding.c (coding_alloc_by_realloc):
4662 * doprnt.c (doprnt):
4663 * editfns.c (Fformat):
4664 * eval.c (verror):
4665 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
4666 since they may not be the same number.
4667 * editfns.c (Finsert_char):
4668 * fileio.c (Finsert_file_contents):
4669 Likewise for BUF_BYTES_MAX.
4670
dd52fcea
PE
4671 * image.c: Use ptrdiff_t, not int, for sizes.
4672 (slurp_file): Switch from int to ptrdiff_t.
4673 All uses changed.
4674 (slurp_file): Check that file size fits in both size_t (for
4675 malloc) and ptrdiff_t (for sanity and safety).
4676
7f9bbdbb
PE
4677 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
4678 if b->modtime has its maximal value.
4679
dfe18f82
PE
4680 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
4681
84acfcf0
PE
4682 Don't assume time_t can fit into int.
4683 * buffer.h (struct buffer.modtime): Now time_t, not int.
4684 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
4685 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
4686
ccd9a01a
PE
4687 Minor fixes for signed vs unsigned integers.
4688 * character.h (MAYBE_UNIFY_CHAR):
4689 * charset.c (maybe_unify_char):
4690 * keyboard.c (read_char, reorder_modifiers):
4691 XINT -> XFASTINT, since the integer must be nonnegative.
4692 * ftfont.c (ftfont_spec_pattern):
4693 * keymap.c (access_keymap, silly_event_symbol_error):
4694 XUINT -> XFASTINT, since the integer must be nonnegative.
4695 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
4696 since it makes no difference and we prefer signed.
4697 * keyboard.c (record_char): Use XUINT when all the neighbors do.
4698 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
4699 nonnegative.
4700
d6d100dd
SM
47012011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
4702
4703 * window.h (Fwindow_frame): Declare.
4704
2b6148e4
PE
47052011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4706
4707 * alloc.c: Simplify handling of large-request failures (Bug#8800).
4708 (SPARE_MEMORY): Always define.
4709 (LARGE_REQUEST): Remove.
4710 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
4711
f230ecc9
MR
47122011-06-06 Martin Rudalics <rudalics@gmx.at>
4713
727e958e
MR
4714 * lisp.h: Move EXFUNS for Fframe_root_window,
4715 Fframe_first_window and Fset_frame_selected_window to window.h.
4716
4717 * window.h: Move EXFUNS for Fframe_root_window,
4718 Fframe_first_window and Fset_frame_selected_window here from
4719 lisp.h.
4720
4721 * frame.c (Fwindow_frame, Fframe_first_window)
4722 (Fframe_root_window, Fframe_selected_window)
4723 (Fset_frame_selected_window): Move to window.c.
4724 (Factive_minibuffer_window): Move to minibuf.c.
4725 (Fother_visible_frames_p): New function.
4726
4727 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
4728
f230ecc9
MR
4729 * window.c (decode_window, decode_any_window): Move up in code.
4730 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
4731 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
4732 (Fwindow_buffer): Move up and rewrite doc-string.
4733 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
4734 (Fwindow_prev): New functions.
727e958e
MR
4735 (Fwindow_frame): Move here from frame.c. Accept any window as
4736 argument.
4737 (Fframe_root_window, Fframe_first_window)
4738 (Fframe_selected_window): Move here from frame.c. Accept frame
4739 or arbitrary window as argument. Update doc-strings.
4740 (Fminibuffer_window): Move up in code.
4741 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
4742 (Fset_frame_selected_window): Move here from frame.c.
4743 Marginal rewrite.
727e958e
MR
4744 (Fselected_window, select_window, Fselect_window): Move up in
4745 code. Minor doc-string fixes.
f230ecc9 4746
4d09bcf6
PE
47472011-06-06 Paul Eggert <eggert@cs.ucla.edu>
4748
4749 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
4750 Do not assume that spare memory exists; that assumption is valid
4751 only if SYSTEM_MALLOC.
4752 (LARGE_REQUEST): New macro, so that the issue of large requests
4753 is separated from the issue of spare memory.
4754
810928a2
AS
47552011-06-05 Andreas Schwab <schwab@linux-m68k.org>
4756
172418ad
AS
4757 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
4758 format. (Bug#8806)
4759
43f862f7
AS
4760 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
4761
810928a2
AS
4762 * xfns.c (x_set_scroll_bar_default_width): Move declarations
4763 before statements.
4764
a059fe24
JD
47652011-06-05 Jan Djärv <jan.h.d@swipnet.se>
4766
4767 * gtkutil.c (xg_get_default_scrollbar_width): New function.
4768
4769 * gtkutil.h: Declare xg_get_default_scrollbar_width.
4770
4771 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
4772 min width by calling x_set_scroll_bar_default_width (Bug#8505).
4773
989bf368
JB
47742011-06-05 Juanma Barranquero <lekktu@gmail.com>
4775
4776 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
4777
4b80f674
CY
47782011-06-04 Chong Yidong <cyd@stupidchicken.com>
4779
4780 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
4781 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
4782 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
4783 New error handlers.
4b80f674
CY
4784 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
4785 Obey Vx_select_enable_clipboard_manager. Catch errors in
4786 x_clipboard_manager_save (Bug#8779).
4787 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 4788 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 4789
99a33b77 47902011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
4791
4792 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
4793
99a33b77 47942011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
4795
4796 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
4797 in the current matrix if keep_current_p is non-zero.
4798
8264569d
EZ
47992011-06-04 Eli Zaretskii <eliz@gnu.org>
4800
4801 * bidi.c (bidi_level_of_next_char): Fix last change.
4802
57f97249
EZ
48032011-06-03 Eli Zaretskii <eliz@gnu.org>
4804
fec2107c 4805 Support bidi reordering of text covered by display properties.
57f97249 4806
fec2107c
EZ
4807 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
4808 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
4809 (bidi_cache_search, bidi_cache_iterator_state)
4810 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
4811 (bidi_level_of_next_char, bidi_move_to_visually_next):
4812 Support character positions inside a run of characters covered by a
fec2107c
EZ
4813 display string.
4814 (bidi_paragraph_init, bidi_resolve_explicit_1)
4815 (bidi_level_of_next_char): Call bidi_fetch_char and
4816 bidi_fetch_char_advance instead of FETCH_CHAR and
4817 FETCH_CHAR_ADVANCE.
4818 (bidi_init_it): Initialize new members.
4819 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
4820 definitions.
4821 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
4822 instead of using explicit *_CHAR codes.
d6d100dd
SM
4823 (bidi_resolve_explicit, bidi_resolve_weak):
4824 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
4825 bidirectional text is supported only in multibyte buffers.
4826 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
4827 it to initialize the frame_window_p member of struct bidi_it.
4828 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
4829 (bidi_resolve_explicit, bidi_resolve_weak)
4830 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
4831 bidi_it->nchars is non-positive.
4832 (bidi_level_of_next_char): Don't try to lookup the cache for the
4833 next/previous character if nothing is cached there yet, or if we
4834 were just reseat()'ed to a new position.
c40e2fb2 4835
0e14fe90
EZ
4836 * xdisp.c (set_cursor_from_row): Set start and stop points
4837 according to the row's direction when priming the loop that looks
4838 for the glyph on which to display cursor.
4839 (single_display_spec_intangible_p): Function deleted.
4840 (display_prop_intangible_p): Reimplement to call
4841 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
4842 Accept 3 additional arguments needed by handle_display_spec.
4843 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
4844 values: lists, `(when COND...)' forms, etc.
4845 (single_display_spec_string_p): Support property values that are
4846 lists with the argument STRING its top-level element.
4847 (display_prop_string_p): Fix the condition for processing a
4848 property that is a list to be consistent with handle_display_spec.
fec2107c 4849 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
4850 last portion of handle_display_prop.
4851 (compute_display_string_pos): Accept additional argument
4852 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
4853 value of a `display' property is a "replacing spec".
4854 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
4855 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
4856 the display property, but just return a value indicating whether
4857 the display property will replace the characters it covers.
4858 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
4859 frame_window_p members of struct bidi_it.
d6d100dd
SM
4860 (compute_display_string_pos, compute_display_string_end):
4861 New functions.
fec2107c
EZ
4862 (push_it): Accept second argument POSITION, where pop_it should
4863 jump to continue iteration.
4864 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 4865
fec2107c
EZ
4866 * keyboard.c (adjust_point_for_property): Adjust the call to
4867 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
4868
4869 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
4870 (bidi_init_it): Update prototypes.
4871 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
4872 (compute_display_string_pos, compute_display_string_end):
4873 Declare prototypes.
fec2107c
EZ
4874 (struct bidi_it): New members nchars and disp_pos. ch_len is now
4875 EMACS_INT.
fc6f18ce 4876
40087514 48772011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 4878
57f53182
PE
4879 Malloc failure behavior now depends on size of allocation.
4880 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
4881 * lisp.h: Change signatures accordingly.
4882 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
4883 All callers changed. (Bug#8762)
4884
4885 * gnutls.c: Use Emacs's memory allocators.
4886 Without this change, the gnutls library would invoke malloc etc.
4887 directly, which causes problems on non-SYNC_INPUT hosts, and which
4888 runs afoul of improving memory_full behavior. (Bug#8761)
4889 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
4890 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
4891 xfree instead of the default malloc, realloc, free.
4892 (Fgnutls_boot): No need to check for memory allocation failure,
4893 since xmalloc does that for us.
4894
ac32cd99 4895 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
4896 * category.c (hash_get_category_set):
4897 * ccl.c (ccl_driver):
4898 * charset.c (Fdefine_charset_internal):
4899 * charset.h (struct charset.hash_index):
4900 * composite.c (get_composition_id, gstring_lookup_cache)
4901 (composition_gstring_put_cache):
4902 * composite.h (struct composition.hash_index):
4903 * dispextern.h (struct image.hash):
4904 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
4905 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4906 (hashfn_equal, hashfn_user_defined, make_hash_table)
4907 (maybe_resize_hash_table, hash_lookup, hash_put)
4908 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
4909 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
4910 (Fsxhash, Fgethash, Fputhash, Fmaphash):
4911 * image.c (make_image, search_image_cache, lookup_image)
4912 (xpm_put_color_table_h):
4913 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 4914 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 4915 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 4916 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
4917 * alloc.c (allocate_vectorlike):
4918 Check for overflow in vector size calculations.
4919 * ccl.c (ccl_driver):
4920 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
4921 * fns.c, image.c: Remove unnecessary static decls that would otherwise
4922 need to be updated by these changes.
40087514
PE
4923 * fns.c (make_hash_table, maybe_resize_hash_table):
4924 Check for integer overflow with large hash tables.
0de4bb68
PE
4925 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
4926 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
4927 (SXHASH_REDUCE): New macro.
4928 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
4929 Use it instead of discarding useful hash info with large hash values.
4930 (sxhash_float): New function.
4931 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
4932 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
4933 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
4934 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
4935 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
4936 Adjust signatures to match updated version of code.
4937 (consing_since_gc): Now EMACS_INT, since a single hash table can
4938 use more than INT_MAX bytes.
4939
698d32e2
DN
49402011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
4941
4942 Make it possible to build with GCC-4.6+ -O2 -flto.
4943
4944 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
4945
fd6fa53f
SM
49462011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
4947
4948 * minibuf.c (get_minibuffer, read_minibuf_unwind):
4949 Call minibuffer-inactive-mode.
4950
864db017
JB
49512011-05-31 Juanma Barranquero <lekktu@gmail.com>
4952
4953 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
4954 Update dependencies.
4955
2ad0baf4
DN
49562011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4957
4958 * data.c (init_data): Remove code for UTS, this system is not
4959 supported anymore.
4960
4fcc2638
DN
49612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4962
4963 Don't force ./temacs to start in terminal mode.
4964
4965 * frame.c (make_initial_frame): Initialize faces in all cases, not
4966 only when CANNOT_DUMP is defined.
4967 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
4968
c56e0fd5
DN
49692011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4970
4971 * dispnew.c (add_window_display_history): Use const for the string
4972 pointer. Remove declaration, not needed.
4973
333d54da 49742011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 4975
55d4c1b2 4976 Use 'inline', not 'INLINE'.
333d54da 4977 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
4978 * alloc.c, fontset.c (INLINE): Remove.
4979 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
4980 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
4981 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
4982 * gmalloc.c (register_heapinfo): Use inline unconditionally.
4983 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
4984
738db178
DN
49852011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
4986
4987 Make it possible to run ./temacs.
4988
4989 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
4990 syms_of_callproc does the same thing. Remove test for
4991 "initialized", do it in the caller.
4992 * emacs.c (main): Avoid calling set_initial_environment when dumping.
4993
620c53a6
SM
49942011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
4995
4996 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
4997 (read_minibuf): Use get_minibuffer.
4998 (syms_of_minibuf): Use DEFSYM.
4999 (Qmetadata): New var.
5000 * data.c (Qbuffer): Don't make it static.
5001 (syms_of_data): Use DEFSYM.
5002
e003a292
PE
50032011-05-31 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
5006 (CCL_CODE_MIN): New macro.
5007
ed008a6d
PE
50082011-05-30 Paul Eggert <eggert@cs.ucla.edu>
5009
3687c2ef
PE
5010 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
5011
ed008a6d
PE
5012 * eval.c (Qdebug): Now static.
5013 * lisp.h (Qdebug): Remove decl. This reverts a part of the
5014 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
5015 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
5016
d66c4c7c
CY
50172011-05-29 Chong Yidong <cyd@stupidchicken.com>
5018
5019 * image.c: Various fixes to ImageMagick code comments.
5020 (Fimagemagick_types): Doc fix.
5021
5fbc2025
PE
50222011-05-29 Paul Eggert <eggert@cs.ucla.edu>
5023
0196f88a
PE
5024 Minor fixes prompted by GCC 4.6.0 warnings.
5025
5026 * xselect.c (converted_selections, conversion_fail_tag): Now static.
5027
5fbc2025
PE
5028 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
5029 (x_clipboard_manager_save_all): Move extern decl to ...
5030 * xterm.h: ... here, so that it can be checked for consistency.
5031
1dd3c2d9
CY
50322011-05-29 Chong Yidong <cyd@stupidchicken.com>
5033
5034 * xselect.c (x_clipboard_manager_save_frame)
5035 (x_clipboard_manager_save_all): New functions.
5036 (Fx_clipboard_manager_save): Lisp function deleted.
5037
5038 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
5039 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
5040
5041 * xterm.h: Update prototype.
5042
5ba6571d
WX
50432011-05-28 William Xu <william.xwl@gmail.com>
5044
5045 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
5046 exiting (Bug#8239).
5047
3eaff834
JM
50482011-05-28 Jim Meyering <meyering@redhat.com>
5049
e1900994 5050 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
5051 * fns.c (to_uchar): Define.
5052 (crypto_hash_function): Use it to convert some newly-signed
5053 variables to unsigned, to avoid sign-extension bugs. For example,
5054 without this change, (md5 "truc") would evaluate to
5055 45723a2aff78ff4fff7fff1114760e62 rather than the expected
5056 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 5057 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 5058
0f6990a7
PE
50592011-05-27 Paul Eggert <eggert@cs.ucla.edu>
5060
5061 Integer overflow fixes.
c8a9ca5a 5062
08686060
PE
5063 * dbusbind.c: Serial number integer overflow fixes.
5064 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
5065 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
5066 to hold a serial number that is too large for a fixnum.
5067 (Fdbus_method_return_internal, Fdbus_method_error_internal):
5068 Check for serial numbers out of range. Decode any serial number
59568bf0 5069 that was so large that it became a float. (Bug#8722)
08686060 5070
2d1fc3c7
PE
5071 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
5072 (Fdbus_call_method, Fdbus_call_method_asynchronously):
5073 Use XFASTINT rather than XUINT when numbers are nonnegative.
5074 (xd_append_arg, Fdbus_method_return_internal):
5075 (Fdbus_method_error_internal): Likewise. Also, for unsigned
5076 arguments, check that Lisp number is nonnegative, rather than
59568bf0 5077 silently wrapping negative numbers around. (Bug#8722)
30217ff0 5078 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 5079 (Bug#8722)
2d1fc3c7 5080
c8a9ca5a
PE
5081 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
5082
519e1d69
PE
5083 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
5084
30569699
PE
5085 ccl: add integer overflow checks
5086 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
5087 (IN_INT_RANGE): New macros.
5088 (ccl_driver): Use them to check for integer overflow when
5089 decoding a CCL program. Many of the new checks are whether XINT (x)
5090 fits in int; it doesn't always, on 64-bit hosts. The new version
5091 doesn't catch all possible integer overflows, but it's an
847044ea 5092 improvement. (Bug#8719)
30569699 5093
c11285dc
PE
5094 * alloc.c (make_event_array): Use XINT, not XUINT.
5095 There's no need for unsigned here.
5096
fdccd48e
PE
5097 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
5098 This follows up to the 2011-05-06 change that substituted uintptr_t
5099 for EMACS_INT. This case wasn't caught back then.
5100
37910ab2
PE
5101 Rework Fformat to avoid integer overflow issues.
5102 * editfns.c: Include <float.h> unconditionally, as it's everywhere
5103 now (part of C89). Include <verify.h>.
5104 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
5105 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
5106 (Fformat): Avoid the prepass trying to compute sizes; it was only
5107 approximate and thus did not catch overflow reliably. Instead, walk
5108 through the format just once, formatting and computing sizes as we go,
5109 checking for integer overflow at every step, and allocating a larger
5110 buffer as needed. Keep track separately whether the format is
5111 multibyte. Keep only the most-recently calculated precision, rather
5112 than them all. Record whether each argument has been converted to
5113 string. Use EMACS_INT, not int, for byte and char and arg counts.
5114 Support field widths and precisions larger than INT_MAX. Avoid
5115 sprintf's undefined behavior with conversion specifications such as %#d
5116 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
5117 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
5118 formatting out-of-range floating point numbers with int
9173deec 5119 formats. (Bug#8668)
37910ab2 5120
2e6578fb
PE
5121 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
5122
0ae6bdee
PE
5123 * data.c: Avoid integer truncation in expressions involving floats.
5124 * data.c: Include <intprops.h>.
5125 (arith_driver): When there's an integer overflow in an expression
5126 involving floating point, convert the integers to floating point
5127 so that the resulting value does not suffer from catastrophic
5128 integer truncation. For example, on a 64-bit host (* 4
5129 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
5130 Do not rely on undefined behavior after integer overflow.
5131
de883a70
PE
5132 merge count_size_as_multibyte, parse_str_to_multibyte
5133 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 5134 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
5135 Check for integer overflow.
5136 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
5137 since it's now a duplicate of the other. This is more of
5138 a character than a buffer op, so better that it's in character.c.
5139 * fns.c, print.c: Adjust to above changes.
5140
2ff916cb
PE
51412011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
5142
5143 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
5144
f1b54466
PE
51452011-05-27 Paul Eggert <eggert@cs.ucla.edu>
5146
fb1ac845
PE
5147 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5148 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
5149 (x_clipboard_manager_save): Now static.
5150 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
5151
f1b54466
PE
5152 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
5153 (crypto_hash_function): Now static.
5154 Fix pointer signedness problems. Avoid unnecessary initializations.
5155
a9f737ee
CY
51562011-05-27 Chong Yidong <cyd@stupidchicken.com>
5157
5158 * termhooks.h (Vselection_alist): Make it terminal-local.
5159
5160 * terminal.c (create_terminal): Initialize it.
5161
5162 * xselect.c: Support for clipboard managers.
5163 (Vselection_alist): Move to termhooks.h as terminal-local var.
5164 (LOCAL_SELECTION): New macro.
5165 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
5166 (symbol_to_x_atom): Remove gratuitous arg.
5167 (x_handle_selection_request, lisp_data_to_selection_data)
5168 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
5169 (x_own_selection, x_get_local_selection, x_convert_selection):
5170 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
5171 (some_frame_on_display): Delete unused function.
5172 (Fx_own_selection_internal, Fx_get_selection_internal)
5173 (Fx_disown_selection_internal, Fx_selection_owner_p)
5174 (Fx_selection_exists_p): New optional frame arg.
5175 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
5176 (x_handle_selection_clear): Don't treat other terminals with the
5177 same keyboard specially. Use the terminal-local Vselection_alist.
5178 (x_clear_frame_selections): Use Frun_hook_with_args.
5179
5180 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
5181
5182 * xterm.h: Add support for those atoms.
5183
e067f0c1
CY
51842011-05-26 Chong Yidong <cyd@stupidchicken.com>
5185
5186 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
5187 (converted_selections, conversion_fail_tag): New global variables.
5188 (x_selection_request_lisp_error): Free the above.
5189 (x_get_local_selection): Remove unnecessary code.
5190 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
5191 of converted selections stored in converted_selections.
5192 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
5193 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
5194 (x_convert_selection): New function.
5195 (x_handle_selection_event): Simplify.
5196 (x_get_foreign_selection): Don't ignore incoming requests while
5197 waiting for an answer; this will fail when we implement
5198 SAVE_TARGETS, and seems unnecessary anyway.
5199 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
5200 (Vx_sent_selection_functions): Doc fix.
5201
0f4aebc0
LL
52022011-05-26 Leo Liu <sdl.web@gmail.com>
5203
5204 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
5205
e61124cd
YM
52062011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5207
5208 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
5209
5210 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
5211 for fringe update if it has periodic bitmap.
ac389d0c 5212 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
5213 and fringe_bitmap_periodic_p.
5214
5215 * fringe.c (get_fringe_bitmap_data): New function.
5216 (draw_fringe_bitmap_1, update_window_fringes): Use it.
5217 (update_window_fringes): Record periodicity of fringe bitmap in glyph
5218 row. Mark glyph row for fringe update if periodicity changed.
5219
5220 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
5221 for fringe update unless it has periodic bitmap.
5222
f16d9837
KH
52232011-05-25 Kenichi Handa <handa@m17n.org>
5224
5225 * xdisp.c (get_next_display_element): Set correct it->face_id for
5226 a static composition.
5227
e1b90ef6
LL
52282011-05-24 Leo Liu <sdl.web@gmail.com>
5229
5230 * deps.mk (fns.o):
5231 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
5232
5233 * fns.c (crypto_hash_function, Fsha1): New function.
5234 (Fmd5): Use crypto_hash_function.
5235 (syms_of_fns): Add Ssha1.
5236
7400048f
PE
52372011-05-22 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * gnutls.c: Remove unused macros.
5240 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
5241 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
5242 Remove macros that are defined and never used.
5243 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
5244
abb71cf4
CY
52452011-05-22 Chong Yidong <cyd@stupidchicken.com>
5246
5247 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
5248 (Fx_get_selection_internal): Minor cleanup.
5249 (Fx_own_selection_internal): Rename arguments for consistency with
5250 select.el.
5251
6307db39
PE
52522011-05-22 Paul Eggert <eggert@cs.ucla.edu>
5253
5254 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
5255
f3d4e0a4
CY
52562011-05-22 Chong Yidong <cyd@stupidchicken.com>
5257
5258 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
5259
4d8ade89
YM
52602011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5261
5262 * dispnew.c (scrolling_window): Don't exclude the case that the
5263 last enabled row in the desired matrix touches the bottom boundary.
5264
32078c8d
GM
52652011-05-21 Glenn Morris <rgm@gnu.org>
5266
5267 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
5268 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
5269 and add some more files.
32078c8d 5270
7285dc67
EZ
52712011-05-20 Eli Zaretskii <eliz@gnu.org>
5272
5273 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
5274 report_file_error introduced by the change from 2011-05-07.
5275
89d1bd22
PE
52762011-05-20 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 * systime.h (Time): Define only if emacs is defined.
5279 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
5280 where the include path doesn't have X11/X.h by default. See
5281 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
5282
e23640bb 52832011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
5284
5285 * composite.c (find_automatic_composition): Fix previous change.
5286
b9704ad9
GM
52872011-05-20 Glenn Morris <rgm@gnu.org>
5288
5289 * lisp.mk: New file, split from Makefile.in.
5290 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
5291 (shortlisp): Remove.
5292 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
5293
4a720484
GM
52942011-05-19 Glenn Morris <rgm@gnu.org>
5295
5296 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
5297 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
5298 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
5299 (lisp): Set the order to that of loadup.el.
5300 (shortlisp): Make it a copy of $lisp.
5301 (SOME_MACHINE_LISP): Remove.
5302 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
5303 Use just $shortlisp, not $SOME_MACHINE_LISP too.
5304
a28d4396
KH
53052011-05-18 Kenichi Handa <handa@m17n.org>
5306
5307 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
5308 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
5309 (find_automatic_composition): Mostly rewrite for efficiency.
5310
a2b1fa8e
JB
53112011-05-18 Juanma Barranquero <lekktu@gmail.com>
5312
5313 * makefile.w32-in: Update dependencies.
5314
8e1f5610
CS
53152011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
5316
5317 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 5318 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 5319
7025ee00 53202011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 5321
cdfa6eab
PE
5322 Fix some integer overflow issues, such as string length overflow.
5323
06d6db33
PE
5324 * insdel.c (count_size_as_multibyte): Check for string overflow.
5325
2b4560a8
PE
5326 * character.c (lisp_string_width): Check for string overflow.
5327 Use EMACS_INT, not int, for string indexes and lengths; in
5328 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
5329 the resulting string length overflows an EMACS_INT; instead,
5330 report a string overflow if no precision given. When checking for
5331 precision exhaustion, use a check that cannot possibly have
5332 integer overflow. (Bug#8675)
5333 * character.h (lisp_string_width): Adjust to new signature.
5334
cb93f9be
PE
5335 * alloc.c (string_overflow): New function.
5336 (Fmake_string): Use it. This doesn't change behavior, but saves
5337 a few bytes and will simplify future changes.
5338 * character.c (string_escape_byte8): Likewise.
5339 * lisp.h (string_overflow): New decl.
5340
1a1f3366
PE
5341 Fixups, following up to the user-interface timestamp change.
5342 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
5343 for UI timestamps, instead of unsigned long.
9fbd6841
PE
5344 * msdos.c (mouse_get_pos): Likewise.
5345 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
5346 * w32gui.h (Time): Define by including "systime.h" rather than by
5347 declaring it ourselves. (Bug#8664)
5348
d4e3e4d3
PE
5349 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
5350 * image.c (clear_image_cache): Likewise.
5351
f6a24d19
PE
5352 * term.c (term_mouse_position): Don't assume time_t wraparound.
5353
08dc5ae6
PE
5354 Be more systematic about user-interface timestamps.
5355 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
5356 and sometimes 'EMACS_UINT', to represent these timestamps.
5357 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
5358 This makes the code easier to follow, and makes it easier to catch
5359 integer overflow bugs such as Bug#8664.
5360 * frame.c (Fmouse_position, Fmouse_pixel_position):
5361 Use Time, not unsigned long, for user-interface timestamps.
5362 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
5363 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
5364 * keyboard.h (last_event_timestamp): Likewise.
5365 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
5366 * menu.h (xmenu_show): Likewise.
5367 * term.c (term_mouse_position): Likewise.
5368 * termhooks.h (struct input_event.timestamp): Likewise.
5369 (struct terminal.mouse_position_hook): Likewise.
5370 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
5371 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
5372 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
5373 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
5374 what it was before.
5375 * menu.h, termhooks.h: Include "systime.h", for Time.
5376
8e55734a
PE
5377 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
5378 Don't assume that the difference between two unsigned long values
5379 can fit into an integer. At this point, we know button_down_time
5380 <= event->timestamp, so the difference must be nonnegative, so
5381 there's no need to cast the result if double-click-time is
5382 nonnegative, as it should be; check that it's nonnegative, just in
5383 case. This bug is triggered when events are more than 2**31 ms
86db42d2 5384 apart (about 25 days). (Bug#8664)
8e55734a 5385
841f1b75 5386 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 5387 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 5388
3e26f69c
PE
5389 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
5390 that always fit in int. Use a sentinel instead of a counter, to
5391 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
5392 * frame.h (struct frame): Use int for menu_bar_items_used
5393 instead of EMACS_INT, since it always fits in int.
3e26f69c 5394
5cc152c0
PE
5395 * menu.c (grow_menu_items): Check for int overflow.
5396
d89eb65e
PE
5397 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
5398
5235bd3e
PE
5399 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
5400 Before, the code was not consistent. These values cannot exceed
5401 2**31 - 1 so there's no need to make them unsigned.
5402 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
5403 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
5404 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
5405 as modifiers.
5406 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
5407
bc827e23
PE
5408 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
5409 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
5410 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
5411 presumably because the widths might not match.
5412
78eb494e
PE
5413 * window.c (size_window): Avoid needless test at loop start.
5414
04f2d78b
CB
54152011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
5416
5417 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
5418
d2fc7e3d 54192011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
5420
5421 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
5422
d2fc7e3d 54232011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
5424
5425 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
5426 `width' to `bar_area_x' and `bar_area_width', respectively.
5427 (x_scroll_run): Take account of fringe background extension.
5428
04f2d78b
CB
5429 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
5430 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
5431 `bar_area_width', respectively.
5432 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
5433 background extension.
5434
79b70037
GM
54352011-05-10 Jim Meyering <meyering@redhat.com>
5436
5437 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
5438
2f142cc5
JB
54392011-05-10 Juanma Barranquero <lekktu@gmail.com>
5440
5441 * image.c (Finit_image_library): Return t for built-in image types,
5442 like pbm and xbm. (Bug#8640)
5443
57679c86
AS
54442011-05-09 Andreas Schwab <schwab@linux-m68k.org>
5445
5446 * w32menu.c (set_frame_menubar): Fix submenu allocation.
5447
888c9e86
EZ
54482011-05-07 Eli Zaretskii <eliz@gnu.org>
5449
b0512a1d
EZ
5450 * w32console.c (Fset_screen_color): Doc fix.
5451 (Fget_screen_color): New function.
5452 (syms_of_ntterm): Defsubr it.
5453
7285dc67
EZ
5454 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
5455 unlink the temporary file if Fcall_process didn't create it in the
5456 first place.
5457 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
5458 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
5459 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
5460 cue to call_process_cleanup not to close that handle.
5461
4d3fcc8e
BK
54622011-05-07 Ben Key <bkey76@gmail.com>
5463
5464 * makefile.w32-in: The bootstrap-temacs rule now makes use of
5465 one of two shell specific rules, either bootstrap-temacs-CMD or
5466 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
5467 to the previous implementation of the bootstrap-temacs rule.
5468 The bootstrap-temacs-CMD rule is similar to the previous
5469 implementation of the bootstrap-temacs rule except that it
5470 makes use of the ESC_CFLAGS variable instead of the CFLAGS
5471 variable.
5472
5473 These changes, along with some changes to nt/configure.bat,
5474 nt/gmake.defs, and nt/nmake.defs, are required to extend my
5475 earlier fix to add support for --cflags and --ldflags options
5476 that include quotes so that it works whether make uses cmd or
5477 sh as the shell.
5478
b4289b64
MA
54792011-05-06 Michael Albinus <michael.albinus@gmx.de>
5480
5481 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
5482 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
5483 is a constant.
5484 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
5485 a string. Handle both cases.
5486 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
5487 (Fdbus_register_method): Use Qinvalid_function.
5488
af4c0e28
JB
54892011-05-06 Juanma Barranquero <lekktu@gmail.com>
5490
5491 * makefile.w32-in: Update dependencies.
5492 (LISP_H): Add inttypes.h and stdin.h.
5493 (PROCESS_H): Add unistd.h.
5494
c51453d9
EZ
54952011-05-06 Eli Zaretskii <eliz@gnu.org>
5496
5497 * lread.c: Include limits.h (fixes the MS-Windows build broken by
5498 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
5499
8ff0ac3c 55002011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 5501
4c4b566b
PE
5502 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
5503
aab2b9b5
PE
5504 * term.c (vfatal): Remove stray call to va_end.
5505 It's not needed and the C Standard doesn't allow it here anyway.
5506
c378da0b
PE
5507 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
5508 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
5509
288b08c7
PE
5510 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
5511 bytes.
5512
e3601888
PE
5513 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
5514
db6c0e74
PE
5515 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5516
dd5963ea
PE
5517 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
5518
88c9450f
PE
5519 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
5520
2f9442b8
PE
5521 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
5522
c032b5f8
PE
5523 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
5524 * charset.c (Fdefine_charset_internal): Don't initialize
5525 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 5526 32-bit int (Bug#8600).
a108c10b
PE
5527
5528 * lread.c (read_integer): Be more consistent with string-to-number.
5529 Use string_to_number to do the actual conversion; this avoids
5530 rounding errors and fixes some other screwups. Without this fix,
5531 for example, #x1fffffffffffffff was misread as -2305843009213693952.
5532 (digit_to_number): Move earlier, for benefit of read_integer.
5533 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 5534 not a digit in any supported base. (Bug#8602)
a108c10b 5535
ad5f9eea
PE
5536 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
5537
aec1708a
PE
5538 * dispnew.c (scrolling_window): Return 1 if we scrolled,
5539 to match comment at start of function. This also removes a
5540 GCC warning about overflow in a 32+64-bit port.
5541
47be4ab5
PE
5542 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
5543
371cac43
PE
5544 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
5545 Reported by Stefan Monnier in
5546 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
5547 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5548 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 5549
d01a7826
PE
5550 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
5551 (EMACS_UINTPTR): Likewise, with uintptr_t.
5552
7fd47d5c
PE
5553 * lisp.h: Prefer 64-bit EMACS_INT if available.
5554 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
5555 on 32-bit hosts that have 64-bit int, so that they can access
5556 large files.
122b0c86
PE
5557 However, temporarily disable this change unless the temporary
5558 symbol WIDE_EMACS_INT is defined.
7fd47d5c 5559
8727937b
PE
5560 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
5561
8ac068ac
PE
5562 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
5563 This removes an assumption that EMACS_INT and long are the same
5564 width as pointers. The assumption is true for Emacs porting targets
5565 now, but we want to make other targets possible.
5566 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
5567 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
5568 In the rest of the code, change types of integers that hold casted
5569 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
5570 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
5571 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
5572 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
5573 No need to cast type when ORing.
5574 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
5575 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
5576 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
5577 assume EMACS_INT is the same width as char *.
5578 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
5579 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
5580 Remove no-longer-needed casts.
5581 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
5582 (xg_tool_bar_help_callback, xg_make_tool_item):
5583 Use EMACS_INTPTR to hold an integer
5584 that will be cast to void *; this can avoid a GCC warning
5585 if EMACS_INT is not the same width as void *.
5586 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
5587 * xdisp.c (display_echo_area_1, resize_mini_window_1):
5588 (current_message_1, set_message_1):
5589 Use a local to convert to proper width without a cast.
5590 * xmenu.c (dialog_selection_callback): Likewise.
5591
ede49d71
PE
5592 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
5593 Also, don't assume VALBITS / RAND_BITS is less than 5,
5594 and don't rely on undefined behavior when shifting a 1 left into
5595 the sign bit.
5596 * lisp.h (get_random): Change signature to match.
5597
2f30ecd0
PE
5598 * lread.c (hash_string): Use size_t, not int, for hash computation.
5599 Normally we prefer signed values; but hashing is special, because
5600 it's better to use unsigned division on hash table sizes so that
5601 the remainder is nonnegative. Also, size_t is the natural width
5602 for hashing into memory. The previous code used 'int', which doesn't
5603 retain enough info to hash well into very large tables.
5604 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
5605
2a866e7b
PE
5606 * dbusbind.c: Don't possibly lose pointer info when converting.
5607 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
5608 Use XPNTR rather than XHASH, so that the high-order bits of
5609 the pointer aren't lost when converting through void *.
5610
51639eac
PE
5611 * eval.c (Fautoload): Don't double-shift a pointer.
5612
92394119
PE
5613 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
5614
dbdb9a7c
JB
56152011-05-06 Juanma Barranquero <lekktu@gmail.com>
5616
5617 * gnutls.c (DEF_GNUTLS_FN):
5618 * image.c (DEF_IMGLIB_FN): Make function pointers static.
5619
db7a0b4f
AS
56202011-05-05 Andreas Schwab <schwab@linux-m68k.org>
5621
5622 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
5623 marker. (Bug#8610)
5624
f7ff1b0f 56252011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
5626
5627 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
5628 New version that can reserve upto 2GB of heap space.
5629
f7ff1b0f 56302011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
5631
5632 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
5633
639c109b
TZ
56342011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
5635
5636 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
5637 `gnutls_certificate_set_x509_key_file'.
5638
d2127135
JB
56392011-05-05 Juanma Barranquero <lekktu@gmail.com>
5640
5641 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
5642 Update dependencies.
5643
e968f4f3
JB
56442011-05-04 Juanma Barranquero <lekktu@gmail.com>
5645
5646 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
5647 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5648 Remove unused parameter `fildes'.
5649 * process.c (read_process_output, send_process): Don't pass it.
5650
84d358f0
JB
56512011-05-04 Juanma Barranquero <lekktu@gmail.com>
5652
5653 Fix previous change: the library cache is defined in w32.c.
5654 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
5655 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
5656
0898ca10
JB
56572011-05-04 Juanma Barranquero <lekktu@gmail.com>
5658
5659 Implement dynamic loading of GnuTLS on Windows.
5660
5661 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
5662 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
5663 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5664 Declare.
5665
5666 * gnutls.c (Qgnutls_dll): Define.
5667 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
5668 (gnutls_*): Declare function pointers.
5669 (init_gnutls_functions): New function to initialize function pointers.
5670 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
5671 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
5672 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
5673 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
5674 (emacs_gnutls_write, emacs_gnutls_read)
5675 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
5676 (Fgnutls_available_p): New function.
5677 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
5678 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
5679 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
5680
5681 * image.c: Include w32.h.
5682 (Vimage_type_cache): Delete.
5683 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
5684 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
5685 (w32_delayed_load): Move to w32.c.
5686
5687 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
5688
5689 * w32.c (QCloaded_from, Vlibrary_cache): Define.
5690 (w32_delayed_load): Move from image.c. When loading a library, record
5691 its filename in the :loaded-from property of the library id.
5692 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
5693 Initialize and staticpro them.
5694 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
5695
5696 * process.c: Include lisp.h before w32.h, not after.
5697 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
5698 instead of gnutls_record_check_pending.
5699
5700 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
5701
ff4de4aa
TZ
57022011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
5703
5704 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
5705 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
5706 as passed in.
5707
abe95abb
JD
57082011-05-03 Jan Djärv <jan.h.d@swipnet.se>
5709
5710 * xterm.c (x_set_frame_alpha): Do not set property on anything
5711 else than FRAME_X_OUTER_WINDOW (Bug#8608).
5712
e16e55d4
JB
57132011-05-02 Juanma Barranquero <lekktu@gmail.com>
5714
5715 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
5716
bafcf6a5
JB
57172011-05-02 Juanma Barranquero <lekktu@gmail.com>
5718
5719 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
5720 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
5721 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
5722 (gnutls_global_initialized, Qgnutls_bootprop_priority)
5723 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
5724 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
5725 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
5726 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
5727 (Qgnutls_bootprop_callbacks_verify): Make static.
5728
e7a6747f
AS
57292011-05-01 Andreas Schwab <schwab@linux-m68k.org>
5730
19ed11ba
AS
5731 * callproc.c: Indentation fixup.
5732
e7a6747f 5733 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
5734 (wait_for_termination, interruptible_wait_for_termination):
5735 Move after wait_for_termination_1.
e7a6747f 5736
1ef14cb4
LMI
57372011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
5738
5739 * sysdep.c (interruptible_wait_for_termination): New function
5740 which is like wait_for_termination, but allows keyboard
5741 interruptions.
5742
5743 * callproc.c (Fcall_process): Add (:file "file") as an option for
5744 the STDOUT buffer.
5745 (Fcall_process_region): Ditto.
5746
330d880c
EZ
57472011-04-30 Eli Zaretskii <eliz@gnu.org>
5748
8db90b73
EZ
5749 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
5750 rather than `XVECTOR (FOO)->size'.
5751
330d880c
EZ
5752 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
5753 inttypes.h, as a gnulib replacement is used if it not available in
5754 system headers.
5755
15cbd324
EZ
57562011-04-21 Eli Zaretskii <eliz@gnu.org>
5757
5758 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
5759 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
5760 of MOST_POSITIVE_FIXNUM. (Bug#8528)
5761
5762 * coding.c (coding_alloc_by_realloc): Error out if destination
5763 will grow beyond MOST_POSITIVE_FIXNUM.
5764 (decode_coding_emacs_mule): Abort if there isn't enough place in
5765 charbuf for the composition carryover bytes. Reserve an extra
5766 space for up to 2 characters produced in a loop.
5767 (decode_coding_iso_2022): Abort if there isn't enough place in
5768 charbuf for the composition carryover bytes.
5769
57702011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 5771
ae940cca
EZ
5772 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
5773 aborting when %lld or %lll format is passed.
5774 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
5775 %llo or %llx format is passed. (Bug#8545)
5776
03ab8921
EZ
5777 * window.c (window_scroll_line_based): Use a marker instead of
5778 simple variables to record original value of point. (Bug#7952)
5779
afda1437
EZ
5780 * doprnt.c (doprnt): Fix the case where a multibyte sequence
5781 produced by %s or %c overflows available buffer space. (Bug#8545)
5782
f76dee0c
PE
57832011-04-28 Paul Eggert <eggert@cs.ucla.edu>
5784
5785 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 5786 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 5787
fdc5744d
JB
57882011-04-28 Juanma Barranquero <lekktu@gmail.com>
5789
5790 * w32.c (init_environment): Warn about defaulting HOME to C:\.
5791
638f053a
JB
57922011-04-28 Juanma Barranquero <lekktu@gmail.com>
5793
5794 * keyboard.c (Qdelayed_warnings_hook): Define.
5795 (command_loop_1): Run `delayed-warnings-hook'
5796 if Vdelayed_warnings_list is non-nil.
5797 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
5798 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
5799
d178f871
EZ
58002011-04-28 Eli Zaretskii <eliz@gnu.org>
5801
5802 * doprnt.c (doprnt): Don't return value smaller than the buffer
5803 size if the message was truncated. (Bug#8545).
5804
b124fd93
JB
58052011-04-28 Juanma Barranquero <lekktu@gmail.com>
5806
5807 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
5808 (Fx_window_property): #if-0 the whole functions, not just the bodies.
5809
e810457d
PE
58102011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5811
5812 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
5813
ea51cceb
JB
58142011-04-27 Juanma Barranquero <lekktu@gmail.com>
5815
5816 * makefile.w32-in: Update dependencies.
5817
94dcfacf
EZ
58182011-04-27 Eli Zaretskii <eliz@gnu.org>
5819
5820 Improve `doprnt' and its usage. (Bug#8545)
5821 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
5822 `format_end'. Remove support for %l as a conversion specifier.
5823 Don't use xrealloc. Improve diagnostics when the %l size modifier
5824 is used. Update the commentary.
5825
5826 * eval.c (verror): Simplify calculation of size_t.
5827
5828 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
5829 messages.
5830
f61f41d7
PE
58312011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
5832
5833 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
5834 change.
5835
96fb4434
PE
58362011-04-27 Paul Eggert <eggert@cs.ucla.edu>
5837
5838 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
5839 This makes this file independent of the recent pseudovector change.
5840
671875da 58412011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 5842
69e9b5a3
PE
5843 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
5844
b5f869a7 5845 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 5846 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 5847 Remove unused local.
c8926152 5848 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 5849
841a1577 5850 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
5851 GCC 4.6.0 optimizes based on type-based alias analysis.
5852 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
5853 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
5854 != &v->size, and therefore "v->size = 1; b->size = 2; return
5855 v->size;" must therefore return 1. This assumption is incorrect
5856 for Emacs, since it type-puns struct Lisp_Vector * with many other
5857 types. To fix this problem, this patch adds a new type struct
f904488f 5858 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
5859 and pseudovectors, and helps optimizing compilers not get fooled
5860 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
5861 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
5862 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
5863 the size member.
eab3844f
PE
5864 (XSETPVECTYPE): Rewrite in terms of new macro.
5865 (XSETPVECTYPESIZE): New macro, specifying both type and size.
5866 This is a bit clearer, and further avoids the possibility of
5867 undesirable aliasing.
5868 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 5869 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
5870 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
5871 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
5872 (ASIZE): Now uses header.size rather than size.
5873 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
5874 to avoid the hassle of writing XVECTOR (foo)->header.size.
5875 (struct vectorlike_header): New type.
eab3844f
PE
5876 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
5877 object, to help avoid aliasing.
5878 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
5879 (SUBRP): Likewise, since Lisp_Subr is a special case.
5880 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
5881 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
5882 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 5883 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
5884 changed to be "header.size" and "header.next".
5885 * buffer.h (struct buffer): Likewise.
5886 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
5887 * frame.h (struct frame): Likewise.
5888 * process.h (struct Lisp_Process): Likewise.
5889 * termhooks.h (struct terminal): Likewise.
5890 * window.c (struct save_window_data, struct saved_window): Likewise.
5891 * window.h (struct window): Likewise.
5892 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
5893 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
5894 * buffer.c (init_buffer_once): Likewise.
5895 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
5896 special case.
5897 * process.c (Fformat_network_address): Use local var for size,
5898 for brevity.
5899
0df1eac5
PE
5900 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
5901
847ab9d1 5902 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
5903 * data.c (atof): Remove decl; no longer used or needed.
5904 (digit_to_number): Move to lread.c.
5905 (Fstring_to_number): Use new string_to_number function, to be
5906 consistent with how the Lisp reader treats infinities and NaNs.
5907 Do not assume that floating-point numbers represent EMACS_INT
5908 without losing information; this is not true on most 64-bit hosts.
5909 Avoid double-rounding errors, by insisting on integers when
5910 parsing non-base-10 numbers, as the documentation specifies.
5911 * lisp.h (string_to_number): New decl, replacing ...
5912 (isfloat_string): Remove.
bc0a5c13 5913 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 5914 (read1): Do not accept +. and -. as integers; this
452f4150
PE
5915 appears to have been a coding error. Similarly, do not accept
5916 strings like +-1e0 as floating point numbers. Do not report
5917 overflow for integer overflows unless the base is not 10 which
5918 means we have no simple and reliable way to continue.
5919 Break out the floating-point parsing into a new
5920 function string_to_number, so that Fstring_to_number parses
5921 floating point numbers consistently with the Lisp reader.
04f2d78b 5922 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
5923 (E_CHAR, EXP_INT): Remove, replacing with ...
5924 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
5925 (string_to_number): New function, replacing isfloat_string.
5926 This function checks for valid syntax and produces the resulting
5927 Lisp float number too. Rework it so that string-to-number
bc0a5c13 5928 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
5929 so that overflow for non-base-10 numbers is reported only when
5930 there's no portable and simple way to convert to floating point.
452f4150 5931
67769ffc
PE
5932 * textprop.c (set_text_properties_1): Rewrite for clarity,
5933 and to avoid GCC warning about integer overflow.
5934
c20db43f
PE
5935 * intervals.h (struct interval): Use EMACS_INT for members
5936 where EMACS_UINT might cause problems. See
5937 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
5938 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
5939 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
5940 All uses changed.
37aa2f85
PE
5941 (offset_intervals): Tell GCC not to worry about length overflow
5942 when negating a negative length.
c20db43f 5943
2538aa2f
PE
5944 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
5945 (overrun_check_free): Likewise.
5946
f2d3008d
PE
5947 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
5948 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
5949 word size.
5950
ec8df744
PE
5951 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5952 (gnutls_make_error): Rename local to avoid shadowing.
5953 (gnutls_emacs_global_deinit): ifdef out; not used.
5954 (Fgnutls_boot): Use const for pointer to readonly storage.
5955 Comment out unused local. Fix pointer signedness problems.
5956
640ee02d
PE
5957 * lread.c (openp): Don't stuff size_t into an 'int'.
5958 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
5959 about possible signed overflow.
5960
6048fb2a
PE
5961 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
5962 (GDK_KEY_g): Don't define if already defined.
5963 (xg_prepare_tooltip): Avoid pointer signedness problem.
5964 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
5965
fa3c87e1
PE
5966 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
5967 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
5968
2172544b
PE
5969 * xfns.c (Fx_window_property): Simplify a bit,
5970 to make a bit faster and to avoid GCC 4.6.0 warning.
5971 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
5972
9b821a21
PE
5973 * fns.c (internal_equal): Don't assume size_t fits in int.
5974
3c616cfa
PE
5975 * alloc.c (compact_small_strings): Tighten assertion a little.
5976
c2982e87
PE
5977 Replace pEd with more-general pI, and fix some printf arg casts.
5978 * lisp.h (pI): New macro, generalizing old pEd macro to other
5979 conversion specifiers. For example, use "...%"pI"d..." rather
5980 than "...%"pEd"...".
5981 (pEd): Remove. All uses replaced with similar uses of pI.
5982 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
5983 * alloc.c (check_pure_size): Don't overflow by converting size to int.
5984 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
5985 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
5986 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
5987 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
5988 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
5989 64-bit hosts.
5990 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
5991 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
5992 * print.c (safe_debug_print, print_object): Likewise.
5993 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
5994 to int.
6f04d126
PE
5995 Use pI instead of if-then-else-abort. Use %p to avoid casts,
5996 avoiding the 0 flag, which is not portable.
c2982e87
PE
5997 * process.c (Fmake_network_process): Use pI to avoid cast.
5998 * region-cache.c (pp_cache): Likewise.
5999 * xdisp.c (decode_mode_spec): Likewise.
6000 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
6001 behavior on 64-bit hosts with printf arg.
6f04d126 6002 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
6003 (x_stop_queuing_selection_requests): Likewise.
6004 (x_get_window_property): Don't truncate byte count to an 'int'
6005 when tracing.
0b432f21 6006
5e073ec7
PE
6007 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
6008 here, since it parses constructs like leading '-' and spaces,
6009 which are not wanted; and it overflows with large numbers.
6010 Instead, simply match F[0-9]+, which is what is wanted anyway.
6011
36372bf9
PE
6012 * alloc.c: Remove unportable assumptions about struct layout.
6013 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
6014 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
6015 (allocate_vectorlike, make_pure_vector): Use the new macros,
6016 plus offsetof, to remove unportable assumptions about struct layout.
6017 These assumptions hold on all porting targets that I know of, but
6018 they are not guaranteed, they're easy to remove, and removing them
6019 makes further changes easier.
6020
0b432f21
PE
6021 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
6022 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
6023 (string_overrun_cookie): Now const. Use initializers that
6024 don't formally overflow signed char, to avoid warnings.
000098c1
PE
6025 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
6026 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
6027 (allocate_buffer): Don't assume sizeof (struct buffer) is a
6028 multiple of sizeof (EMACS_INT); it need not be, if
6029 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 6030 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 6031
895009e1
JB
60322011-04-26 Juanma Barranquero <lekktu@gmail.com>
6033
6034 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
6035
6a7a1b0b
TZ
60362011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
6037
6038 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 6039 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
6040 Reported by Paul Eggert <eggert@cs.ucla.edu>.
6041
841a1577 60422011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
6043
6044 * lisp.h (Qdebug): List symbol.
895009e1 6045 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
6046 * keyboard.c (debug-on-event): New variable.
6047 (handle_user_signal): Break into debugger when debug-on-event
6048 matches the current signal symbol.
6049
f2d3ba6f
DN
60502011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
6051
6052 * alloc.c (check_sblock, check_string_bytes)
6053 (check_string_free_list): Convert to standard C.
6054
42ce4c63
TZ
60552011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
6056
6057 * w32.c (emacs_gnutls_push): Fix typo.
6058
825cd63c
EZ
60592011-04-25 Eli Zaretskii <eliz@gnu.org>
6060
fb11d64d
EZ
6061 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
6062 "cast to pointer from integer of different size".
6063
825cd63c
EZ
6064 Improve doprnt and its use in verror. (Bug#8545)
6065 * doprnt.c (doprnt): Document the set of format control sequences
6066 supported by the function. Use SAFE_ALLOCA instead of always
6067 using `alloca'.
6068
6069 * eval.c (verror): Don't limit the buffer size at size_max-1, that
6070 is one byte too soon. Don't use xrealloc; instead xfree and
6071 xmalloc anew.
6072
e061a11b
TZ
60732011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
6074
6075 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
6076 callbacks stage.
6077
6078 * gnutls.c: Renamed global_initialized to
6079 gnutls_global_initialized. Added internals for the
6080 :verify-hostname-error, :verify-error, and :verify-flags
6081 parameters of `gnutls-boot' and documented those parameters in the
6082 docstring. Start callback support.
9173deec
JB
6083 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
6084 unless a fatal error occurred. Call gnutls_alert_send_appropriate
6085 on error. Return error code.
e061a11b
TZ
6086 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
6087 (emacs_gnutls_read): Likewise.
6088 (Fgnutls_boot): Return handshake error code.
6089 (emacs_gnutls_handle_error): New function.
6090 (wsaerror_to_errno): Likewise.
6091
6092 * w32.h (emacs_gnutls_pull): Add prototype.
6093 (emacs_gnutls_push): Likewise.
6094
6095 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
6096 (emacs_gnutls_push): Likewise.
6097
60982011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
6099
6100 * process.c (wait_reading_process_output): Check if GnuTLS
6101 buffered some data internally if no FDs are set for TLS
6102 connections.
6103
6104 * makefile.w32-in (OBJ2): Add gnutls.$(O).
6105 (LIBS): Link to USER_LIBS.
6106 ($(BLD)/gnutls.$(0)): New target.
6107
fa6996bc
EZ
61082011-04-24 Eli Zaretskii <eliz@gnu.org>
6109
eb35682e
EZ
6110 * xdisp.c (handle_single_display_spec): Rename the
6111 display_replaced_before_p argument into display_replaced_p, to
6112 make it consistent with the commentary. Fix typos in the
6113 commentary.
6114
e2ad650c
EZ
6115 * textprop.c (syms_of_textprop): Remove dead code.
6116 (copy_text_properties): Delete obsolete commentary about an
6117 interface that was deleted long ago. Fix typos in the description
6118 of arguments.
6119
1b2de274
EZ
6120 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
6121 to changes in oldXMenu/XMenu.h from 2011-04-16.
6122 <menu_help_message, prev_menu_help_message>: Constify.
6123 (IT_menu_make_room): menu->help_text is now `const char **';
6124 adjust.
6125
6126 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
6127 to changes in oldXMenu/XMenu.h from 2011-04-16.
6128 (struct XMenu): Declare `help_text' `const char **'.
6129
6130 * xfaces.c <Qunspecified>: Make extern again.
6131
6132 * syntax.c: Include sys/types.h before including regex.h, as
6133 required by Posix.
6134
762b15be
EZ
6135 * doc.c (get_doc_string): Improve the format passed to `error'.
6136
6137 * doprnt.c (doprnt): Improve commentary.
6138
6139 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
6140
6141 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
6142 them with etags.
6143
f1052e5d
EZ
6144 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
6145 changes in globals.h immediately force recompilation.
762b15be
EZ
6146 (TAGS): Depend on $(CURDIR)/m/intel386.h and
6147 $(CURDIR)/s/ms-w32.h.
6148 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 6149
fa6996bc
EZ
6150 * character.c (Fchar_direction): Function deleted.
6151 (syms_of_character): Don't defsubr it.
6152 <char-direction-table>: Deleted.
6153
e6c3da20
EZ
61542011-04-23 Eli Zaretskii <eliz@gnu.org>
6155
6156 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
6157 * doprnt.c: Include limits.h.
6158 (SIZE_MAX): New macro.
04f2d78b
CB
6159 (doprnt): Return a size_t value. 2nd arg is now size_t.
6160 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
6161 Improve overflow protection. Support `l' modifier for integer
6162 conversions. Support %l conversion. Don't assume an EMACS_INT
6163 argument for integer conversions and for %c.
6164
6165 * lisp.h (doprnt): Restore prototype.
6166
6167 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
6168 $(SRC)/character.h.
6169
6170 * Makefile.in (base_obj): Add back doprnt.o.
6171
6172 * deps.mk (doprnt.o): Add back prerequisites.
6173 (callint.o): Depend on character.h.
6174
6175 * eval.c (internal_lisp_condition_case): Include the handler
6176 representation in the error message.
6177 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
6178 when breaking from the loop.
6179
6180 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
6181
6182 * callint.c (Fcall_interactively): When displaying error message
6183 about invalid control letter, pass the character's codepoint, not
6184 a pointer to its multibyte form. Improve display of the character
6185 in octal and display also its hex code.
6186
6187 * character.c (char_string): Use %x to display the (unsigned)
6188 codepoint of an invalid character, to avoid displaying a bogus
6189 negative value.
6190
6191 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
6192 `error', not SYMBOL_NAME itself.
6193
6194 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
6195 character arguments to `error'.
6196
6197 * charset.c (check_iso_charset_parameter): Fix incorrect argument
6198 to `error' in error message about FINAL_CHAR argument. Make sure
6199 FINAL_CHAR is a character, and use %c when it is passed as
6200 argument to `error'.
6201
4ffd0d6b 62022011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
6203
6204 * s/ms-w32.h (localtime): Redirect to sys_localtime.
6205
6206 * w32.c: Include <time.h>.
6207 (sys_localtime): New function.
6208
4ffd0d6b 62092011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
6210
6211 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
6212
4ffd0d6b 6213 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 6214
4ffd0d6b 62152011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 6216
4ffd0d6b
GM
6217 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
6218 zombies (Bug#8467).
aac0c6e3 6219
04c56954
EZ
62202011-04-19 Eli Zaretskii <eliz@gnu.org>
6221
6222 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
6223 gl_state.e_property when gl_state.object is Qt.
6224
6225 * insdel.c (make_gap_larger): Remove limitation of buffer size
6226 to <= INT_MAX.
6227
16a43933
CY
62282011-04-18 Chong Yidong <cyd@stupidchicken.com>
6229
6230 * xdisp.c (lookup_glyphless_char_display)
6231 (produce_glyphless_glyph): Handle cons cell entry in
6232 glyphless-char-display.
6233 (Vglyphless_char_display): Document it.
6234
6235 * term.c (produce_glyphless_glyph): Handle cons cell entry in
6236 glyphless-char-display.
6237
4581706e
CY
62382011-04-17 Chong Yidong <cyd@stupidchicken.com>
6239
6240 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
6241
6242 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
6243
6244 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
6245 definition for no-X builds.
6246
4887c6e2 62472011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 6248
fd35b6f9
PE
6249 Static checks with GCC 4.6.0 and non-default toolkits.
6250
5c1ccb01
PE
6251 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
6252
006c5daa
PE
6253 * process.c (keyboard_bit_set): Define only if SIGIO.
6254 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
6255 (send_process): Repair possible setjmp clobbering.
6256
efc736d3
PE
6257 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
6258
4e2fe2e6
PE
6259 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
6260
f97334a2
PE
6261 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
6262
4e75f29d
PE
6263 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
6264 Define only if needed.
6265
90efadd1
PE
6266 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
6267 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 6268 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 6269
3c647824
PE
6270 * dispextern.h (struct redisplay_interface): Rename param
6271 to avoid shadowing.
e264f262 6272 * termhooks.h (struct terminal): Likewise.
761383f4 6273 * xterm.c (xembed_send_message): Likewise.
3c647824 6274
b58c5c4a
PE
6275 * insdel.c (make_gap_smaller): Define only if
6276 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
6277
cad59032
PE
6278 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
6279 it.
6280
c339dc2e
PE
6281 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
6282 so that we aren't warned about unused symbols.
6283
91a3e27b
PE
6284 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
6285
399c71d3 6286 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 6287
8ffc96f5
PE
6288 * xfns.c (x_real_positions): Mark locals as initialized.
6289
eef9bc79
PE
6290 * xmenu.c (xmenu_show): Don't use uninitialized vars.
6291
098db9dd
PE
6292 * xterm.c: Fix problems found by static analysis with other toolkits.
6293 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
6294 (x_dispatch_event): Declare static if USE_GTK, and
6295 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 6296 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 6297 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
6298 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
6299 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 6300
eb18f6cc
PE
6301 * xmenu.c (menu_help_callback): Pointer type fixes.
6302 Use const pointers when pointing at readonly data. Avoid pointer
6303 signedness clashes.
6304 (FALSE): Remove unused macro.
6305 (update_frame_menubar): Remove unused decl.
6306
1fe72bf8
PE
6307 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
6308
60d9e1db
PE
6309 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
6310 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
6311 (single_menu_item): Rename local to avoid shadowing.
6312
39261c26
PE
6313 * keyboard.c (make_lispy_event): Remove unused local var.
6314
018c5e19
PE
6315 * frame.c, frame.h (x_get_resource_string): Bring this back, but
6316 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
6317
63d2b86e
PE
6318 * bitmaps: Change bitmaps from unsigned char back to the X11
6319 compatible char. Avoid the old compiler warnings about
6320 out-of-range initializers by using, for example, '\xab' rather
6321 than 0xab.
6322
aefd87e1
PE
6323 * xgselect.c (xgselect_initialize): Check vs interface
6324 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
6325
bf501fb9
PE
6326 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
6327
e9829fdf
PE
6328 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
6329 to read-only memory.
6330
1086c095
PE
6331 * fns.c (vector): Remove; this old hack is no longer needed.
6332
2baccd04 6333 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 6334 Remove unused var.
dde42981 6335 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 6336
72391843 6337 * xrdb.c (x_load_resources): Omit unused local.
3565b346 6338
436c16df 6339 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 6340 (x_window): Rename locals to avoid shadowing.
dc5ddd85 6341 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 6342
92bb796d 6343 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 6344 (x_term_init): Remove local to avoid shadowing.
92bb796d 6345
764430a3 6346 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
6347
6348 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
6349 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
6350
d1dfb56c
EZ
63512011-04-16 Eli Zaretskii <eliz@gnu.org>
6352
c4354cb4
EZ
6353 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
6354
d1dfb56c
EZ
6355 Fix regex.c, syntax.c and friends for buffers > 2GB.
6356 * syntax.h (struct gl_state_s): Declare character position members
6357 EMACS_INT.
6358
6359 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
6360
04f2d78b
CB
6361 * textprop.c (verify_interval_modification, interval_of):
6362 Declare arguments EMACS_INT.
d1dfb56c
EZ
6363
6364 * intervals.c (adjust_intervals_for_insertion): Declare arguments
6365 EMACS_INT.
6366
6367 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
6368
6369 * indent.c (Fvertical_motion): Local variable it_start is now
6370 EMACS_INT.
6371
6372 * regex.c (re_match, re_match_2, re_match_2_internal)
6373 (bcmp_translate, regcomp, regexec, print_double_string)
6374 (group_in_compile_stack, re_search, re_search_2, regex_compile)
6375 (re_compile_pattern, re_exec): Declare arguments and local
6376 variables `size_t' and `ssize_t' and return values `regoff_t', as
6377 appropriate.
6378 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
6379 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
6380 <compile_stack_type>: `size' and `avail' are now `size_t'.
6381
6382 * regex.h <regoff_t>: Use ssize_t, not int.
6383 (re_search, re_search_2, re_match, re_match_2): Arguments that
6384 specify buffer/string position and length are now ssize_t and
6385 size_t. Return type is regoff_t.
6386
613052cd
BK
63872011-04-16 Ben Key <bkey76@gmail.com>
6388
6389 * nsfont.m: Fixed bugs in ns_get_family and
6390 ns_descriptor_to_entity that were caused by using free to
6391 deallocate memory blocks that were allocated by xmalloc (via
6392 xstrdup). This caused Emacs to crash when compiled with
6393 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
6394 --enable-checking=xmallocoverrun). xfree is now used to
6395 deallocate these memory blocks.
6396
4170f62f 63972011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 6398
71b41406
PE
6399 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
6400
9587a89d
PE
6401 emacs_write: Accept and return EMACS_INT for sizes.
6402 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
6403 et seq.
6404 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
6405 Accept and return EMACS_INT.
6406 (emacs_gnutls_write): Return the number of bytes written on
6407 partial writes.
6408 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
6409 (emacs_read, emacs_write): Remove check for negative size, as the
6410 Emacs source code has been audited now.
9587a89d
PE
6411 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
6412 (emacs_read, emacs_write): Use it.
273a5f82
PE
6413 * process.c (send_process): Adjust to the new signatures of
6414 emacs_write and emacs_gnutls_write. Do not attempt to store
6415 a byte offset into an 'int'; it might overflow.
9587a89d 6416 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 6417
3e047f51
PE
6418 * sound.c: Don't assume sizes fit in 'int'.
6419 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 6420 Return EMACS_INT, not int.
3e047f51 6421 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
6422 Accept EMACS_INT, not int.
6423 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
6424 record read return values.
6425
cc39a9db
BK
64262011-04-15 Ben Key <bkey76@gmail.com>
6427
c9d0ec6d
JB
6428 * keyboard.c (Qundefined): Don't declare static since it is used
6429 in nsfns.m.
6430 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
6431 static since they are used in nsfont.m.
cc39a9db 6432
6c60eb9f
SM
64332011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
6434
6435 * process.c (Qprocessp): Don't declare static.
6436 * lisp.h (Qprocessp): Declare again.
6437
7990b61a
JB
64382011-04-15 Juanma Barranquero <lekktu@gmail.com>
6439
6440 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
6441
5d4cb038
PE
64422011-04-14 Paul Eggert <eggert@cs.ucla.edu>
6443
8bd7b830 6444 Improve C-level modularity by making more things 'static'.
cd64ea1d 6445
e3b27b31
PE
6446 Don't publish debugger-only interfaces to other modules.
6447 * lisp.h (safe_debug_print, debug_output_compilation_hack):
6448 (verify_bytepos, count_markers): Move decls to the only modules
6449 that need them.
6450 * region-cache.h (pp_cache): Likewise.
6451 * window.h (check_all_windows): Likewise.
6452 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
6453
5d4cb038
PE
6454 * sysdep.c (croak): Now static, if
6455 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
6456 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
6457
6458 * alloc.c (refill_memory_reserve): Now static if
6459 !defined REL_ALLOC || defined SYSTEM_MALLOC.
6460 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 6461
e87b6180
PE
6462 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
6463 Define only if USE_LUCID.
6464
ac64929e
PE
6465 * xrdb.c (x_customization_string, x_rm_string): Now static.
6466
6f37259d
PE
6467 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
6468 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
6469
1683e3ab
PE
6470 * xdisp.c (draw_row_with_mouse_face): Now static.
6471 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
6472
de9c2632
PE
6473 * window.h (check_all_windows): Mark externally visible.
6474
2b96acb7
PE
6475 * window.c (window_deletion_count): Now static.
6476
6477 * undo.c: Make symbols static if they're not exported.
6478 (last_undo_buffer, last_boundary_position, pending_boundary):
6479 Now static.
6480
50436f33
PE
6481 * textprop.c (interval_insert_behind_hooks): Now static.
6482 (interval_insert_in_front_hooks): Likewise.
6483
64520e5c
PE
6484 * term.c: Make symbols static if they're not exported.
6485 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
6486 (max_frame_lines, tty_set_terminal_modes):
6487 (tty_reset_terminal_modes, tty_turn_off_highlight):
6488 (get_tty_terminal): Now static.
6489 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
6490 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 6491 HAVE_WINDOW_SYSTEM.
64520e5c
PE
6492 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
6493 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
6494
1fa53021
PE
6495 * sysdep.c: Make symbols static if they're not exported.
6496 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
6497 Now static.
6498 (sigprocmask_set, full_mask): Remove; unused.
6499 (wait_debugging): Mark as visible.
6500 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
6501 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
6502
d4b43b22
PE
6503 * syntax.c (syntax_temp): Define only if !__GNUC__.
6504
b7c513d0
PE
6505 * sound.c (current_sound_device, current_sound): Now static.
6506
989b29ad
PE
6507 * search.c (searchbufs, searchbuf_head): Now static.
6508
13a55a78
PE
6509 * scroll.c (scroll_cost): Remove; unused.
6510 * dispextern.h (scroll_cost): Remove decl.
6511
de68a1fc
PE
6512 * region-cache.h (pp_cache): Mark as externally visible.
6513
40ccffa6
PE
6514 * process.c: Make symbols static if they're not exported.
6515 (process_tick, update_tick, create_process, chan_process):
6516 (Vprocess_alist, proc_buffered_char, datagram_access):
6517 (fd_callback_data, send_process_frame, process_sent_to): Now static.
6518 (deactivate_process): Mark defn as static, as well as decl.
6519 * lisp.h (create_process): Remove decl.
6520 * process.h (chan_process, Vprocess_alist): Remove decls.
6521
ad64fc97
PE
6522 * print.c: Make symbols static if they're not exported.
6523 (print_depth, new_backquote_output, being_printed, print_buffer):
6524 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
6525 (print_interval, print_number_index, initial_stderr_stream):
6526 Now static.
6527 * lisp.h (Fprinc): Remove decl.
6528 (debug_output_compilation_hack): Mark as externally visible.
6529
adddb265
PE
6530 * sysdep.c (croak): Move decl from here to syssignal.h.
6531 * syssignal.h (croak): Put it here, so the API can be checked when
6532 'croak' is called from dissociate_if_controlling_tty.
6533
1717ede2
PE
6534 * minibuf.c: Make symbols static if they're not exported.
6535 (minibuf_save_list, choose_minibuf_frame): Now static.
6536 * lisp.h (choose_minibuf_frame): Remove decl.
6537
fa5fb2bc
PE
6538 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
6539
1e3890d1
PE
6540 * lread.c: Make symbols static if they're not exported.
6541 (read_objects, initial_obarray, oblookup_last_bucket_number):
6542 Now static.
6543 (make_symbol): Remove; unused.
6544 * lisp.h (initial_obarray, make_symbol): Remove decls.
6545
8a1414fa
PE
6546 * keyboard.c: Make symbols static if they're not exported.
6547 (single_kboard, recent_keys_index, total_keys, recent_keys):
6548 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
6549 (this_single_command_key_start, echoing, last_auto_save):
6550 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
6551 (command_loop, echo_now, keyboard_init_hook, help_char_p):
6552 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
6553 (Vlispy_mouse_stem, double_click_count):
6554 Now static.
6555 (force_auto_save_soon): Define only if SIGDANGER.
6556 (ignore_mouse_drag_p): Now static if
6557 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
6558 (print_help): Remove; unused.
6559 (stop_character, last_timer_event): Mark as externally visible.
6560 * keyboard.h (ignore_mouse_drag_p): Declare only if
6561 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
6562 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
6563 * lisp.h (echoing): Remove decl.
6564 (force_auto_save_soon): Declare only if SIGDANGER.
6565 * xdisp.c (redisplay_window): Simplify code, to make it more
6566 obvious that ignore_mouse_drag_p is not accessed if !defined
6567 USE_GTK && !defined HAVE_NS.
6568
93ea6e8f
PE
6569 * intervals.c: Make symbols static if they're not exported.
6570 (merge_properties_sticky, merge_interval_right, delete_interval):
6571 Now static.
6572 * intervals.h (merge_interval_right, delete_interval): Remove decls.
6573
77382fcc
PE
6574 * insdel.c: Make symbols static if they're not exported.
6575 However, leave prepare_to_modify_buffer alone. It's never
6576 called from outside this function, but that appears to be a bug.
6577 (combine_after_change_list, combine_after_change_buffer):
4889fc82 6578 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
6579 (adjust_after_replace_noundo): Remove; unused.
6580 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 6581 (signal_before_change): Remove decls.
77382fcc 6582
9306c32e
PE
6583 * indent.c (val_compute_motion, val_vmotion): Now static.
6584
cd44d2eb
PE
6585 * image.c: Make symbols static if they're not exported.
6586 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
6587 if USE_GTK.
6588 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
6589 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
6590
ad9a7a06
PE
6591 * fringe.c (standard_bitmaps): Now static.
6592 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
6593
81626931
PE
6594 * frame.c: Make symbols static if they're not exported.
6595 (x_report_frame_params, make_terminal_frame): Now static.
6596 (get_frame_param): Now static, unless HAVE_NS.
6597 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
6598 (x_get_resource_string): Remove; not used.
6599 * frame.h (make_terminal_frame, x_report_frame_params):
6600 (x_get_resource_string); Remove decls.
6601 (x_fullscreen_adjust): Declare only if WINDOWSNT.
6602 * lisp.h (get_frame_param): Declare only if HAVE_NS.
6603
239f9db9
PE
6604 * font.c, fontset.c: Make symbols static if they're not exported.
6605 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
6606 (FACE_SUITABLE_FOR_CHAR_P): Use it.
6607 * font.c (font_close_object): Now static.
6608 * font.h (font_close_object): Remove.
6609 * fontset.c (FONTSET_OBJLIST): Remove.
6610 (free_realized_fontset) #if-0 the body, which does nothing.
6611 (face_suitable_for_char_p): #if-0, as it's never called.
6612 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
6613 * xfaces.c (face_at_string_position):
6614 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
6615 since 0 is always ASCII.
6616
dfcf3579
PE
6617 * fns.c (weak_hash_tables): Now static.
6618
5045092b
PE
6619 * fileio.c: Make symbols static if they're not exported.
6620 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
6621 (Vwrite_region_annotation_buffers): Now static.
6622
57a96f5c
PE
6623 * eval.c: Make symbols static if they're not exported.
6624 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
6625 * lisp.h (backtrace_list): Remove decl.
6626
35f08c38
PE
6627 * emacs.c: Make symbols static if they're not exported.
6628 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
6629 (fatal_error_code, fatal_error_signal_hook, standard_args):
6630 Now static.
6631 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
6632 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
6633 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
6634 * lisp.h (fatal_error_signal_hook): Remove decl.
6635 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
6636
f44bd759
PE
6637 * editfns.c: Move a (normally-unused) function to its only use.
6638 * editfns.c, lisp.h (get_operating_system_release): Remove.
6639 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
6640 worth the hassle of breaking this out.
6641
b532497d
PE
6642 * xterm.c: Make symbols static if they're not exported.
6643 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
6644 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
6645 (x_destroy_window, x_delete_display):
6646 Now static.
6647 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
6648 (x_mouse_leave): Remove; unused.
6649 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
6650 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
6651 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
6652 Remove decls.
6653 (x_mouse_leave): Declare only if WINDOWSNT.
6654 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
6655 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
6656 USE_X_TOOLKIT.
6657
1675728f
PE
6658 * ftxfont.c: Make symbols static if they're not exported.
6659 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
6660 HAVE_FREETYPE.
6661 * font.h (ftxfont_driver): Likewise.
6662
e4cebfca
PE
6663 * xfns.c: Make symbols static if they're not exported.
6664 (x_last_font_name, x_display_info_for_name):
6665 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
6666 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
6667 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
6668 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
6669 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
6670 (last_show_tip_args): Now static.
6671 (xic_defaut_fontset, xic_create_fontsetname): Define only if
6672 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
6673 (x_screen_planes): Remove; unused.
6674 * dispextern.h (x_screen_planes): Remove decl.
6675
5bf46f05
PE
6676 * dispnew.c: Make symbols static if they're not exported.
6677 * dispextern.h (redraw_garbaged_frames, scrolling):
6678 (increment_row_positions): Remove.
6679 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
6680 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
6681 Now static.
6682 (redraw_garbaged_frames): Remove; unused.
6683
435f4c28
PE
6684 * xfaces.c: Make symbols static if they're not exported.
6685 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
6686 Remove decls.
6687 * xterm.h (defined_color): Remove decls.
6688 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
6689 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
6690 (menu_face_changed_default, defined_color, free_realized_face):
6691 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
6692 (ascii_face_of_lisp_face): Remove; unused.
6693
8524aef3
PE
6694 * xdisp.c: Make symbols static if they're not exported.
6695 * dispextern.h (scratch_glyph_row, window_box_edges):
6696 (glyph_to_pixel_coords, set_cursor_from_row):
6697 (get_next_display_element, set_iterator_to_next):
6698 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
6699 (show_mouse_face): Remove decls
6700 * frame.h (message_buf_print): Likewise.
6701 * lisp.h (pop_message, set_message, check_point_in_composition):
6702 Likewise.
6703 * xterm.h (set_vertical_scroll_bar): Likewise.
6704 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
6705 (message_buf_print, scratch_glyph_row, displayed_buffer):
6706 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
6707 (get_next_display_element, show_mouse_face, window_box_edges):
6708 (frame_to_window_pixel_xy, check_point_in_composition):
6709 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
6710 (glyph_to_pixel_coords): Remove; unused.
6711
16390cd2
PE
6712 * dired.c (file_name_completion): Now static.
6713
6714 * dbusbind.c (xd_in_read_queued_messages): Now static.
6715
a25f4dfa
PE
6716 * lisp.h (circular_list_error, FOREACH): Remove; unused.
6717 * data.c (circular_list_error): Remove.
6718
14a9c8df
PE
6719 * commands.h (last_point_position, last_point_position_buffer):
6720 (last_point_position_window): Remove decls.
6721 * keyboard.c: Make these variables static.
6722
04f2d78b
CB
6723 * coding.h (coding, code_convert_region, encode_coding_gap):
6724 Remove decls.
74ab6df5
PE
6725 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
6726 (iso_code_class, detect_coding, code_convert_region): Now static.
6727 (encode_coding_gap): Remove; unused.
6728
38dfbee1
PE
6729 * chartab.c (chartab_chars, chartab_bits): Now static.
6730
a2cb4e63
PE
6731 * charset.h (charset_iso_8859_1): Remove decl.
6732 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
6733 Now static.
6734
127198fd
PE
6735 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
6736 * ccl.c (Vccl_program_table): Now static.
6737 (check_ccl_update): Remove; unused.
6738
d85b608f
PE
6739 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
6740 * category.h: ... from here.
6741 * category.c (check_category_table, set_category_set): Now static.
6742
31cd66f3
PE
6743 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
6744 * lisp.h: Remove these decls.
6745
c358e587
PE
6746 * buffer.c (buffer_count): Remove unused var.
6747
e78aecca
PE
6748 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
6749 so that it's not optimized away.
6750 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
6751 * dispextern.h (bidi_dump_cached_states): Remove, since it's
6752 exported only to the debugger.
6753
e192d7d3 6754 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 6755 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 6756
92470028
PE
6757 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
6758 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
6759 was inaccessible from Lisp.
6760 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
6761 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
6762
244ed907
PE
6763 alloc.c: Import and export fewer symbols, and remove unused items.
6764 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
6765 is defined.
6766 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
6767 it's not optimized away by whole-program optimization.
6768 (message_enable_multibyte, free_misc): Remove.
6769 (catchlist, handlerlist, mark_backtrace):
6770 Declare only if BYTE_MARK_STACK.
6771 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
6772 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
6773 (message_enable_multibyte): Remove decl.
6774 (free_misc, interval_free_list, float_block, float_block_index):
6775 (n_float_blocks, float_free_list, cons_block, cons_block_index):
6776 (cons_free_list, last_marked_index):
6777 Now static.
6778 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
6779 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
6780 (mark_backtrace): Define only if BYTE_MARK_STACK.
6781 * xdisp.c (message_enable_multibyte): Now static.
6782
61c2b50e 6783 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
6784 This makes it easier for human readers (and static analyzers)
6785 to see whether these variables are used from other modules.
6786 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
6787 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
6788 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
6789 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
6790 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
6791 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
6792 * xmenu.c, xselect.c:
6793 Declare Q* vars static if they are not used in other modules.
6794 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
6795 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
6796 Remove decls of unexported vars.
6797 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
6798
95c82688
PE
6799 * lisp.h (DEFINE_FUNC): Make sname 'static'.
6800
16a97296
PE
6801 Make Emacs functions such as Fatom 'static' by default.
6802 This makes it easier for human readers (and static analyzers)
6803 to see whether these functions can be called from other modules.
6804 DEFUN now defines a static function. To make the function external
6805 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
6806 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
6807 (Finit_image_library):
16a97296
PE
6808 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
6809 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
6810 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
6811 Remove decls, since these functions are now static.
6812 (Funintern, Fget_internal_run_time): New decls, since these functions
6813 were already external.
95c82688 6814
16a97296
PE
6815 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
6816 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
6817 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
6818 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
6819 * keyboard.c, keymap.c, lread.c:
6820 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
6821 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
6822 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
6823 Mark functions with DEFUE instead of DEFUN,
6824 if they are used in other modules.
6825 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
6826 decls for now-static functions.
6827 * buffer.h (Fdelete_overlay): Remove decl.
6828 * callproc.c (Fgetenv_internal): Mark as internal.
6829 * composite.c (Fremove_list_of_text_properties): Remove decl.
6830 (Fcomposition_get_gstring): New forward static decl.
6831 * composite.h (Fcomposite_get_gstring): Remove decl.
6832 * dired.c (Ffile_attributes): New forward static decl.
6833 * doc.c (Fdocumntation_property): New forward static decl.
6834 * eval.c (Ffetch_bytecode): New forward static decl.
6835 (Funintern): Remove extern decl; now in .h file where it belongs.
6836 * fileio.c (Fmake_symbolic_link): New forward static decl.
6837 * image.c (Finit_image_library): New forward static decl.
6838 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
6839 * intervals.h (Fprevious_property_change):
6840 (Fremove_list_of_text_properties): Remove decls.
6841 * keyboard.c (Fthis_command_keys): Remove decl.
6842 (Fcommand_execute): New forward static decl.
6843 * keymap.c (Flookup_key): New forward static decl.
6844 (Fcopy_keymap): Now static.
6845 * keymap.h (Flookup_key): Remove decl.
6846 * process.c (Fget_process): New forward static decl.
6847 (Fprocess_datagram_address): Mark as internal.
6848 * syntax.c (Fsyntax_table_p): New forward static decl.
6849 (skip_chars): Remove duplicate decl.
6850 * textprop.c (Fprevious_property_change): New forward static decl.
6851 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
6852 Now internal.
6853 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
6854 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
6855
785bbd42
PE
6856 * editfns.c (Fformat): Remove unreachable code.
6857
8b913b57
AS
68582011-04-14 Andreas Schwab <schwab@linux-m68k.org>
6859
6860 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
6861 change. (Bug#8496)
6862
a6744a35
EZ
68632011-04-13 Eli Zaretskii <eliz@gnu.org>
6864
6865 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
6866 when at ZV. (Bug#8487)
6867
e7974947
AS
68682011-04-12 Andreas Schwab <schwab@linux-m68k.org>
6869
baad03f0
AS
6870 * charset.c (Fclear_charset_maps): Use xfree instead of free.
6871 (Bug#8437)
6872 * keyboard.c (parse_tool_bar_item): Likewise.
6873 * sound.c (sound_cleanup, alsa_close): Likewise.
6874 * termcap.c (tgetent): Likewise.
6875 * xfns.c (x_default_font_parameter): Likewise.
6876 * xsettings.c (read_and_apply_settings): Likewise.
6877
e7974947
AS
6878 * alloc.c (overrun_check_malloc, overrun_check_realloc)
6879 (overrun_check_free): Protoize.
6880
28272684
PE
68812011-04-12 Paul Eggert <eggert@cs.ucla.edu>
6882
6883 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
6884 since callers should never pass a negative size.
6885 Change the signature to match that of plain 'read' and 'write'; see
6886 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
6887 * lisp.h: Update prototypes of emacs_write and emacs_read.
6888
11997c76
EZ
68892011-04-11 Eli Zaretskii <eliz@gnu.org>
6890
6891 * xdisp.c (redisplay_window): Don't try to determine the character
6892 position of the scroll margin if the window start point w->startp
e896f03c 6893 is outside the buffer's accessible region. (Bug#8468)
11997c76 6894
8a2cbd72
EZ
68952011-04-10 Eli Zaretskii <eliz@gnu.org>
6896
6897 Fix write-region and its subroutines for buffers > 2GB.
6898 * fileio.c (a_write, e_write): Modify declaration of arguments and
6899 local variables to support buffers larger than 2GB.
6900 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
6901
6902 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
6903 argument, local variables, and return value.
6904
6905 * lisp.h: Update prototypes of emacs_write and emacs_read.
6906
6907 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
6908
4073e537 69092011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 6910
1ebfdcb6
PE
6911 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
6912
b2ded58d
PE
6913 Fix more problems found by GCC 4.6.0's static checks.
6914
7d66342c
PE
6915 * xdisp.c (vmessage): Use a better test for character truncation.
6916
bbf47d44
PE
6917 * charset.c (load_charset_map): <, not <=, for optimization,
6918 and to avoid potential problems with integer overflow.
9248994d 6919 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 6920 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 6921 * editfns.c (Fformat): Likewise.
1e69125e 6922 * syntax.c (skip_chars): Likewise.
3befa583 6923
e3019616
PE
6924 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
6925 This also lets GCC 4.6.0 generate slightly better loop code.
6926
becfa255
PE
6927 * callint.c (Fcall_interactively): <, not <=, for optimization.
6928 (Fcall_interactively): Count the number of arguments produced,
6929 not the number of arguments given. This is simpler and lets GCC
6930 4.6.0 generate slightly better code.
6931
dae0cd48
PE
6932 * ftfont.c: Distingish more carefully between FcChar8 and char.
6933 The previous code passed unsigned char * to a functions like
6934 strlen and xstrcasecmp that expect char *, which does not
6935 conform to the C standard.
6936 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
6937 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
6938 char * when the C standard requires it.
6939
76032d70
PE
6940 * keyboard.c (read_char): Remove unused var.
6941
eb3f1cc8
PE
6942 * eval.c: Port to Windows vsnprintf (Bug#8435).
6943 Include <limits.h>.
6944 (SIZE_MAX): Define if the headers do not.
6945 (verror): Do not give up if vsnprintf returns a negative count.
6946 Instead, grow the buffer. This ports to Windows vsnprintf, which
6947 does not conform to C99. Problem reported by Eli Zaretskii.
6948 Also, simplify the allocation scheme, by avoiding the need for
6949 calling realloc, and removing the ALLOCATED variable.
6950
70476b54
PE
6951 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
6952
12020a9e
PE
6953 Remove invocations of doprnt, as Emacs now uses vsnprintf.
6954 But keep the doprint source code for now, as we might revamp it
6955 and use it again (Bug#8435).
ea6c7ae6
PE
6956 * lisp.h (doprnt): Remove.
6957 * Makefile.in (base_obj): Remove doprnt.o.
6958 * deps.mk (doprnt.o): Remove.
6959
5fdb398c
PE
6960 error: Print 32- and 64-bit integers portably (Bug#8435).
6961 Without this change, on typical 64-bit hosts error ("...%d...", N)
6962 was used to print both 32- and 64-bit integers N, which relied on
6963 undefined behavior.
6964 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
6965 New macro.
6966 * lisp.h (error, verror): Mark as printf-like functions.
6967 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
6968 Report overflow in size calculations when allocating printf buffer.
6969 Do not truncate output string at its first null byte.
6970 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
6971 Truncate the output at a character boundary, since vsnprintf does not
6972 do that.
6973 * charset.c (check_iso_charset_parameter): Convert internal
6974 character to string before calling 'error', since %c now has the
6975 printf meaning.
6976 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
6977 overflow when computing char to be passed to 'error'. Do not
6978 pass Lisp_Object to 'error'; pass the integer instead.
6979 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
6980 formatted with plain %d.
6981
b189fa66
PE
6982 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
6983
bff87ef0
PE
6984 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
6985
7e2cac20
PE
6986 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
6987
ce4d90b5
PE
6988 * xterm.c (x_catch_errors): Remove duplicate declaration.
6989
266c9547
PE
6990 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
6991
79c49ad2
PE
6992 * xdisp.c, lisp.h (message_nolog): Remove; unused.
6993
368f4090
JM
69942011-04-10 Jim Meyering <meyering@redhat.com>
6995
6996 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
6997 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
6998 return ssize_t not "int", and use size_t as the buffer length.
6999 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
7000 * gnutls.h: Update declarations.
7001 * process.c (read_process_output): Use ssize_t, to match.
7002 (send_process): Likewise.
7003
a32d4040
CY
70042011-04-09 Chong Yidong <cyd@stupidchicken.com>
7005
7006 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
7007
8546720e 70082011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 7009
04f2d78b
CB
7010 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
7011 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 7012
8546720e
GM
7013 * xterm.c (handle_one_xevent):
7014 * xmenu.c (create_and_show_popup_menu):
7015 * xselect.c (x_decline_selection_request)
7016 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 7017
0a2f5c1a 70182011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
7019
7020 Fix some uses of `int' instead of EMACS_INT.
7021 * search.c (string_match_1, fast_string_match)
7022 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
7023 (scan_buffer, find_next_newline_no_quit)
7024 (find_before_next_newline, search_command, Freplace_match)
7025 (Fmatch_data): Make some `int' variables be EMACS_INT.
7026
7027 * xdisp.c (display_count_lines): 3rd argument and return value now
7028 EMACS_INT. All callers changed.
7029 (pint2hrstr): Last argument is now EMACS_INT.
7030
7031 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
7032 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
7033 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
7034 (decode_coding_utf_16, decode_coding_emacs_mule)
7035 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
7036 (decode_coding_ccl, decode_coding_charset)
7037 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
7038 (decode_coding_iso_2022, decode_coding_emacs_mule)
7039 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
7040 <char_offset, last_offset>: Declare EMACS_INT.
7041 (encode_coding_utf_8, encode_coding_utf_16)
7042 (encode_coding_emacs_mule, encode_invocation_designation)
7043 (encode_designation_at_bol, encode_coding_iso_2022)
7044 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
7045 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
7046 Declare EMACS_INT.
7047 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
7048 (encode_invocation_designation): Last argument P_NCHARS is now
7049 EMACS_INT.
7050 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
7051 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
7052
7053 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
7054 All users changed.
7055
7056 * ccl.c (Fccl_execute_on_string): Declare some variables
7057 EMACS_INT.
7058
8546720e 70592011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
7060
7061 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
7062
4e19a977
CS
70632011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
7064
7065 * process.c (Fformat_network_address): Doc fix.
7066
87302331
R
70672011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
7068
7069 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
7070
cbb59342
CY
70712011-04-08 Chong Yidong <cyd@stupidchicken.com>
7072
7073 * keyboard.c (read_char): Call Lisp function help-form-show,
7074 instead of using internal_with_output_to_temp_buffer.
7075 (Qhelp_form_show): New var.
e0d38eeb 7076 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
7077
7078 * print.c (internal_with_output_to_temp_buffer): Function deleted.
7079
7080 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
7081
e67a13ab
CY
70822011-04-06 Chong Yidong <cyd@stupidchicken.com>
7083
04f2d78b
CB
7084 * process.c (Flist_processes): Remove to Lisp.
7085 (list_processes_1): Delete.
e67a13ab 7086
973f782d
EZ
70872011-04-06 Eli Zaretskii <eliz@gnu.org>
7088
7c106b1e
EZ
7089 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
7090
973f782d
EZ
7091 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
7092
41cf7d1a 70932011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 7094
ca23cc88
PE
7095 Fix more problems found by GCC 4.6.0's static checks.
7096
f390e2d5
PE
7097 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
7098
42eea0d0
PE
7099 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
7100
b69769da 7101 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 7102
f9541e84
PE
7103 * xdisp.c (vmessage): Mark as a printf-like function.
7104
13841b55
PE
7105 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
7106
c136c10f
PE
7107 * sound.c (sound_warning): Don't crash if arg contains a printf format.
7108
5e2d4a30
PE
7109 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
7110 printf-like functions.
7111 (tiff_load): Add casts to remove these marks before passing them
7112 to system-supplied API.
7113
583f48b9
PE
7114 * eval.c (Fsignal): Remove excess argument to 'fatal'.
7115
b25d760e
PE
7116 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
7117 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
7118 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
7119 directly, rather than having caller test rule sign. This avoids
7120 some unnecessary tests.
7121 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
7122 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
7123 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 7124
bc7b6697 7125 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 7126 (xfont_open): Avoid unnecessary tests.
bc7b6697 7127
27ccc379
PE
7128 * composite.c (composition_gstring_put_cache): Use unsigned integer.
7129
dcd5c89a
PE
7130 * composite.h, composite.c (composition_gstring_put_cache):
7131 Use EMACS_INT, not int, for length.
7132
b13a45c6
PE
7133 * composite.h (COMPOSITION_DECODE_REFS): New macro,
7134 breaking out part of COMPOSITION_DECODE_RULE.
7135 (COMPOSITION_DECODE_RULE): Use it.
7136 * composite.c (get_composition_id): Remove unused local vars,
7137 by using the new macro.
7138
1e792e4d
PE
7139 * textprop.c (set_text_properties_1): Change while to do-while,
7140 since the condition is always true at first.
7141
dc6c6455 7142 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
7143 (interval_deletion_adjustment): Return unsigned value.
7144 All uses changed.
dc6c6455 7145
aba7731a
PE
7146 * process.c (list_processes_1, create_pty, read_process_output):
7147 (exec_sentinel): Remove vars that were set but not used.
afd4052b 7148 (create_pty): Remove unnecessary "volatile"s.
bc57d757 7149 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 7150 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 7151 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 7152
fdfc4bf3
PE
7153 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
7154
fca8fe46 7155 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 7156 (update_syntax_table): Use unsigned instead of int.
fca8fe46 7157
06a0259a 7158 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 7159 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 7160 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 7161
e7b9e80f
PE
7162 * print.c (print_error_message): Avoid int overflow.
7163
56201685
PE
7164 * font.c (font_list_entities): Redo for clarity,
7165 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
7166
78834453 7167 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 7168 (font_score): Avoid potential overflow in diff calculation.
78834453 7169
0bc0b309 7170 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 7171 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 7172
e610eaca
PE
7173 * eval.c (funcall_lambda): Rename local to avoid shadowing.
7174
b895abce
PE
7175 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
7176 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
7177 can always succeed if overflow has undefined behavior.
7178
1f1d9321 7179 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 7180 (wordify): Omit three unnecessary tests.
1f1d9321 7181
c59478bc
PE
7182 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
7183 All callers changed. This avoids the need for an unused var.
7184
79b73827
PE
7185 * casefiddle.c (casify_region): Remove var that is set but not used.
7186
a4db5dfe
PE
7187 * dired.c (file_name_completion): Remove var that is set but not used.
7188
43aae36e
PE
7189 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
7190
2a47c44d 7191 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 7192 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 7193
a37c69bf
PE
7194 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
7195 Check for integer overflow on size calculations.
7196
328ab8e7
PE
7197 * buffer.c (Fprevious_overlay_change): Remove var that is set
7198 but not used.
7199
e5a2a5cb
PE
7200 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
7201 Remove vars that are set but not used.
8d84a6eb 7202 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 7203 (timer_check_2): Mark vars as initialized.
e5a2a5cb 7204
a60e5f68
PE
7205 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
7206
f661cb61 7207 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 7208 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 7209
f0397f5a
PE
7210 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
7211 that are set but not used.
7212
8664db06 7213 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 7214 if XCreateBitmapFromData fails (Bug#8410).
8664db06 7215
6abdaa4a
PE
7216 * xselect.c (x_get_local_selection, x_handle_property_notify):
7217 Remove vars that are set but not used.
7218
0ce7538d 7219 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 7220 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 7221
9ae848fc
PE
7222 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
7223 Remove var that is set but not used.
0b918413
PE
7224 (scroll_bar_windows_size): Now size_t, not int.
7225 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
7226 Check for overflow.
9ae848fc 7227
a5a62657
PE
7228 * xfaces.c (realize_named_face): Remove vars that are set but not used.
7229 (map_tty_color) [!defined MSDOS]: Likewise.
7230
5c5cdd39
PE
7231 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
7232
66ebf983
PE
7233 * coding.c: Remove vars that are set but not used.
7234 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
7235 All callers changed.
7236 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
7237 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
7238 (decode_coding_charset): Remove vars that are set but not used.
7239
1be4d761
PE
7240 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
7241 that is set but not used.
7242
47553fa8
PE
7243 * print.c (print_object): Remove var that is set but not used.
7244
1f7196bf 7245 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
7246 The gnulib version avoids calling malloc in the usual case,
7247 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
7248 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
7249 * filelock.c (current_lock_owner): Likewise.
7250 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
7251 * sysdep.c: Include allocator.h, careadlinkat.h.
7252 (emacs_no_realloc_allocator): New static constant.
7253 (emacs_readlink): New function.
fdb61804
PE
7254 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
7255 ../lib/careadlinkat.h.
d1fdcab7 7256
f84c17c7
SM
72572011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
7258
7259 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
7260 first non-nil return value).
7261
ef3862ad
JD
72622011-04-03 Jan Djärv <jan.h.d@swipnet.se>
7263
7264 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
7265 if not defined (Bug#8403).
7266
376a7006
JB
72672011-04-02 Juanma Barranquero <lekktu@gmail.com>
7268
7269 * xdisp.c (display_count_lines): Remove parameter `start',
7270 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7271 (get_char_face_and_encoding): Remove parameter `multibyte_p',
7272 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7273 (fill_stretch_glyph_string): Remove parameters `row' and `area',
7274 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
7275 and thereabouts. All callers changed.
7276 (get_per_char_metric): Remove parameter `f', unused since
7277 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
7278
6ca3801d
JM
72792011-04-02 Jim Meyering <meyering@redhat.com>
7280
7281 do not dereference NULL upon failed strdup
7282 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
7283 (ns_get_family): Likewise.
7284
d8e2b5ba
JB
72852011-04-02 Juanma Barranquero <lekktu@gmail.com>
7286
7287 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
7288
8c74fcbd
JD
72892011-04-02 Jan Djärv <jan.h.d@swipnet.se>
7290
7291 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
7292 later (Bug#8403).
7293
7200d79c
SM
72942011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
7295
03408648 7296 Add lexical binding.
7200d79c 7297
03408648
SM
7298 * window.c (Ftemp_output_buffer_show): New fun.
7299 (Fsave_window_excursion):
7300 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
7301
7302 * lread.c (lisp_file_lexically_bound_p): New function.
7303 (Fload): Bind Qlexical_binding.
7304 (readevalloop): Remove `evalfun' arg.
7305 Bind Qinternal_interpreter_environment.
7306 (Feval_buffer): Bind Qlexical_binding.
7307 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
7308 Mark as dynamic.
7309 (syms_of_lread): Declare `lexical-binding'.
7310
7311 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
7312
7313 * keyboard.c (eval_dyn): New fun.
7314 (menu_item_eval_property): Use it.
ca105506
SM
7315
7316 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 7317
03408648
SM
7318 * fns.c (concat, mapcar1): Accept byte-code-functions.
7319
7320 * eval.c (Fsetq): Handle lexical vars.
7321 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
7322 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
7323 (FletX, Flet): Obey lexical binding.
7324 (Fcommandp): Handle closures.
7325 (Feval): New `lexical' arg.
7326 (eval_sub): New function extracted from Feval. Use it almost
7327 everywhere where Feval was used. Look up vars in lexical env.
7328 Handle closures.
7329 (Ffunctionp): Move from subr.el.
7330 (Ffuncall): Handle closures.
7331 (apply_lambda): Remove `eval_flags'.
7332 (funcall_lambda): Handle closures and new byte-code-functions.
7333 (Fspecial_variable_p): New function.
7334 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
7335 but without exporting it to Lisp.
23aba0ea 7336
23aba0ea 7337 * doc.c (Fdocumentation, store_function_docstring):
03408648 7338 * data.c (Finteractive_form): Handle closures.
23aba0ea 7339
03408648
SM
7340 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
7341 interactive spec.
ba83908c 7342
04f2d78b
CB
7343 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
7344 New byte-codes.
03408648
SM
7345 (exec_byte_code): New function extracted from Fbyte_code to handle new
7346 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 7347
03408648 7348 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 7349
03408648 7350 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 7351
e2abce01
JB
73522011-03-31 Juanma Barranquero <lekktu@gmail.com>
7353
7354 * xdisp.c (redisplay_internal): Fix prototype.
7355
63696a73 73562011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 7357
63696a73 7358 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
7359 (try_scrolling): Use it when setting scroll_limit.
7360 Limit scrolling to 100 screen lines.
63696a73
EZ
7361 (redisplay_window): Even when falling back on "recentering",
7362 position point in the window according to scroll-conservatively,
7363 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
7364
7365 (try_scrolling): When point is above the window, allow searching
7366 as far as scroll_max, or one screenful, to compute vertical
7367 distance from PT to the scroll margin position. This prevents
7368 try_scrolling from unnecessarily failing when
7369 scroll-conservatively is set to a value slightly larger than the
7370 window height. Clean up the case of PT below the margin at bottom
7371 of window: scroll_max can no longer be INT_MAX. When aggressive
7372 scrolling is in use, don't let point enter the opposite scroll
7373 margin as result of the scroll.
7374 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
7375 threshold of 100 lines for never-recentering scrolling.
7376
e4cc2dfc
JB
73772011-03-31 Juanma Barranquero <lekktu@gmail.com>
7378
7379 * dispextern.h (move_it_by_lines):
7380 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
7381 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
7382 (message_log_check_duplicate): Remove parameters `prev_bol' and
7383 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
7384 (redisplay_internal): Remove parameter `preserve_echo_area',
7385 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
7386
7387 * indent.c (Fvertical_motion):
7388 * window.c (window_scroll_pixel_based, Frecenter):
7389 Don't pass `need_y_p' to `move_it_by_lines'.
7390
1c470562
SM
73912011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
7392
44f230aa
SM
7393 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
7394 steal a few bits to be more compact.
7395 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
7396 Remove unneeded casts.
7397
1c470562
SM
7398 * bytecode.c (Fbyte_code): CAR and CDR can GC.
7399
888adce9
ZK
74002011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
7401
7402 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
7403 binding" message (bug#7967).
7404
f838ed7b
PE
74052011-03-30 Paul Eggert <eggert@cs.ucla.edu>
7406
77861b95
PE
7407 Fix more problems found by GCC 4.6.0's static checks.
7408
de6dbc14
PE
7409 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
7410 Remove unused local var.
7411
f838ed7b
PE
7412 * editfns.c (Fmessage_box): Remove unused local var.
7413
792c7b2b
PE
7414 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
7415 (note_mode_line_or_margin_highlight, note_mouse_highlight):
7416 Omit unused local vars.
c499e557 7417 * window.c (shrink_windows): Omit unused local var.
b01a1c29 7418 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
7419 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
7420 Omit unused local var.
7421
ba0165e1
PE
7422 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
7423 Don't assume string length fits in int.
32ad8845 7424 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 7425 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 7426
3c59b4c9
PE
7427 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
7428 instead of alloca (Bug#8344).
7429
a3eed478 7430 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 7431 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 7432
eb4d412d
PE
7433 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
7434
1658b401
PE
7435 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
7436 concerns.
7437
7438 * term.c (produce_glyphless_glyph): Remove unnecessary test.
7439
7440 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 7441
9a2c6e05
PE
7442 * keyboard.c (syms_of_keyboard): Use the same style as later
7443 in this function when indexing through an array. This also
7444 works around GCC bug 48267.
7445
03d0a109
PE
7446 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
7447
44f730c8
PE
7448 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
7449
fe75f926
PE
7450 * chartab.c (sub_char_table_ref_and_range): Redo for slight
7451 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
7452
ffa8c828
PE
7453 * keyboard.c, keyboard.h (num_input_events): Now size_t.
7454 This avoids undefined behavior on integer overflow, and is a bit
7455 more convenient anyway since it is compared to a size_t variable.
7456
c5101a77
PE
7457 Variadic C functions now count arguments with size_t, not int.
7458 This avoids an unnecessary limitation on 64-bit machines, which
7459 caused (substring ...) to crash on large vectors (Bug#8344).
7460 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
7461 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 7462 All variadic functions and their callers changed accordingly.
c5101a77
PE
7463 (struct gcpro.nvars): Now size_t, not int. All uses changed.
7464 * data.c (arith_driver, float_arith_driver): Likewise.
7465 * editfns.c (general_insert_function): Likewise.
7466 * eval.c (struct backtrace.nargs, interactive_p)
7467 (internal_condition_case_n, run_hook_with_args, apply_lambda)
7468 (funcall_lambda, mark_backtrace): Likewise.
7469 * fns.c (concat): Likewise.
7470 * frame.c (x_set_frame_parameters): Likewise.
7471 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
7472 0 if not found, not -1. All callers changed.
7473
dd3f25f7
PE
7474 * alloc.c (garbage_collect): Don't assume stack size fits in int.
7475 (stack_copy_size): Now size_t, not int.
7476 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
7477
461c2ab9
JB
74782011-03-28 Juanma Barranquero <lekktu@gmail.com>
7479
7480 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
7481 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7482 All callers changed.
7483
7484 * lisp.h (multibyte_char_to_unibyte):
7485 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
7486 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
7487 * character.h (CHAR_TO_BYTE8):
7488 * cmds.c (internal_self_insert):
7489 * editfns.c (general_insert_function):
7490 * keymap.c (push_key_description):
7491 * search.c (Freplace_match):
7492 * xdisp.c (message_dolog, set_message_1): All callers changed.
7493
f6d62986
SM
74942011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
7495
7496 * keyboard.c (safe_run_hook_funcall): New function.
7497 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
7498 don't set the hook to nil, but remove the offending function instead.
7499 (Qcommand_hook_internal): Remove, unused.
7500 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
7501 Vcommand_hook_internal.
7502
7503 * eval.c (enum run_hooks_condition): Remove.
7504 (funcall_nil, funcall_not): New functions.
7505 (run_hook_with_args): Call each function through a `funcall' argument.
7506 Remove `cond' argument, now redundant.
7507 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
7508 (Frun_hook_with_args_until_failure): Adjust accordingly.
7509 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
7510
1db5b1ad
JB
75112011-03-28 Juanma Barranquero <lekktu@gmail.com>
7512
7513 * dispextern.h (string_buffer_position): Remove declaration.
7514
7515 * print.c (strout): Remove parameter `multibyte', unused since
7516 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
7517
7518 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
7519 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
7520 All callers changed.
7521
7522 * w32.c (_wsa_errlist): Use braces for struct initializers.
7523
7524 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
7525 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
7526 All callers changed.
7527 (string_buffer_position): Likewise. Also, make static (it's never
7528 used outside xdisp.c).
7529 (cursor_row_p): Remove parameter `w', unused since
7530 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
7531 (decode_mode_spec): Remove parameter `precision', introduced during
7532 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
7533 All callers changed.
7534
5ffb62aa
JD
75352011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7536
7537 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
7538
461c2ab9 75392011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
7540
7541 * nsterm.m (ns_menu_bar_is_hidden): New variable.
7542 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
7543 (ns_update_auto_hide_menu_bar): New functions.
7544 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
7545 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
7546 ns_constrain_all_frames.
7547 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
7548 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
7549
5c380ffb
JD
75502011-03-27 Jan Djärv <jan.h.d@swipnet.se>
7551
7552 * nsmenu.m (runDialogAt): Remove argument to timer_check.
7553
9af30bdf
GM
75542011-03-27 Glenn Morris <rgm@gnu.org>
7555
7556 * syssignal.h: Replace RETSIGTYPE with void.
7557 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
7558 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
7559 Replace SIGTYPE with void everywhere.
7560 * s/usg5-4-common.h (SIGTYPE): Remove definition.
7561 * s/template.h (SIGTYPE): Remove commented out definition.
7562
e2abce01
JB
75632011-03-26 Eli Zaretskii <eliz@gnu.org>
7564
7565 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
7566 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
7567
f868cd8a
JB
75682011-03-26 Juanma Barranquero <lekktu@gmail.com>
7569
59eb0929
JB
7570 * w32.c (read_unc_volume): Use parameter `henum', instead of
7571 global variable `wget_enum_handle'.
7572
7573 * keymap.c (describe_vector): Remove parameters `indices' and
7574 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
7575 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
7576
f868cd8a
JB
7577 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
7578
7579 * keyboard.c (timer_check): Remove parameter `do_it_now',
7580 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
7581 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
7582 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
7583
7584 * keyboard.c (read_char):
7585 * w32menu.c (w32_menu_display_help):
7586 * xmenu.c (show_help_event, menu_help_callback):
7587 Adjust calls to `show_help_echo'.
7588
7589 * gtkutil.c (xg_maybe_add_timer):
7590 * keyboard.c (readable_events):
7591 * process.c (wait_reading_process_output):
7592 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
7593
7594 * insdel.c (adjust_markers_gap_motion):
7595 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
7596 (gap_left, gap_right): Don't call it.
7597
2ecf6fdb
CY
75982011-03-25 Chong Yidong <cyd@stupidchicken.com>
7599
7600 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
7601 incurred during fontification.
7602
6b1f9ba4
JB
76032011-03-25 Juanma Barranquero <lekktu@gmail.com>
7604
7605 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
7606 (DEFVAR_PER_BUFFER): Don't pass it.
7607
7608 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
7609 (scrolling_window): Don't pass it.
7610
0f4a96b5
JB
76112011-03-25 Juanma Barranquero <lekktu@gmail.com>
7612
7613 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
7614
7615 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
7616 and `suffix'.
7617 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
7618 of variables specific to SELinux and computation of `encoded_absname'.
7619
7620 * image.c (XPutPixel): Remove unused variable `height'.
7621
7622 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
7623
7624 * unexw32.c (get_section_info): Remove unused variable `section'.
7625
7626 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
7627 (system_process_attributes): Remove unused variable `sess'.
7628 (sys_read): Remove unused variable `err'.
7629
7630 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
7631 (w32_wnd_proc): Remove unused variable `isdead'.
7632 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
7633 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
7634 (x_create_tip_frame): Remove unused variable `tem'.
7635
7636 * w32inevt.c (w32_console_read_socket):
7637 Remove unused variable `no_events'.
7638
7639 * w32term.c (x_draw_composite_glyph_string_foreground):
7640 Remove unused variable `width'.
7641
1149507c
JB
76422011-03-24 Juanma Barranquero <lekktu@gmail.com>
7643
7644 * w32term.c (x_set_glyph_string_clipping):
7645 Don't pass uninitialized region to CombineRgn.
7646
9c88f339
JB
76472011-03-23 Juanma Barranquero <lekktu@gmail.com>
7648
7649 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
7650 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
7651 (Fx_close_connection): Remove unused variable `i'.
7652
7653 * w32font.c (w32font_draw): Return number of glyphs.
7654 (w32font_open_internal): Remove unused variable `i'.
7655 (w32font_driver): Add missing initializer.
7656
7657 * w32menu.c (utf8to16): Remove unused variable `utf16'.
7658 (fill_in_menu): Remove unused variable `items_added'.
7659
7660 * w32term.c (last_mouse_press_frame): Remove static global variable.
7661 (w32_clip_to_row): Remove unused variable `f'.
7662 (x_delete_terminal): Remove unused variable `i'.
7663
7664 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
7665 (NOTHING): Remove unused static global variable.
7666 (uniscribe_check_otf): Remove unused variable `table'.
7667 (uniscribe_font_driver): Add missing initializers.
7668
dee091a3
JD
76692011-03-23 Julien Danjou <julien@danjou.info>
7670
7671 * term.c (Fsuspend_tty, Fresume_tty):
7672 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
7673 * window.c (temp_output_buffer_show):
7674 * insdel.c (signal_before_change):
7675 * frame.c (Fhandle_switch_frame):
7676 * fileio.c (Fdo_auto_save):
7677 * emacs.c (Fkill_emacs):
7678 * editfns.c (save_excursion_restore):
7679 * cmds.c (internal_self_insert):
7680 * callint.c (Fcall_interactively):
7681 * buffer.c (Fkill_all_local_variables):
7682 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
7683 Use Frun_hooks.
0f4a96b5 7684 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
dee091a3
JD
7685 unconditionnaly since it does the check itself.
7686
2c520ab5 76872011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 7688
c9c49752
PE
7689 Fix more problems found by GCC 4.5.2's static checks.
7690
8abc3f12
PE
7691 * coding.c (encode_coding_raw_text): Avoid unnecessary test
7692 the first time through the loop, since we know p0 < p1 then.
7693 This also avoids a gcc -Wstrict-overflow warning.
7694
a2d26660
PE
7695 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
7696 leading to a memory leak, possible in functions like
7697 load_charset_map_from_file that can allocate an unbounded number
b12ef411 7698 of objects (Bug#8318).
a2d26660 7699
916c72e9
PE
7700 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
7701 that could (at least in theory) be that large.
7702
19ab8a18
PE
7703 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
7704 This is less likely to overflow, and avoids undefined behavior if
7705 overflow does occur. All callers changed. Use strtoul to scan
7706 for the unsigned long integer.
b7cbbd6f
PE
7707 (pint2hrstr): Simplify and tune code slightly.
7708 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 7709
f0641eff
PE
7710 * scroll.c (do_scrolling): Work around GCC bug 48228.
7711 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
7712
7f650bb9
PE
7713 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
7714 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
7715 (validate_x_resource_name): Simplify count usage.
7716 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 7717
37dd57d1
PE
7718 * fileio.c (Fcopy_file): Report error if fchown or fchmod
7719 fail (Bug#8306).
81e56e61 7720
699979fc 7721 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 7722
401bf9b4
PE
7723 * process.c (Fmake_network_process): Use socklen_t, not int,
7724 where POSIX says socklen_t is required in portable programs.
7725 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 7726 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
7727 (Fmake_network_process, server_accept_connection):
7728 (wait_reading_process_output, read_process_output):
7729 Likewise.
7730
b93aacde
PE
7731 * process.c: Rename or move locals to avoid shadowing.
7732 (list_processes_1, Fmake_network_process):
7733 (read_process_output_error_handler, exec_sentinel_error_handler):
7734 Rename or move locals.
4dc343ee 7735 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 7736 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 7737 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 7738 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 7739 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 7740
af8a867c 7741 Make tparam.h and terminfo.c consistent.
44f230aa
SM
7742 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
7743 Include tparam.h instead, since it declares them.
af8a867c
PE
7744 * cm.h (PC): Remove extern decl; tparam.h now does this.
7745 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
7746 * terminfo.c: Include tparam.h, to check interfaces.
7747 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
7748 (tparam): Adjust signature to match interface in tparam.h;
7749 this removes some undefined behavior. Check that outstring and len
7750 are zero, which they always are with Emacs.
7751 * tparam.h (PC, BC, UP): New extern decls.
7752
0248044d 7753 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 7754 (xftfont_open): Rename locals to avoid shadowing.
0248044d 7755
8ff096c1 7756 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
7757 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
7758 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 7759 (ftfont_list): Remove unused local.
49eaafba
PE
7760 (get_adstyle_property, ftfont_pattern_entity):
7761 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
7762 Rename locals to avoid shadowing.
8ff096c1 7763
e2be39f6
PE
7764 * xfont.c (xfont_list_family): Mark var as initialized.
7765
c9735e30
PE
7766 * xml.c (make_dom): Now static.
7767
8f5201ae
PE
7768 * composite.c (composition_compute_stop_pos): Rename local to
7769 avoid shadowing.
b246f932
PE
7770 (composition_reseat_it): Remove unused locals.
7771 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 7772 (composition_update_it): Mark var as initialized.
11b61122
PE
7773 (find_automatic_composition): Mark vars as initialized,
7774 with a FIXME (Bug#8290).
8f5201ae 7775
760fbc2c
PE
7776 character.h: Rename locals to avoid shadowing.
7777 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
7778 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
7779 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
7780 (BUF_DEC_POS): Be more systematic about renaming local temporaries
7781 to avoid shadowing.
7782
ff08eb85
PE
7783 * textprop.c (property_change_between_p): Remove; unused.
7784
fc7bf025
PE
7785 * intervals.c (interval_start_pos): Now static.
7786
235d7abc
PE
7787 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
7788
44f230aa
SM
7789 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
7790 Rename locals to avoid shadowing.
3e7d6594 7791
50060332
PE
7792 * sound.c (wav_play, au_play, Fplay_sound_internal):
7793 Fix pointer signedness.
d01f234b 7794 (alsa_choose_format): Remove unused local var.
c83b8872
PE
7795 (wav_play): Initialize a variable to 0, to prevent undefined
7796 behavior (Bug#8278).
50060332 7797
c4fc4e30
PE
7798 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
7799
918436ed
PE
7800 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
7801
c939f91b
PE
7802 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
7803 clobbering (Bug#8298).
b9c7f648
PE
7804 * sysdep.c (sys_subshell): Likewise.
7805 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 7806
6bd8c144
PE
7807 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
7808 This should get cleaned up, so that child_setup has the
7809 same signature on all platforms.
7810
7710357c 7811 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 7812 (relocate_fd): Rename locals to avoid shadowing.
7710357c 7813
c59da222
CY
78142011-03-22 Chong Yidong <cyd@stupidchicken.com>
7815
7816 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
7817 not to be necessary, and produces flickering.
7818
66b87493
GM
78192011-03-20 Glenn Morris <rgm@gnu.org>
7820
7821 * config.in: Remove file.
7822
45b6f6d5
JB
78232011-03-20 Juanma Barranquero <lekktu@gmail.com>
7824
7825 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
7826 are now in src/globals.h.
7827 (syms_of_minibuf): Remove spurious & from previous change.
7828
3ec03f7e
LL
78292011-03-20 Leo <sdl.web@gmail.com>
7830
7831 * minibuf.c (completing-read-function): New variable.
7832 (completing-read-default): Rename from completing-read.
7833 (completing-read): Call completing-read-function.
7834
b14e3e21
CY
78352011-03-19 Juanma Barranquero <lekktu@gmail.com>
7836
7837 * xfaces.c (Fx_load_color_file):
7838 Read color file from absolute filename (bug#8250).
7839
f2b726e6
JB
78402011-03-19 Juanma Barranquero <lekktu@gmail.com>
7841
7842 * makefile.w32-in: Update dependencies.
7843
09f6ff02
EZ
78442011-03-17 Eli Zaretskii <eliz@gnu.org>
7845
7846 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
7847
29a6015a
PE
78482011-03-17 Paul Eggert <eggert@cs.ucla.edu>
7849
a3a6c54e
PE
7850 Fix more problems found by GCC 4.5.2's static checks.
7851
b766f867
PE
7852 * process.c (make_serial_process_unwind, send_process_trap):
7853 (sigchld_handler): Now static.
7854
be02381c
PE
7855 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
7856 That way, the code declares only the vars that it needs.
7857 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
7858 * s/cygwin.h (PTY_ITERATION): Likewise.
7859 * s/darwin.h (PTY_ITERATION): Likewise.
7860 * s/gnu-linux.h (PTY_ITERATION): Likewise.
7861
57048744
PE
7862 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
7863 * process.c (allocate_pty): Don't declare stb unless it's needed.
7864
7914961c 7865 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
7866 (CONSTANTLIM): Remove; unused.
7867 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
7868 Define only if needed.
7914961c 7869
b3967b18
PE
7870 * unexelf.c (unexec): Name an expression,
7871 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
7872 Use a different way to cause a compilation error if anyone uses
7873 n rather than nn, a way that does not involve shadowing.
73366a00 7874 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 7875
29a6015a
PE
7876 * deps.mk (unexalpha.o): Remove; unused.
7877
43cfc33e 7878 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 7879 * unexec.h: New file.
ce701a33
PE
7880 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
7881 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
7882 Depend on unexec.h.
7883 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
7884 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
7885 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 7886 Change as necessary to match prototype in unexec.h.
ce701a33 7887
01f44d5a
PE
7888 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
7889 shadowing.
4f63c6bb 7890 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 7891
a6670b0b
PE
7892 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
7893 Rename locals to avoid shadowing.
7894
cef2010d 7895 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 7896 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 7897
d4d7173a
PE
7898 * print.c (Fredirect_debugging_output): Fix pointer signedess.
7899
f08b802a
PE
7900 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
7901 warning when compiling print.c.
7902
3ddb0639
PE
7903 * font.c (font_unparse_fcname): Abort in an "impossible" situation
7904 instead of using an uninitialized var.
5ad03b97 7905 (font_sort_entities): Mark var as initialized.
3ddb0639 7906
170a2692
PE
7907 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
7908
e663c700
PE
7909 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
7910 pointers to constants.
89bc529a 7911 (font_parse_fcname): Remove unused vars.
7b81e2d0 7912 (font_delete_unmatched): Now static.
ea838e10 7913 (font_get_spec): Remove; unused.
13a547c6
PE
7914 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
7915 (font_update_drivers, Ffont_get_glyphs, font_add_log):
7916 Rename or move locals to avoid shadowing.
e663c700 7917
2a80c887 7918 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 7919 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 7920
1384fa33 7921 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 7922 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 7923
8b2c52e9
PE
7924 * alloc.c (mark_backtrace): Move decl from here ...
7925 * lisp.h: ... to here, so that it can be checked.
7926
475545b5 7927 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 7928 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
7929 (lisp_indirect_variable): Name an expression,
7930 to avoid gcc -Wbad-function-cast warning.
1faed8ae 7931 (Fdefvar): Rename locals to avoid shadowing.
475545b5 7932
b1349114 7933 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 7934 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 7935 Use const pointer when appropriate.
b1349114 7936
a2928364
PE
7937 * lisp.h (get_system_name, get_operating_system_release):
7938 Move decls here, to check interfaces.
7939 * process.c (get_operating_system_release): Move decl to lisp.h.
7940 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
7941 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
7942 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
7943 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
7944 (Fformat_time_string, Fencode_time, Finsert_char):
7945 (Ftranslate_region_internal, Fformat):
7946 Rename or remove local vars to avoid shadowing.
9710023e 7947 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 7948
a415e694
PE
7949 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
7950 avoid shadowing.
7951
8ef4622d
PE
7952 * lisp.h (eassert): Check that the argument compiles, even if
7953 ENABLE_CHECKING is not defined.
7954
946f9a5b
PE
7955 * data.c (Findirect_variable): Name an expression, to avoid
7956 gcc -Wbad-function-cast warning.
112396d6 7957 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 7958 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
7959 (Fmake_variable_buffer_local, Fmake_local_variable):
7960 Mark variables as initialized.
52746918 7961 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 7962
e5aab7e7 7963 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
7964 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
7965 Rename locals to avoid shadowing.
dff45157
PE
7966 (mark_stack): Move local variables into the #ifdef region where
7967 they're used.
7bc26fdb
PE
7968 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
7969 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
7970 needed otherwise.
7971 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
7972 (GC_STRING_CHARS): Remove; not used.
d40d4be1 7973 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 7974
e5aab7e7
PE
7975 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
7976 avoids undefined behavior in theory.
7977
4da60324
PE
7978 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
7979
88043301
PE
7980 Use functions, not macros, for up- and down-casing (Bug#8254).
7981 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
7982 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
7983 to use the following functions instead of these macros.
7984 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
7985 EMACS_INT, since callers assume the returned value fits in int.
7986 (upcase1): Likewise, for UPCASE_TABLE.
7987 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 7988 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 7989 the race-condition problem in the old DOWNCASE.
88043301 7990
19ed5445
PE
7991 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
7992 Rename locals to avoid shadowing.
7993 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
7994 (regex_compile, re_search_2, re_match_2_internal):
7995 Remove unused local vars.
952db0d7
PE
7996 (FREE_VAR): Rewrite so as not to use empty "else",
7997 which gcc can warn about.
da053e48 7998 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
7999 (RETALLOC_IF): Define only if needed.
8000 (WORDCHAR_P): Likewise. This one is never needed, but is used
8001 only in a comment talking about a compiler bug, so put inside
8002 the #if 0 of that comment.
8003 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
8004 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
8005 Remove; unused.
19ed5445 8006
1f3561e4 8007 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
8008 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
8009 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 8010
ded6f8f7
PE
8011 * search.c (simple_search): Remove unused var.
8012
dbd37a95
PE
8013 * dired.c (compile_pattern): Move decl from here ...
8014 * lisp.h: ... to here, so that it can be checked.
8015 (struct re_registers): New forward decl.
8016
7e47afad
PE
8017 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
8018
85f24f61
PE
8019 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
8020 All uses changed.
8021 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
8022 Rename locals to avoid shadowing.
5671df8f 8023 (Fvertical_motion): Mark locals as initialized.
85f24f61 8024
181aa2be 8025 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 8026 (casify_region): Mark local as initialized.
181aa2be 8027
930d429c
PE
8028 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
8029
7082eac6
PE
8030 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
8031 New macros, so that the caller can use some names other than
8032 gcpro1, gcpro2, etc.
8033 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
8034 of the new macros.
8035 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
8036 argument, for consistency with GCPRO2_VAR, etc: it is now the
8037 prefix of the variable, not the variable itself. All uses
8038 changed.
38b2c076
PE
8039 * dired.c (directory_files_internal, file_name_completion):
8040 Rename locals to avoid shadowing.
8041
15206ed9
PE
8042 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
8043 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
8044 dired.c's scmp function, had undefined behavior.
8045 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
8046 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
8047 * buffer.h: ... to here, because these macros use current_buffer,
8048 and the new implementation with inline functions needs to have
8049 current_buffer in scope now, rather than later when the macros
8050 are used.
8051 (downcase, upcase1): New static inline functions.
8052 (DOWNCASE, UPCASE1): Reimplement using these functions.
8053 This avoids undefined behavior in expressions like
8054 DOWNCASE (x) == DOWNCASE (y), which previously suffered
8055 from race conditions in accessing the global variables
8056 case_temp1 and case_temp2.
8057 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
8058 * lisp.h (case_temp1, case_temp2): Remove their decls.
8059 * character.h (ASCII_CHAR_P): Move from here ...
8060 * lisp.h: ... to here, so that the inline functions mentioned
8061 above can use them.
8062
4a6bea26
PE
8063 * dired.c (directory_files_internal_unwind): Now static.
8064
f14b7e14
PE
8065 * fileio.c (file_name_as_directory, directory_file_name):
8066 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
8067 Now static.
2893f146
PE
8068 (file_name_as_directory): Use const pointers when appropriate.
8069 (Fexpand_file_name): Likewise. In particular, newdir might
8070 point at constant storage, so make it a const pointer.
fd4ead52 8071 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
8072 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
8073 signedness issues.
f839df0c
PE
8074 (Fset_file_times, Finsert_file_contents, auto_save_error):
8075 Rename locals to avoid shadowing.
f14b7e14 8076
5716756e 8077 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
8078 (Ftry_completion, Fall_completions): Rename or remove locals
8079 to avoid shadowing.
5716756e 8080
b4c3046a
PE
8081 * marker.c (bytepos_to_charpos): Remove; unused.
8082
b45db522
PE
8083 * lisp.h (verify_bytepos, count_markers): New decls,
8084 so that gcc does not warn that these functions aren't declared.
8085
85876d07
PE
8086 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
8087 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 8088 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 8089 (copy_text): Remove unused local var.
85876d07 8090
03d78a21 8091 * filelock.c (within_one_second): Now static.
b3dd38ab 8092 (lock_file_1): Rename local to avoid shadowing.
03d78a21 8093
5df8f01b
PE
8094 * buffer.c (fix_overlays_before): Mark locals as initialized.
8095 (fix_start_end_in_overlays): Likewise. This function should be
8096 simplified by using pointers-to-pointers, but that's a different
8097 matter.
b1d876f1 8098 (switch_to_buffer_1): Now static.
8f54f30a
PE
8099 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
8100 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 8101
a70072c9 8102 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 8103 Fix pointer signedness issue.
edced198
PE
8104 (sys_subshell): Mark local as volatile if checking for lint,
8105 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 8106 (MAXPATHLEN): Define only if needed.
a70072c9 8107
a0977c44
PE
8108 * process.c (serial_open, serial_configure): Move decls from here ...
8109 * systty.h: ... to here, so that they can be checked.
8110
a884fdcc
PE
8111 * fns.c (get_random, seed_random): Move extern decls from here ...
8112 * lisp.h: ... to here, so that they can be checked.
8113
604efe86 8114 * sysdep.c (reset_io): Now static.
b8950c94 8115 (wait_for_termination_signal): Remove; unused.
604efe86 8116
38fc62d9
PE
8117 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
8118 (copy_keymap_item, append_key, push_text_char_description):
8119 Now static.
1004a21a 8120 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 8121 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
8122 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
8123 (describe_map_tree):
8124 Rename locals to avoid shadowing.
38fc62d9 8125
2f2650da
PE
8126 * keyboard.c: Declare functions static if they are not used elsewhere.
8127 (echo_char, echo_dash, cmd_error, top_level_2):
8128 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
8129 (read_char, kbd_buffer_get_event, make_lispy_position):
8130 (make_lispy_event, make_lispy_movement, apply_modifiers):
8131 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
8132 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
8133 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 8134 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 8135 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 8136
a053e86c 8137 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
8138 (mark_kboards): Move decl here ...
8139 * alloc.c (mark_kboards): ... from here.
a053e86c 8140
4752793e
PE
8141 * lisp.h (force_auto_save_soon): New decl.
8142
74f10ca7 8143 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
8144 (DEFINE_DUMMY_FUNCTION): New macro.
8145 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
8146 Use it.
c03cd23f
PE
8147 (main): Add casts to avoid warnings
8148 if GCC considers string literals to be constants.
74f10ca7 8149
022e70d4
PE
8150 * lisp.h (fatal_error_signal): Add decl, since it's exported.
8151
59d6fe83
PE
8152 * dbusbind.c: Pointer signedness fixes.
8153 (xd_signature, xd_append_arg, xd_initialize):
8154 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8155 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8156 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
8157 (Fdbus_register_signal): Use SSDATA when the context wants char *.
8158
78320123
PE
8159 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
8160 if GCC considers string literals to be constants.
49cebcca 8161 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 8162
35ac2a97
SM
81632011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
8164
fb103ca9
SM
8165 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
8166 (print_preprocess, print_object): New macro to fix last change.
8167
35ac2a97
SM
8168 * print.c (print_preprocess): Don't forget font objects.
8169
62973b41
JB
81702011-03-16 Juanma Barranquero <lekktu@gmail.com>
8171
8172 * emacs.c (USAGE3): Doc fixes.
8173
0e48bb22
AS
81742011-03-15 Andreas Schwab <schwab@linux-m68k.org>
8175
8176 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
8177 structure.
8178
7684e57b
JB
81792011-03-14 Juanma Barranquero <lekktu@gmail.com>
8180
8181 * lisp.h (VWindow_system, Qfile_name_history):
8182 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
8183 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
8184 (w32_system_caret_x, w32_system_caret_y): Declare extern.
8185
8186 * w32select.c: Don't #include "keyboard.h".
c96bbc66 8187 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
8188
8189 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
8190 * w32console.c (detect_input_pending, read_input_pending)
8191 (encode_terminal_code):
8192 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
8193 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
8194 (w32_system_caret_y, Qfile_name_history):
8195 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
8196 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
8197 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
8198 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
8199 * w32proc.c (Qlocal, report_file_error):
8200 * w32term.c (Vwindow_system, updating_frame):
8201 * w32uniscribe.c (initialized, uniscribe_font_driver):
8202 Remove unneeded extern declarations.
8203
2aa46d6c
CY
82042011-03-14 Chong Yidong <cyd@stupidchicken.com>
8205
c96bbc66 8206 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 8207
cffc6f3b
CY
82082011-03-13 Chong Yidong <cyd@stupidchicken.com>
8209
8210 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
8211 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
8212 These macros can no longer be used for assignment.
8213
44f230aa
SM
8214 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
8215 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
8216 (record_buffer_markers, fetch_buffer_markers): New functions for
8217 recording and fetching special buffer markers.
8218 (set_buffer_internal_1, set_buffer_temp): Use them.
8219
8220 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
8221
8222 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
8223
8224 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
8225 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
8226
8227 * xdisp.c (hscroll_window_tree):
8228 (reconsider_clip_changes): Use PT instead of BUF_PT.
8229
d251f04b
EZ
82302011-03-13 Eli Zaretskii <eliz@gnu.org>
8231
8232 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
8233 $(EMACS_ROOT)/lib/intprops.h.
8234
f0c77cd1
PE
82352011-03-13 Paul Eggert <eggert@cs.ucla.edu>
8236
3eca4629
PE
8237 Fix more problems found by GCC 4.5.2's static checks.
8238
7c86ee98
PE
8239 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
8240 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
8241 (xg_free_frame_widgets): Make it clear that a local variable is
8242 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
8243 (gdk_window_get_screen): Make it clear that this macro is needed
8244 only if USE_GTK_TOOLTIP.
1e5524e7
PE
8245 (int_gtk_range_get_value): New function, which avoids a diagnostic
8246 from gcc -Wbad-function-cast.
8247 (xg_set_toolkit_scroll_bar_thumb): Use it.
8248 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
8249 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
8250 (get_utf8_string, xg_get_file_with_chooser):
8251 Rename locals to avoid shadowing.
8252 (create_dialog): Move locals to avoid shadowing.
7c86ee98 8253
41729b81
PE
8254 * xgselect.c (xg_select): Remove unused var.
8255
f0c77cd1
PE
8256 * image.c (four_corners_best): Mark locals as initialized.
8257 (gif_load): Initialize transparent_p to zero (Bug#8238).
8258 Mark another local as initialized.
ec6cf4c6 8259 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 8260
ce0ad53d 8261 * image.c (clear_image_cache): Now static.
d5d5a617 8262 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 8263 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
8264 (x_edge_detection): Remove unnecessary cast that
8265 gcc -Wbad-function-cast diagnoses.
2037898d 8266 (gif_load): Fix pointer signedness.
6ae141d6
PE
8267 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
8268 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 8269
33383987 82702011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 8271
d32df629
PE
8272 Improve quality of tests for time stamp overflow.
8273 For example, without this patch (encode-time 0 0 0 1 1
8274 1152921504606846976) returns the obviously-bogus value (-948597
8275 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
8276 reports time overflow. See
8277 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
8278 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
8279 * editfns.c: Include limits.h and intprops.h.
8280 (TIME_T_MIN, TIME_T_MAX): New macros.
8281 (time_overflow): Move earlier, to before first use.
8282 (hi_time, lo_time): New functions, for an accurate test for
8283 out-of-range times.
8284 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
8285 (Fget_internal_run_time): Don't assume time_t fits in int.
8286 (make_time): Use list2 instead of Fcons twice.
8287 (Fdecode_time): More accurate test for out-of-range times.
8288 (check_tm_member): New function.
8289 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
8290 (lisp_time_argument): Don't rely on undefined left-shift and
8291 right-shift behavior when checking for time stamp overflow.
8be6f318 8292
fe31d94c
PE
8293 * editfns.c (time_overflow): New function, refactoring common code.
8294 (Fformat_time_string, Fdecode_time, Fencode_time):
8295 (Fcurrent_time_string): Use it.
8296
8be6f318
PE
8297 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
8298 * dired.c (make_time): Move to ...
8299 * editfns.c (make_time): ... here.
8300 * systime.h: Note the move.
8301
09d9db2c 83022011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 8303
126bc0dc
YM
8304 * fringe.c (update_window_fringes): Remove unused variables.
8305
c47cbdfd
YM
8306 * unexmacosx.c (copy_data_segment): Also copy __got section.
8307 (Bug#8223)
8308
7ac80be9
EZ
83092011-03-12 Eli Zaretskii <eliz@gnu.org>
8310
c96bbc66 8311 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
8312 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
8313 Constify `char *' arguments and their references according to
8314 prototypes in tparam.h.
8315
ecb0f94d 8316 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 8317
7ac80be9
EZ
8318 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
8319 Adapt all references accordingly.
8320
8321 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
8322
ef1fd07e
TT
83232011-03-11 Tom Tromey <tromey@redhat.com>
8324
8325 * buffer.c (syms_of_buffer): Remove obsolete comment.
8326
7ef4b50c
EZ
83272011-03-11 Eli Zaretskii <eliz@gnu.org>
8328
8329 * termhooks.h (encode_terminal_code): Declare prototype.
8330
8331 * msdos.c (encode_terminal_code): Don't declare prototype.
8332
8333 * term.c (encode_terminal_code): Now external again, used by
8334 w32console.c and msdos.c.
8335
44f230aa
SM
8336 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
8337 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 8338
4b1ec863 83392011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 8340
1714f52b 8341 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 8342
4b1ec863
PE
8343 * fringe.c (update_window_fringes): Mark locals as initialized
8344 (Bug#8227).
8345 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 8346
524c7aa6
PE
8347 * alloc.c (mark_fringe_data): Move decl from here ...
8348 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
8349 to check its interface.
8350 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
8351
a5c0af81 8352 * fontset.c (free_realized_fontset): Now static.
7519b8cd 8353 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 8354 (fontset_font): Mark local as initialized.
a9a06e0b 8355 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 8356
b4716021
PE
8357 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
8358
811e9bac 8359 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 8360 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
8361 (x_own_selection, Fx_disown_selection_internal): Rename locals
8362 to avoid shadowing.
8363 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 8364
7e3ab302
PE
8365 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
8366 so that the caller can use some name other than gcpro1.
8367 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
8368 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8369 (Fx_backspace_delete_keys_p):
8370 Use them to avoid shadowing, and rename vars to avoid shadowing.
8371 (x_decode_color, x_set_name, x_window): Now static.
6b437900 8372 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 8373 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
8374 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
8375 Remove unused locals.
7e3ab302
PE
8376 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
8377 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
8378 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
8379 macros.
f78faa98 8380
e2b13473
PE
8381 * xterm.h (x_mouse_leave): New decl.
8382
77f23912
PE
8383 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
8384 Remove unused functions.
cdf4ba58
PE
8385 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
8386 (x_calc_absolute_position): Now static.
7411c686 8387 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 8388 Don't declare local "event" unless it's used.
ed7bf3a5
PE
8389 (x_iconify_frame, x_free_frame_resources): Don't declare locals
8390 unless they are used.
38d0b34a
PE
8391 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
8392 (x_fatal_error_signal): Remove; not used.
a6067996
PE
8393 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
8394 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
8395 (x_error_catcher, x_connection_closed, x_error_handler):
8396 (x_error_quitter, xembed_send_message, x_iconify_frame):
8397 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 8398 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 8399 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 8400
44f230aa
SM
8401 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
8402 Rename or move locals to avoid shadowing.
6b463e58 8403 (tty_defined_color, merge_face_heights): Now static.
5967d051 8404 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
8405 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
8406 does not deduce is never used uninitialized.
73719eba
PE
8407 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
8408 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 8409
426994c3 8410 * terminal.c (store_terminal_param): Now static.
5489860b 8411
032f1620 8412 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 8413 (set_frame_menubar): Remove unused local.
d4323972 8414 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
8415 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
8416 since they might point to immutable storage.
281585b0
PE
8417 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
8418 since it's unused otherwise.
032f1620 8419
367c19e5 8420 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 8421 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
8422 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
8423 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 8424 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
8425 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
8426 does not deduce are never used uninitialized.
70739cbe 8427
07b48fa9
PE
8428 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
8429
8868a238 8430 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
8431 * window.c (window_loop, size_window):
8432 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 8433
7e5cf297 8434 * window.c (display_buffer): Now static.
d6550a9f
PE
8435 (size_window): Mark variables that gcc -Wuninitialized
8436 does not deduce are never used uninitialized.
a586633d
PE
8437 * window.h (check_all_windows): New decl, to forestall
8438 gcc -Wmissing-prototypes diagnostic.
5b555da1 8439 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 8440
f6095868
PE
8441 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
8442 shadowing.
8443 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
8444 Include <limits.h>.
8445 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
8446 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
8447 (load_charset_map): Mark variables that gcc -Wuninitialized
8448 does not deduce are never used uninitialized.
53df7c11 8449 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 8450
f38b440c
PE
8451 * coding.c (coding_set_source, coding_set_destination):
8452 Use "else { /* comment */ }" rather than "else /* comment */;"
8453 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
8454 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
8455 a block, when the outer 'i' will do.
8456 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
8457 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
8458 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
8459 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
8460 (Fdecode_sjis_char, Fdefine_coding_system_internal):
8461 Rename locals to avoid shadowing.
8462 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
8463 * coding.c (emacs_mule_char, encode_invocation_designation):
8464 Now static, since they're not used elsewhere.
413bb2db 8465 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 8466 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
8467 (decode_coding_emacs_mule): Mark variables that gcc
8468 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
8469 (detect_coding_iso_2022): Initialize a local variable that might
8470 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 8471 this initialization is needed. (Bug#8211)
5f58e762
PE
8472 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
8473 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
8474 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
8475 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
8476 Remove unused macros.
f38b440c 8477
232b38b9 8478 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 8479 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 8480 * character.c (string_count_byte8): Likewise.
232b38b9 8481
fb90da1b
PE
8482 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
8483 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
8484
fb93dbc2
PE
8485 * chartab.c (copy_sub_char_table): Now static, since it's not used
8486 elsewhere.
5c156ace
PE
8487 (sub_char_table_ref_and_range, char_table_ref_and_range):
8488 Rename locals to avoid shadowing.
bbcd0949 8489 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 8490
7d3b3862 8491 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 8492 (BIDI_BOB): Remove unused macro.
7d3b3862 8493
6be7d3da
PE
8494 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
8495 deduce are never used uninitialized.
c2ed9c8b 8496 * term.c (encode_terminal_code): Likewise.
6be7d3da 8497
75f8807f 8498 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 8499
50938595
PE
8500 * tparam.h: New file.
8501 * term.c, tparam.h: Include it.
8502 * deps.mk (term.o, tparam.o): Depend on tparam.h.
8503 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
8504 Move these decls to tparam.h, and make them agree with what
8505 is actually in tparam.c. The previous trick of using incompatible
8506 decls in different modules does not conform to the C standard.
8507 All callers of tparam changed to use tparam's actual API.
8508 * tparam.c (tparam1, tparam, tgoto):
8509 Use const pointers where appropriate.
8510
fbceeba2
PE
8511 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
8512 * cm.h (struct cm): Likewise.
8513 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
8514 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
8515 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
8516 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
8517 (turn_on_face, init_tty): Likewise.
8518 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 8519
7f3f1250
PE
8520 * term.c (term_mouse_position): Rename local to avoid shadowing.
8521
e6ca6543
PE
8522 * alloc.c (mark_ttys): Move decl from here ...
8523 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
8524
c40f8d15
AS
85252011-03-11 Andreas Schwab <schwab@linux-m68k.org>
8526
8527 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
8528
cfe0661d
JB
85292011-03-09 Juanma Barranquero <lekktu@gmail.com>
8530
8531 * search.c (compile_pattern_1): Remove argument regp, unused since
8532 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
8533 (compile_pattern): Don't pass it.
8534
0afb4571
J
85352011-03-08 Jan Djärv <jan.h.d@swipnet.se>
8536
8537 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
8538 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
8539 for ! HAVE_GTK3.
8540 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
8541
8542 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
8543
8544 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
8545 gdk_window_get_screen, gdk_window_get_geometry,
8546 gdk_x11_window_lookup_for_display and GDK_KEY_g.
8547 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
8548 (xg_get_pixbuf_from_pixmap): New function.
8549 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
8550 to Pixmap, take frame as parameter, remove GdkColormap parameter.
8551 Call xg_get_pixbuf_from_pixmap instead of
8552 gdk_pixbuf_get_from_drawable.
8553 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
8554 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
8555 (xg_check_special_colors): Use GtkStyleContext and its functions
8556 for HAVE_GTK3.
8557 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
8558 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
8559 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
8560 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
8561 Call gtk_widget_get_preferred_size.
0afb4571
J
8562 (xg_frame_resized): gdk_window_get_geometry only takes 5
8563 parameters.
44f230aa
SM
8564 (xg_win_to_widget, xg_event_is_for_menubar):
8565 Call gdk_x11_window_lookup_for_display.
0afb4571
J
8566 (xg_set_widget_bg): New function.
8567 (delete_cb): New function.
895009e1 8568 (xg_create_frame_widgets): Connect delete-event to delete_cb.
0afb4571
J
8569 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
8570 (xg_set_background_color): Call xg_set_widget_bg.
8571 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
8572 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
8573 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
8574 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
8575 if ! HAVE_GTK3.
8576 (update_frame_tool_bar): Call gtk_widget_hide.
8577 (xg_initialize): Use GDK_KEY_g.
8578
8579 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
8580 if ! HAVE_GTK3
8581 (x_session_initialize): Call gdk_x11_set_sm_client_id.
8582
8583 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
8584 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
8585 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
8586
1c2cc4ef
JB
85872011-03-08 Juanma Barranquero <lekktu@gmail.com>
8588
8589 * w32xfns.c (select_palette): Check success of RealizePalette against
8590 GDI_ERROR, not zero.
8591
33383987 8592See ChangeLog.11 for earlier changes.
aac0c6e3
MR
8593
8594;; Local Variables:
8595;; coding: utf-8
aac0c6e3
MR
8596;; End:
8597
33383987 8598 Copyright (C) 2011 Free Software Foundation, Inc.
aac0c6e3
MR
8599
8600 This file is part of GNU Emacs.
8601
8602 GNU Emacs is free software: you can redistribute it and/or modify
8603 it under the terms of the GNU General Public License as published by
8604 the Free Software Foundation, either version 3 of the License, or
8605 (at your option) any later version.
8606
8607 GNU Emacs is distributed in the hope that it will be useful,
8608 but WITHOUT ANY WARRANTY; without even the implied warranty of
8609 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8610 GNU General Public License for more details.
8611
8612 You should have received a copy of the GNU General Public License
8613 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.