Mercurial > emacs
comparison src/xfaces.c @ 109165:750db9f3e6d8
Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
* alloc.c (overrun_check_malloc, overrun_check_realloc)
(overrun_check_free, xstrdup, allocate_string)
(allocate_string_data, compact_small_strings, Fmake_string)
(make_unibyte_string, make_multibyte_string)
(make_string_from_bytes, make_specified_string, make_float)
(Fcons, allocate_terminal, allocate_frame, make_pure_string)
(Fgarbage_collect): Replace bcopy, safe_bcopy, bzero, bcmp by
memcpy, memmove, memset, memcmp.
* atimer.c (start_atimer, set_alarm): Likewise.
* buffer.c (clone_per_buffer_values, report_overlay_modification)
(mmap_realloc, init_buffer_once): Likewise.
* callint.c (Fcall_interactively): Likewise.
* callproc.c (Fcall_process, Fcall_process_region, child_setup)
(getenv_internal_1): Likewise.
* casefiddle.c (casify_object): Likewise.
* ccl.c (ccl_driver): Likewise.
* character.c (str_as_multibyte, str_to_multibyte): Likewise.
* charset.c (load_charset_map_from_file)
(load_charset_map_from_file, load_charset_map_from_vector)
(Fdefine_charset_internal): Likewise.
* cm.c (Wcm_clear): Likewise.
* coding.c (decode_eol, decode_coding_object)
(Fset_coding_system_priority, make_subsidiaries): Likewise.
* data.c (Faset): Likewise.
* dired.c (directory_files_internal, file_name_completion_stat):
Likewise.
* dispnew.c (new_glyph_matrix, adjust_glyph_matrix)
(clear_glyph_row, copy_row_except_pointers)
(copy_glyph_row_contents, new_glyph_pool, realloc_glyph_pool)
(save_current_matrix, restore_current_matrix)
(build_frame_matrix_from_leaf_window, mirrored_line_dance)
(mirror_line_dance, scrolling_window): Likewise.
* doc.c (Fsnarf_documentation, Fsubstitute_command_keys):
Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (Fuser_full_name, make_buffer_string_both)
(Fmessage_box, Fformat, Ftranspose_regions): Likewise.
* emacs.c (sort_args): Likewise.
* eval.c (Fapply, Ffuncall): Likewise.
* fileio.c (Ffile_name_directory, make_temp_name)
(Fexpand_file_name, search_embedded_absfilename)
(Fsubstitute_in_file_name, Ffile_symlink_p, Finsert_file_contents)
(auto_save_error): Likewise.
* fns.c (Fstring_equal, Fcopy_sequence, concat)
(string_to_multibyte, Fstring_as_unibyte, Fstring_as_multibyte)
(internal_equal, Fclear_string, larger_vector, copy_hash_table)
(Fmake_hash_table): Likewise.
* fringe.c (Fdefine_fringe_bitmap): Likewise.
* ftfont.c (ftfont_text_extents): Likewise.
* getloadavg.c (getloadavg): Likewise.
* image.c (define_image_type, make_image, make_image_cache)
(x_create_x_image_and_pixmap, xbm_image_p)
(w32_create_pixmap_from_bitmap_data, xbm_load, xpm_lookup_color)
(xpm_image_p, x_create_bitmap_from_xpm_data, xpm_load)
(init_color_table, x_build_heuristic_mask, pbm_image_p, pbm_load)
(png_image_p, png_read_from_memory, png_load, jpeg_image_p)
(tiff_image_p, tiff_read_from_memory, gif_image_p)
(gif_read_from_memory, gif_load, svg_image_p, gs_image_p):
Likewise.
* indent.c (scan_for_column, compute_motion): Likewise.
* insdel.c (gap_left, gap_right, make_gap_smaller, copy_text)
(insert_1_both, insert_from_gap, replace_range_2): Likewise.
* intervals.c (reproduce_tree, reproduce_tree_obj): Likewise.
* keyboard.c (echo_char, save_getcjmp, restore_getcjmp)
(kbd_buffer_store_event_hold, apply_modifiers_uncached)
(store_user_signal_events, menu_bar_items, tool_bar_items)
(process_tool_bar_item, append_tool_bar_item)
(read_char_minibuf_menu_prompt, read_key_sequence)
(Fread_key_sequence, Fread_key_sequence_vector, Frecent_keys):
Likewise.
* keymap.c (current_minor_maps, Fdescribe_buffer_bindings):
Likewise.
* lisp.h (STRING_COPYIN): Likewise.
* lread.c (Fload, read1, oblookup): Likewise.
* msdos.c (Frecent_doskeys): Likewise.
* nsfns.m (Fx_create_frame): Likewise.
* nsfont.m (nsfont_open, nsfont_text_extents, ns_glyph_metrics):
Likewise.
* nsimage.m (EmacsImage-initFromSkipXBM:width:height:)
(EmacsImage-initForXPMWithDepth:width:height:flip:length:):
Likewise.
* nsmenu.m (ns_update_menubar): Likewise.
* nsterm.m (ns_draw_fringe_bitmap, ns_term_init): Likewise.
* print.c (print_unwind, printchar, strout, print_string)
(print_error_message): Likewise.
* process.c (conv_lisp_to_sockaddr, set_socket_option)
(Fmake_network_process, Fnetwork_interface_list)
(Fnetwork_interface_info, read_process_output, Fprocess_send_eof)
(init_process): Likewise.
* ralloc.c (resize_bloc, r_alloc_sbrk, r_alloc_init): Likewise.
* regex.c (init_syntax_once, regex_compile, re_compile_fastmap):
Likewise.
* scroll.c (do_scrolling, do_direct_scrolling)
(scrolling_max_lines_saved): Likewise.
* search.c (search_buffer, wordify, Freplace_match): Likewise.
* sound.c (wav_init, au_init, Fplay_sound_internal): Likewise.
* syntax.c (skip_chars, skip_syntaxes): Likewise.
* sysdep.c (child_setup_tty, sys_subshell, emacs_get_tty)
(emacs_set_tty): Likewise.
* term.c (encode_terminal_code, calculate_costs)
(produce_special_glyphs, create_tty_output, init_tty, delete_tty):
Likewise.
* termcap.c (tgetst1, gobble_line): Likewise.
* termhooks.h (EVENT_INIT): Likewise.
* tparam.c (tparam1): Likewise.
* unexalpha.c (unexec): Likewise.
* unexec.c (write_segment): Likewise.
* unexmacosx.c (unexec_write_zero): Likewise.
* w32fns.c (w32_wnd_proc, Fx_create_frame, x_create_tip_frame)
(Fx_file_dialog, Fsystem_move_file_to_trash): Likewise.
* w32font.c (w32font_list_family, w32font_text_extents)
(w32font_list_internal, w32font_match_internal)
(w32font_open_internal, compute_metrics, Fx_select_font):
Likewise.
* w32menu.c (set_frame_menubar, add_menu_item)
(w32_menu_display_help, w32_free_submenu_strings): Likewise.
* w32term.c (XCreateGC, w32_initialize_display_info): Likewise.
* w32uniscribe.c (uniscribe_list_family): Likewise.
* w32xfns.c (get_next_msg, post_msg, prepend_msg): Likewise.
* window.c (make_window, replace_window, set_window_buffer)
(Fsplit_window): Likewise.
* xdisp.c (init_iterator, RECORD_OVERLAY_STRING, reseat_to_string)
(add_to_log, message3, x_consider_frame_title)
(append_space_for_newline, extend_face_to_end_of_line)
(decode_mode_spec_coding, init_glyph_string): Likewise.
* xfaces.c (x_create_gc, get_lface_attributes_no_remap)
(Finternal_copy_lisp_face, Finternal_merge_in_global_face)
(face_attr_equal_p, make_realized_face, make_face_cache)
(free_realized_faces, lookup_named_face, smaller_face)
(face_with_height, lookup_derived_face)
(x_supports_face_attributes_p, Finternal_set_font_selection_order)
(Finternal_set_font_selection_order, realize_default_face)
(compute_char_face, face_at_buffer_position)
(face_for_overlay_string, face_at_string_position, merge_faces):
Likewise.
* xfns.c (xic_create_fontsetname, Fx_create_frame)
(Fx_window_property, x_create_tip_frame)
(Fx_backspace_delete_keys_p): Likewise.
* xfont.c (xfont_list, xfont_match, xfont_list_family)
(xfont_text_extents): Likewise.
* xmenu.c (set_frame_menubar, xmenu_show): Likewise.
* xrdb.c (magic_file_p, x_get_resource): Likewise.
* xselect.c (x_queue_event, x_get_window_property)
(receive_incremental_selection): Likewise.
* xsmfns.c (x_session_check_input): Likewise.
* xterm.c (x_send_scroll_bar_event, SET_SAVED_MENU_EVENT)
(handle_one_xevent, x_check_errors, xim_initialize, x_term_init):
Likewise.
* character.h (BCOPY_SHORT): Removed.
* config.in: Regenerate.
* dispnew.c (safe_bcopy): Only define as dummy if PROFILING.
* emacs.c (main) [PROFILING]: Don't declare
dump_opcode_frequencies.
* lisp.h (safe_bcopy): Remove declaration.
(memset) [!HAVE_MEMSET]: Declare.
(memcpy) [!HAVE_MEMCPY]: Likewise.
(memmove) [!HAVE_MEMMOVE]: Likewise.
(memcmp) [!HAVE_MEMCMP]: Likewise.
* s/ms-w32.h (bzero, bcopy, bcmp, GAP_USE_BCOPY)
(BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE, HAVE_BCOPY, HAVE_BCMP):
Don't define.
(HAVE_MEMCMP, HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET): Define.
* s/msdos.h (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE)
(BCOPY_DOWNWARD_SAFE): Don't define.
* sysdep.c (memset) [!HAVE_MEMSET]: Define.
(memcpy) [!HAVE_MEMCPY]: Define.
(memmove) [!HAVE_MEMMOVE]: Define.
(memcmp) [!HAVE_MEMCMP]: Define.
* config.nt (HAVE_BCOPY, HAVE_BCMP): Remove undefs.
(HAVE_MEMCPY, HAVE_MEMMOVE, HAVE_MEMSET, HAVE_MEMCMP): Add undefs.
* sed2v2.inp (HAVE_MEMCPY, HAVE_MEMSET): Edit to 1.
(HAVE_BZERO): Don't edit.
* lwlib.c (lwlib_memset, lwlib_bcopy): Remove.
(malloc_widget_value, free_widget_info, allocate_widget_instance)
(lw_separator_p): Replace lwlib_memset, lwlib_bcopy, bzero, bcmp by
memset, memcpy, memcmp.
* lwlib-utils.c (XtApplyToWidgets): Likewise.
* xlwmenu.c (XlwMenuInitialize): Likewise.
* lwlib.h (lwlib_bcopy): Remove declaration.
* ebrowse.c (add_sym, make_namespace): Replace bcopy, bzero by
memcpy, memmove, memset.
* pop.c (pop_retrieve, socket_connection, pop_getline): Likewise.
* CPP-DEFINES (BCOPY_DOWNWARD_SAFE, BCOPY_UPWARD_SAFE)
(GAP_USE_BCOPY, HAVE_BCMP, HAVE_BCOPY, bcmp, bcopy, bzero):
Remove.
* configure.in: Don't check for bcopy, bcmp, bzero. Don't include
<strings.h> and don't define bcopy, bzero, BCMP in config.h.
author | Andreas Schwab <schwab@linux-m68k.org> |
---|---|
date | Thu, 08 Jul 2010 00:18:28 +0200 |
parents | f8660b83cdbf |
children | 8cfee7d2955f |
comparison
equal
deleted
inserted
replaced
109164:a7b09b567d58 | 109165:750db9f3e6d8 |
---|---|
762 unsigned long mask; | 762 unsigned long mask; |
763 XGCValues *xgcv; | 763 XGCValues *xgcv; |
764 { | 764 { |
765 GC gc = xmalloc (sizeof (*gc)); | 765 GC gc = xmalloc (sizeof (*gc)); |
766 if (gc) | 766 if (gc) |
767 bcopy (xgcv, gc, sizeof (XGCValues)); | 767 memcpy (gc, xgcv, sizeof (XGCValues)); |
768 return gc; | 768 return gc; |
769 } | 769 } |
770 | 770 |
771 static INLINE void | 771 static INLINE void |
772 x_free_gc (f, gc) | 772 x_free_gc (f, gc) |
2188 Lisp_Object lface; | 2188 Lisp_Object lface; |
2189 | 2189 |
2190 lface = lface_from_face_name_no_resolve (f, face_name, signal_p); | 2190 lface = lface_from_face_name_no_resolve (f, face_name, signal_p); |
2191 | 2191 |
2192 if (! NILP (lface)) | 2192 if (! NILP (lface)) |
2193 bcopy (XVECTOR (lface)->contents, attrs, | 2193 memcpy (attrs, XVECTOR (lface)->contents, |
2194 LFACE_VECTOR_SIZE * sizeof *attrs); | 2194 LFACE_VECTOR_SIZE * sizeof *attrs); |
2195 | 2195 |
2196 return !NILP (lface); | 2196 return !NILP (lface); |
2197 } | 2197 } |
2198 | 2198 |
2199 /* Get face attributes of face FACE_NAME from frame-local faces on frame | 2199 /* Get face attributes of face FACE_NAME from frame-local faces on frame |
2859 CHECK_LIVE_FRAME (new_frame); | 2859 CHECK_LIVE_FRAME (new_frame); |
2860 lface = lface_from_face_name (XFRAME (frame), from, 1); | 2860 lface = lface_from_face_name (XFRAME (frame), from, 1); |
2861 copy = Finternal_make_lisp_face (to, new_frame); | 2861 copy = Finternal_make_lisp_face (to, new_frame); |
2862 } | 2862 } |
2863 | 2863 |
2864 bcopy (XVECTOR (lface)->contents, XVECTOR (copy)->contents, | 2864 memcpy (XVECTOR (copy)->contents, XVECTOR (lface)->contents, |
2865 LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); | 2865 LFACE_VECTOR_SIZE * sizeof (Lisp_Object)); |
2866 | 2866 |
2867 /* Changing a named face means that all realized faces depending on | 2867 /* Changing a named face means that all realized faces depending on |
2868 that face are invalid. Since we cannot tell which realized faces | 2868 that face are invalid. Since we cannot tell which realized faces |
2869 depend on the face, make sure they are all removed. This is done | 2869 depend on the face, make sure they are all removed. This is done |
2870 by incrementing face_change_count. The next call to | 2870 by incrementing face_change_count. The next call to |
3888 /* This can be NULL (e.g., in batch mode). */ | 3888 /* This can be NULL (e.g., in batch mode). */ |
3889 if (oldface) | 3889 if (oldface) |
3890 { | 3890 { |
3891 /* Ensure that the face vector is fully specified by merging | 3891 /* Ensure that the face vector is fully specified by merging |
3892 the previously-cached vector. */ | 3892 the previously-cached vector. */ |
3893 bcopy (oldface->lface, attrs, sizeof attrs); | 3893 memcpy (attrs, oldface->lface, sizeof attrs); |
3894 merge_face_vectors (f, lvec, attrs, 0); | 3894 merge_face_vectors (f, lvec, attrs, 0); |
3895 bcopy (attrs, lvec, sizeof attrs); | 3895 memcpy (lvec, attrs, sizeof attrs); |
3896 newface = realize_face (c, lvec, DEFAULT_FACE_ID); | 3896 newface = realize_face (c, lvec, DEFAULT_FACE_ID); |
3897 | 3897 |
3898 if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) | 3898 if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX]) |
3899 || ! UNSPECIFIEDP (gvec[LFACE_FOUNDRY_INDEX]) | 3899 || ! UNSPECIFIEDP (gvec[LFACE_FOUNDRY_INDEX]) |
3900 || ! UNSPECIFIEDP (gvec[LFACE_HEIGHT_INDEX]) | 3900 || ! UNSPECIFIEDP (gvec[LFACE_HEIGHT_INDEX]) |
3995 { | 3995 { |
3996 case Lisp_String: | 3996 case Lisp_String: |
3997 if (SBYTES (v1) != SBYTES (v2)) | 3997 if (SBYTES (v1) != SBYTES (v2)) |
3998 return 0; | 3998 return 0; |
3999 | 3999 |
4000 return bcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; | 4000 return memcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; |
4001 | 4001 |
4002 case_Lisp_Int: | 4002 case_Lisp_Int: |
4003 case Lisp_Symbol: | 4003 case Lisp_Symbol: |
4004 return 0; | 4004 return 0; |
4005 | 4005 |
4167 | 4167 |
4168 static struct face * | 4168 static struct face * |
4169 make_realized_face (Lisp_Object *attr) | 4169 make_realized_face (Lisp_Object *attr) |
4170 { | 4170 { |
4171 struct face *face = (struct face *) xmalloc (sizeof *face); | 4171 struct face *face = (struct face *) xmalloc (sizeof *face); |
4172 bzero (face, sizeof *face); | 4172 memset (face, 0, sizeof *face); |
4173 face->ascii_face = face; | 4173 face->ascii_face = face; |
4174 bcopy (attr, face->lface, sizeof face->lface); | 4174 memcpy (face->lface, attr, sizeof face->lface); |
4175 return face; | 4175 return face; |
4176 } | 4176 } |
4177 | 4177 |
4178 | 4178 |
4179 /* Free realized face FACE, including its X resources. FACE may | 4179 /* Free realized face FACE, including its X resources. FACE may |
4314 { | 4314 { |
4315 struct face_cache *c; | 4315 struct face_cache *c; |
4316 int size; | 4316 int size; |
4317 | 4317 |
4318 c = (struct face_cache *) xmalloc (sizeof *c); | 4318 c = (struct face_cache *) xmalloc (sizeof *c); |
4319 bzero (c, sizeof *c); | 4319 memset (c, 0, sizeof *c); |
4320 size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; | 4320 size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; |
4321 c->buckets = (struct face **) xmalloc (size); | 4321 c->buckets = (struct face **) xmalloc (size); |
4322 bzero (c->buckets, size); | 4322 memset (c->buckets, 0, size); |
4323 c->size = 50; | 4323 c->size = 50; |
4324 c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); | 4324 c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); |
4325 c->f = f; | 4325 c->f = f; |
4326 c->menu_face_changed_p = menu_face_changed_default; | 4326 c->menu_face_changed_p = menu_face_changed_default; |
4327 return c; | 4327 return c; |
4381 c->faces_by_id[i] = NULL; | 4381 c->faces_by_id[i] = NULL; |
4382 } | 4382 } |
4383 | 4383 |
4384 c->used = 0; | 4384 c->used = 0; |
4385 size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; | 4385 size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; |
4386 bzero (c->buckets, size); | 4386 memset (c->buckets, 0, size); |
4387 | 4387 |
4388 /* Must do a thorough redisplay the next time. Mark current | 4388 /* Must do a thorough redisplay the next time. Mark current |
4389 matrices as invalid because they will reference faces freed | 4389 matrices as invalid because they will reference faces freed |
4390 above. This function is also called when a frame is | 4390 above. This function is also called when a frame is |
4391 destroyed. In this case, the root window of F is nil. */ | 4391 destroyed. In this case, the root window of F is nil. */ |
4678 } | 4678 } |
4679 | 4679 |
4680 if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) | 4680 if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) |
4681 return -1; | 4681 return -1; |
4682 | 4682 |
4683 bcopy (default_face->lface, attrs, sizeof attrs); | 4683 memcpy (attrs, default_face->lface, sizeof attrs); |
4684 merge_face_vectors (f, symbol_attrs, attrs, 0); | 4684 merge_face_vectors (f, symbol_attrs, attrs, 0); |
4685 | 4685 |
4686 return lookup_face (f, attrs); | 4686 return lookup_face (f, attrs); |
4687 } | 4687 } |
4688 | 4688 |
4779 /* Try in increments of 1/2 pt. */ | 4779 /* Try in increments of 1/2 pt. */ |
4780 delta = steps < 0 ? 5 : -5; | 4780 delta = steps < 0 ? 5 : -5; |
4781 steps = eabs (steps); | 4781 steps = eabs (steps); |
4782 | 4782 |
4783 face = FACE_FROM_ID (f, face_id); | 4783 face = FACE_FROM_ID (f, face_id); |
4784 bcopy (face->lface, attrs, sizeof attrs); | 4784 memcpy (attrs, face->lface, sizeof attrs); |
4785 pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]); | 4785 pt = last_pt = XFASTINT (attrs[LFACE_HEIGHT_INDEX]); |
4786 new_face_id = face_id; | 4786 new_face_id = face_id; |
4787 last_height = FONT_HEIGHT (face->font); | 4787 last_height = FONT_HEIGHT (face->font); |
4788 | 4788 |
4789 while (steps | 4789 while (steps |
4830 if (FRAME_TERMCAP_P (f) | 4830 if (FRAME_TERMCAP_P (f) |
4831 || height <= 0) | 4831 || height <= 0) |
4832 return face_id; | 4832 return face_id; |
4833 | 4833 |
4834 face = FACE_FROM_ID (f, face_id); | 4834 face = FACE_FROM_ID (f, face_id); |
4835 bcopy (face->lface, attrs, sizeof attrs); | 4835 memcpy (attrs, face->lface, sizeof attrs); |
4836 attrs[LFACE_HEIGHT_INDEX] = make_number (height); | 4836 attrs[LFACE_HEIGHT_INDEX] = make_number (height); |
4837 font_clear_prop (attrs, FONT_SIZE_INDEX); | 4837 font_clear_prop (attrs, FONT_SIZE_INDEX); |
4838 face_id = lookup_face (f, attrs); | 4838 face_id = lookup_face (f, attrs); |
4839 #endif /* HAVE_WINDOW_SYSTEM */ | 4839 #endif /* HAVE_WINDOW_SYSTEM */ |
4840 | 4840 |
4860 abort (); | 4860 abort (); |
4861 | 4861 |
4862 if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) | 4862 if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) |
4863 return -1; | 4863 return -1; |
4864 | 4864 |
4865 bcopy (default_face->lface, attrs, sizeof attrs); | 4865 memcpy (attrs, default_face->lface, sizeof attrs); |
4866 merge_face_vectors (f, symbol_attrs, attrs, 0); | 4866 merge_face_vectors (f, symbol_attrs, attrs, 0); |
4867 return lookup_face (f, attrs); | 4867 return lookup_face (f, attrs); |
4868 } | 4868 } |
4869 | 4869 |
4870 DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, | 4870 DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, |
4951 int face_id; | 4951 int face_id; |
4952 struct face *face; | 4952 struct face *face; |
4953 Lisp_Object merged_attrs[LFACE_VECTOR_SIZE]; | 4953 Lisp_Object merged_attrs[LFACE_VECTOR_SIZE]; |
4954 int i; | 4954 int i; |
4955 | 4955 |
4956 bcopy (def_attrs, merged_attrs, sizeof merged_attrs); | 4956 memcpy (merged_attrs, def_attrs, sizeof merged_attrs); |
4957 | 4957 |
4958 merge_face_vectors (f, attrs, merged_attrs, 0); | 4958 merge_face_vectors (f, attrs, merged_attrs, 0); |
4959 | 4959 |
4960 face_id = lookup_face (f, merged_attrs); | 4960 face_id = lookup_face (f, merged_attrs); |
4961 face = FACE_FROM_ID (f, face_id); | 4961 face = FACE_FROM_ID (f, face_id); |
5272 Lisp_Object list; | 5272 Lisp_Object list; |
5273 int i; | 5273 int i; |
5274 int indices[DIM (font_sort_order)]; | 5274 int indices[DIM (font_sort_order)]; |
5275 | 5275 |
5276 CHECK_LIST (order); | 5276 CHECK_LIST (order); |
5277 bzero (indices, sizeof indices); | 5277 memset (indices, 0, sizeof indices); |
5278 i = 0; | 5278 i = 0; |
5279 | 5279 |
5280 for (list = order; | 5280 for (list = order; |
5281 CONSP (list) && i < DIM (indices); | 5281 CONSP (list) && i < DIM (indices); |
5282 list = XCDR (list), ++i) | 5282 list = XCDR (list), ++i) |
5304 signal_error ("Invalid font sort order", order); | 5304 signal_error ("Invalid font sort order", order); |
5305 for (i = 0; i < DIM (font_sort_order); ++i) | 5305 for (i = 0; i < DIM (font_sort_order); ++i) |
5306 if (indices[i] == 0) | 5306 if (indices[i] == 0) |
5307 signal_error ("Invalid font sort order", order); | 5307 signal_error ("Invalid font sort order", order); |
5308 | 5308 |
5309 if (bcmp (indices, font_sort_order, sizeof indices) != 0) | 5309 if (memcmp (indices, font_sort_order, sizeof indices) != 0) |
5310 { | 5310 { |
5311 bcopy (indices, font_sort_order, sizeof font_sort_order); | 5311 memcpy (font_sort_order, indices, sizeof font_sort_order); |
5312 free_all_realized_faces (Qnil); | 5312 free_all_realized_faces (Qnil); |
5313 } | 5313 } |
5314 | 5314 |
5315 font_update_sort_order (font_sort_order); | 5315 font_update_sort_order (font_sort_order); |
5316 | 5316 |
5551 LFACE_STIPPLE (lface) = Qnil; | 5551 LFACE_STIPPLE (lface) = Qnil; |
5552 | 5552 |
5553 /* Realize the face; it must be fully-specified now. */ | 5553 /* Realize the face; it must be fully-specified now. */ |
5554 xassert (lface_fully_specified_p (XVECTOR (lface)->contents)); | 5554 xassert (lface_fully_specified_p (XVECTOR (lface)->contents)); |
5555 check_lface (lface); | 5555 check_lface (lface); |
5556 bcopy (XVECTOR (lface)->contents, attrs, sizeof attrs); | 5556 memcpy (attrs, XVECTOR (lface)->contents, sizeof attrs); |
5557 face = realize_face (c, attrs, DEFAULT_FACE_ID); | 5557 face = realize_face (c, attrs, DEFAULT_FACE_ID); |
5558 | 5558 |
5559 #ifdef HAVE_WINDOW_SYSTEM | 5559 #ifdef HAVE_WINDOW_SYSTEM |
5560 #ifdef HAVE_X_WINDOWS | 5560 #ifdef HAVE_X_WINDOWS |
5561 if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) | 5561 if (FRAME_X_P (f) && face->font != FRAME_FONT (f)) |
6072 } | 6072 } |
6073 else | 6073 else |
6074 { | 6074 { |
6075 Lisp_Object attrs[LFACE_VECTOR_SIZE]; | 6075 Lisp_Object attrs[LFACE_VECTOR_SIZE]; |
6076 struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 6076 struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
6077 bcopy (default_face->lface, attrs, sizeof attrs); | 6077 memcpy (attrs, default_face->lface, sizeof attrs); |
6078 merge_face_ref (f, prop, attrs, 1, 0); | 6078 merge_face_ref (f, prop, attrs, 1, 0); |
6079 face_id = lookup_face (f, attrs); | 6079 face_id = lookup_face (f, attrs); |
6080 } | 6080 } |
6081 | 6081 |
6082 return face_id; | 6082 return face_id; |
6161 && NILP (prop) | 6161 && NILP (prop) |
6162 && !(pos >= region_beg && pos < region_end)) | 6162 && !(pos >= region_beg && pos < region_end)) |
6163 return default_face->id; | 6163 return default_face->id; |
6164 | 6164 |
6165 /* Begin with attributes from the default face. */ | 6165 /* Begin with attributes from the default face. */ |
6166 bcopy (default_face->lface, attrs, sizeof attrs); | 6166 memcpy (attrs, default_face->lface, sizeof attrs); |
6167 | 6167 |
6168 /* Merge in attributes specified via text properties. */ | 6168 /* Merge in attributes specified via text properties. */ |
6169 if (!NILP (prop)) | 6169 if (!NILP (prop)) |
6170 merge_face_ref (f, prop, attrs, 1, 0); | 6170 merge_face_ref (f, prop, attrs, 1, 0); |
6171 | 6171 |
6255 if (NILP (prop) | 6255 if (NILP (prop) |
6256 && !(pos >= region_beg && pos < region_end)) | 6256 && !(pos >= region_beg && pos < region_end)) |
6257 return DEFAULT_FACE_ID; | 6257 return DEFAULT_FACE_ID; |
6258 | 6258 |
6259 /* Begin with attributes from the default face. */ | 6259 /* Begin with attributes from the default face. */ |
6260 bcopy (default_face->lface, attrs, sizeof attrs); | 6260 memcpy (attrs, default_face->lface, sizeof attrs); |
6261 | 6261 |
6262 /* Merge in attributes specified via text properties. */ | 6262 /* Merge in attributes specified via text properties. */ |
6263 if (!NILP (prop)) | 6263 if (!NILP (prop)) |
6264 merge_face_ref (f, prop, attrs, 1, 0); | 6264 merge_face_ref (f, prop, attrs, 1, 0); |
6265 | 6265 |
6356 || !FRAME_WINDOW_P (f) | 6356 || !FRAME_WINDOW_P (f) |
6357 || FACE_SUITABLE_FOR_CHAR_P (base_face, 0))) | 6357 || FACE_SUITABLE_FOR_CHAR_P (base_face, 0))) |
6358 return base_face->id; | 6358 return base_face->id; |
6359 | 6359 |
6360 /* Begin with attributes from the base face. */ | 6360 /* Begin with attributes from the base face. */ |
6361 bcopy (base_face->lface, attrs, sizeof attrs); | 6361 memcpy (attrs, base_face->lface, sizeof attrs); |
6362 | 6362 |
6363 /* Merge in attributes specified via text properties. */ | 6363 /* Merge in attributes specified via text properties. */ |
6364 if (!NILP (prop)) | 6364 if (!NILP (prop)) |
6365 merge_face_ref (f, prop, attrs, 1, 0); | 6365 merge_face_ref (f, prop, attrs, 1, 0); |
6366 | 6366 |
6411 face_id = lookup_derived_face (f, face_name, base_face_id, 0); | 6411 face_id = lookup_derived_face (f, face_name, base_face_id, 0); |
6412 return (face_id >= 0 ? face_id : base_face_id); | 6412 return (face_id >= 0 ? face_id : base_face_id); |
6413 } | 6413 } |
6414 | 6414 |
6415 /* Begin with attributes from the base face. */ | 6415 /* Begin with attributes from the base face. */ |
6416 bcopy (base_face->lface, attrs, sizeof attrs); | 6416 memcpy (attrs, base_face->lface, sizeof attrs); |
6417 | 6417 |
6418 if (!NILP (face_name)) | 6418 if (!NILP (face_name)) |
6419 { | 6419 { |
6420 if (!merge_named_face (f, face_name, attrs, 0)) | 6420 if (!merge_named_face (f, face_name, attrs, 0)) |
6421 return base_face_id; | 6421 return base_face_id; |