diff options
| author | Dan Nicolaescu | 2010-07-12 09:32:53 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-12 09:32:53 -0700 |
| commit | 6f704c767571d03df1cb429aadccd60b82a5c47b (patch) | |
| tree | de786f95130149b5923c2af9db97573ec1ce0719 /src | |
| parent | e6cfa7c31f88729a1050e4970c11b8c0c8c1f76c (diff) | |
| download | emacs-6f704c767571d03df1cb429aadccd60b82a5c47b.tar.gz emacs-6f704c767571d03df1cb429aadccd60b82a5c47b.zip | |
Convert more function definitions to standard C.
* src/xdisp.c (window_box_edges, handle_single_display_spec)
(display_string): Convert definition to standard C.
* src/scroll.c (do_direct_scrolling, scrolling_1):
* src/dispnew.c (allocate_matrices_for_frame_redisplay)
(mirrored_line_dance):
* src/coding.c (code_convert_string):
* src/charset.c (map_charset_chars):
* src/ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string)
(Fregister_ccl_program, Fregister_code_conversion_map):
* src/keyboard.c (kbd_buffer_nr_stored): Likewise.
(head_table): Make static and const.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/ccl.c | 15 | ||||
| -rw-r--r-- | src/charset.c | 8 | ||||
| -rw-r--r-- | src/coding.c | 6 | ||||
| -rw-r--r-- | src/dispnew.c | 16 | ||||
| -rw-r--r-- | src/keyboard.c | 6 | ||||
| -rw-r--r-- | src/scroll.c | 22 | ||||
| -rw-r--r-- | src/xdisp.c | 31 |
8 files changed, 45 insertions, 74 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0a148687647..7e6b67cc176 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2010-07-12 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Convert more function definitions to standard C. | ||
| 4 | * xdisp.c (window_box_edges, handle_single_display_spec) | ||
| 5 | (display_string): Convert definition to standard C. | ||
| 6 | * scroll.c (do_direct_scrolling, scrolling_1): | ||
| 7 | * dispnew.c (allocate_matrices_for_frame_redisplay) | ||
| 8 | (mirrored_line_dance): | ||
| 9 | * coding.c (code_convert_string): | ||
| 10 | * charset.c (map_charset_chars): | ||
| 11 | * ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string) | ||
| 12 | (Fregister_ccl_program, Fregister_code_conversion_map): | ||
| 13 | * keyboard.c (kbd_buffer_nr_stored): Likewise. | ||
| 14 | (head_table): Make static and const. | ||
| 15 | |||
| 1 | 2010-07-12 Andreas Schwab <schwab@linux-m68k.org> | 16 | 2010-07-12 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 17 | ||
| 3 | * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) | 18 | * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) |
| @@ -1968,8 +1968,7 @@ check_ccl_update (struct ccl_program *ccl) | |||
| 1968 | DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, | 1968 | DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, |
| 1969 | doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. | 1969 | doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. |
| 1970 | See the documentation of `define-ccl-program' for the detail of CCL program. */) | 1970 | See the documentation of `define-ccl-program' for the detail of CCL program. */) |
| 1971 | (object) | 1971 | (Lisp_Object object) |
| 1972 | Lisp_Object object; | ||
| 1973 | { | 1972 | { |
| 1974 | Lisp_Object val; | 1973 | Lisp_Object val; |
| 1975 | 1974 | ||
| @@ -2003,8 +2002,7 @@ the corresponding register after the execution. | |||
| 2003 | 2002 | ||
| 2004 | See the documentation of `define-ccl-program' for a definition of CCL | 2003 | See the documentation of `define-ccl-program' for a definition of CCL |
| 2005 | programs. */) | 2004 | programs. */) |
| 2006 | (ccl_prog, reg) | 2005 | (Lisp_Object ccl_prog, Lisp_Object reg) |
| 2007 | Lisp_Object ccl_prog, reg; | ||
| 2008 | { | 2006 | { |
| 2009 | struct ccl_program ccl; | 2007 | struct ccl_program ccl; |
| 2010 | int i; | 2008 | int i; |
| @@ -2058,8 +2056,7 @@ is a unibyte string. By default it is a multibyte string. | |||
| 2058 | 2056 | ||
| 2059 | See the documentation of `define-ccl-program' for the detail of CCL program. | 2057 | See the documentation of `define-ccl-program' for the detail of CCL program. |
| 2060 | usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */) | 2058 | usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */) |
| 2061 | (ccl_prog, status, str, contin, unibyte_p) | 2059 | (Lisp_Object ccl_prog, Lisp_Object status, Lisp_Object str, Lisp_Object contin, Lisp_Object unibyte_p) |
| 2062 | Lisp_Object ccl_prog, status, str, contin, unibyte_p; | ||
| 2063 | { | 2060 | { |
| 2064 | Lisp_Object val; | 2061 | Lisp_Object val; |
| 2065 | struct ccl_program ccl; | 2062 | struct ccl_program ccl; |
| @@ -2189,8 +2186,7 @@ DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program, | |||
| 2189 | CCL-PROG should be a compiled CCL program (vector), or nil. | 2186 | CCL-PROG should be a compiled CCL program (vector), or nil. |
| 2190 | If it is nil, just reserve NAME as a CCL program name. | 2187 | If it is nil, just reserve NAME as a CCL program name. |
| 2191 | Return index number of the registered CCL program. */) | 2188 | Return index number of the registered CCL program. */) |
| 2192 | (name, ccl_prog) | 2189 | (Lisp_Object name, Lisp_Object ccl_prog) |
| 2193 | Lisp_Object name, ccl_prog; | ||
| 2194 | { | 2190 | { |
| 2195 | int len = ASIZE (Vccl_program_table); | 2191 | int len = ASIZE (Vccl_program_table); |
| 2196 | int idx; | 2192 | int idx; |
| @@ -2265,8 +2261,7 @@ DEFUN ("register-code-conversion-map", Fregister_code_conversion_map, | |||
| 2265 | 2, 2, 0, | 2261 | 2, 2, 0, |
| 2266 | doc: /* Register SYMBOL as code conversion map MAP. | 2262 | doc: /* Register SYMBOL as code conversion map MAP. |
| 2267 | Return index number of the registered map. */) | 2263 | Return index number of the registered map. */) |
| 2268 | (symbol, map) | 2264 | (Lisp_Object symbol, Lisp_Object map) |
| 2269 | Lisp_Object symbol, map; | ||
| 2270 | { | 2265 | { |
| 2271 | int len = ASIZE (Vcode_conversion_map_vector); | 2266 | int len = ASIZE (Vcode_conversion_map_vector); |
| 2272 | int i; | 2267 | int i; |
diff --git a/src/charset.c b/src/charset.c index 31112c81cdc..84df00da63a 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -730,12 +730,8 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object | |||
| 730 | } | 730 | } |
| 731 | 731 | ||
| 732 | void | 732 | void |
| 733 | map_charset_chars (c_function, function, arg, | 733 | map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object function, |
| 734 | charset, from, to) | 734 | Lisp_Object arg, struct charset *charset, unsigned from, unsigned to) |
| 735 | void (*c_function) (Lisp_Object, Lisp_Object); | ||
| 736 | Lisp_Object function, arg; | ||
| 737 | struct charset *charset; | ||
| 738 | unsigned from, to; | ||
| 739 | { | 735 | { |
| 740 | Lisp_Object range; | 736 | Lisp_Object range; |
| 741 | int partial; | 737 | int partial; |
diff --git a/src/coding.c b/src/coding.c index 44fb992d1a8..dcd31fe9f28 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9017,10 +9017,8 @@ not fully specified.) */) | |||
| 9017 | } | 9017 | } |
| 9018 | 9018 | ||
| 9019 | Lisp_Object | 9019 | Lisp_Object |
| 9020 | code_convert_string (string, coding_system, dst_object, | 9020 | code_convert_string (Lisp_Object string, Lisp_Object coding_system, |
| 9021 | encodep, nocopy, norecord) | 9021 | Lisp_Object dst_object, int encodep, int nocopy, int norecord) |
| 9022 | Lisp_Object string, coding_system, dst_object; | ||
| 9023 | int encodep, nocopy, norecord; | ||
| 9024 | { | 9022 | { |
| 9025 | struct coding_system coding; | 9023 | struct coding_system coding; |
| 9026 | EMACS_INT chars, bytes; | 9024 | EMACS_INT chars, bytes; |
diff --git a/src/dispnew.c b/src/dispnew.c index eda7244ad54..fe64143ec07 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -1776,12 +1776,8 @@ check_matrix_invariants (w) | |||
| 1776 | #define CHANGED_LEAF_MATRIX (1 << 1) | 1776 | #define CHANGED_LEAF_MATRIX (1 << 1) |
| 1777 | 1777 | ||
| 1778 | static struct dim | 1778 | static struct dim |
| 1779 | allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p, | 1779 | allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y, |
| 1780 | window_change_flags) | 1780 | int dim_only_p, int *window_change_flags) |
| 1781 | Lisp_Object window; | ||
| 1782 | int x, y; | ||
| 1783 | int dim_only_p; | ||
| 1784 | int *window_change_flags; | ||
| 1785 | { | 1781 | { |
| 1786 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); | 1782 | struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); |
| 1787 | int x0 = x, y0 = y; | 1783 | int x0 = x, y0 = y; |
| @@ -2915,12 +2911,8 @@ mirror_make_current (struct window *w, int frame_row) | |||
| 2915 | This function is called from do_scrolling and do_direct_scrolling. */ | 2911 | This function is called from do_scrolling and do_direct_scrolling. */ |
| 2916 | 2912 | ||
| 2917 | void | 2913 | void |
| 2918 | mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from, | 2914 | mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlines, |
| 2919 | retained_p) | 2915 | int *copy_from, char *retained_p) |
| 2920 | struct glyph_matrix *matrix; | ||
| 2921 | int unchanged_at_top, nlines; | ||
| 2922 | int *copy_from; | ||
| 2923 | char *retained_p; | ||
| 2924 | { | 2916 | { |
| 2925 | /* A copy of original rows. */ | 2917 | /* A copy of original rows. */ |
| 2926 | struct glyph_row *old_rows; | 2918 | struct glyph_row *old_rows; |
diff --git a/src/keyboard.c b/src/keyboard.c index bf3a01fc481..4ce915d28ab 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3593,7 +3593,7 @@ event_to_kboard (struct input_event *event) | |||
| 3593 | /* Return the number of slots occupied in kbd_buffer. */ | 3593 | /* Return the number of slots occupied in kbd_buffer. */ |
| 3594 | 3594 | ||
| 3595 | static int | 3595 | static int |
| 3596 | kbd_buffer_nr_stored () | 3596 | kbd_buffer_nr_stored (void) |
| 3597 | { | 3597 | { |
| 3598 | return kbd_fetch_ptr == kbd_store_ptr | 3598 | return kbd_fetch_ptr == kbd_store_ptr |
| 3599 | ? 0 | 3599 | ? 0 |
| @@ -11536,7 +11536,7 @@ struct event_head { | |||
| 11536 | Lisp_Object *kind; | 11536 | Lisp_Object *kind; |
| 11537 | }; | 11537 | }; |
| 11538 | 11538 | ||
| 11539 | struct event_head head_table[] = { | 11539 | static const struct event_head head_table[] = { |
| 11540 | {&Qmouse_movement, "mouse-movement", &Qmouse_movement}, | 11540 | {&Qmouse_movement, "mouse-movement", &Qmouse_movement}, |
| 11541 | {&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement}, | 11541 | {&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement}, |
| 11542 | {&Qswitch_frame, "switch-frame", &Qswitch_frame}, | 11542 | {&Qswitch_frame, "switch-frame", &Qswitch_frame}, |
| @@ -11721,7 +11721,7 @@ syms_of_keyboard (void) | |||
| 11721 | last_point_position_window = Qnil; | 11721 | last_point_position_window = Qnil; |
| 11722 | 11722 | ||
| 11723 | { | 11723 | { |
| 11724 | struct event_head *p; | 11724 | const struct event_head *p; |
| 11725 | 11725 | ||
| 11726 | for (p = head_table; | 11726 | for (p = head_table; |
| 11727 | p < head_table + (sizeof (head_table) / sizeof (head_table[0])); | 11727 | p < head_table + (sizeof (head_table) / sizeof (head_table[0])); |
diff --git a/src/scroll.c b/src/scroll.c index 3b033f3bfda..bf7a6d484cb 100644 --- a/src/scroll.c +++ b/src/scroll.c | |||
| @@ -640,13 +640,9 @@ calculate_direct_scrolling (FRAME_PTR frame, | |||
| 640 | the cost matrix for this approach is constructed. */ | 640 | the cost matrix for this approach is constructed. */ |
| 641 | 641 | ||
| 642 | static void | 642 | static void |
| 643 | do_direct_scrolling (frame, current_matrix, cost_matrix, | 643 | do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, |
| 644 | window_size, unchanged_at_top) | 644 | struct matrix_elt *cost_matrix, int window_size, |
| 645 | struct frame *frame; | 645 | int unchanged_at_top) |
| 646 | struct glyph_matrix *current_matrix; | ||
| 647 | struct matrix_elt *cost_matrix; | ||
| 648 | int window_size; | ||
| 649 | int unchanged_at_top; | ||
| 650 | { | 646 | { |
| 651 | struct matrix_elt *p; | 647 | struct matrix_elt *p; |
| 652 | int i, j; | 648 | int i, j; |
| @@ -796,15 +792,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix, | |||
| 796 | 792 | ||
| 797 | 793 | ||
| 798 | void | 794 | void |
| 799 | scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom, | 795 | scrolling_1 (FRAME_PTR frame, int window_size, int unchanged_at_top, |
| 800 | draw_cost, old_draw_cost, old_hash, new_hash, free_at_end) | 796 | int unchanged_at_bottom, int *draw_cost, int *old_draw_cost, |
| 801 | FRAME_PTR frame; | 797 | int *old_hash, int *new_hash, int free_at_end) |
| 802 | int window_size, unchanged_at_top, unchanged_at_bottom; | ||
| 803 | int *draw_cost; | ||
| 804 | int *old_draw_cost; | ||
| 805 | int *old_hash; | ||
| 806 | int *new_hash; | ||
| 807 | int free_at_end; | ||
| 808 | { | 798 | { |
| 809 | struct matrix_elt *matrix; | 799 | struct matrix_elt *matrix; |
| 810 | matrix = ((struct matrix_elt *) | 800 | matrix = ((struct matrix_elt *) |
diff --git a/src/xdisp.c b/src/xdisp.c index b68425da743..97e6f1c09f7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1311,11 +1311,8 @@ window_box (struct window *w, int area, int *box_x, int *box_y, | |||
| 1311 | box. */ | 1311 | box. */ |
| 1312 | 1312 | ||
| 1313 | INLINE void | 1313 | INLINE void |
| 1314 | window_box_edges (w, area, top_left_x, top_left_y, | 1314 | window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y, |
| 1315 | bottom_right_x, bottom_right_y) | 1315 | int *bottom_right_x, int *bottom_right_y) |
| 1316 | struct window *w; | ||
| 1317 | int area; | ||
| 1318 | int *top_left_x, *top_left_y, *bottom_right_x, *bottom_right_y; | ||
| 1319 | { | 1316 | { |
| 1320 | window_box (w, area, top_left_x, top_left_y, bottom_right_x, | 1317 | window_box (w, area, top_left_x, top_left_y, bottom_right_x, |
| 1321 | bottom_right_y); | 1318 | bottom_right_y); |
| @@ -4078,14 +4075,9 @@ display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos) | |||
| 4078 | of buffer or string text. */ | 4075 | of buffer or string text. */ |
| 4079 | 4076 | ||
| 4080 | static int | 4077 | static int |
| 4081 | handle_single_display_spec (it, spec, object, overlay, position, | 4078 | handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, |
| 4082 | display_replaced_before_p) | 4079 | Lisp_Object overlay, struct text_pos *position, |
| 4083 | struct it *it; | 4080 | int display_replaced_before_p) |
| 4084 | Lisp_Object spec; | ||
| 4085 | Lisp_Object object; | ||
| 4086 | Lisp_Object overlay; | ||
| 4087 | struct text_pos *position; | ||
| 4088 | int display_replaced_before_p; | ||
| 4089 | { | 4081 | { |
| 4090 | Lisp_Object form; | 4082 | Lisp_Object form; |
| 4091 | Lisp_Object location, value; | 4083 | Lisp_Object location, value; |
| @@ -19831,16 +19823,9 @@ display_count_lines (int start, int start_byte, int limit_byte, int count, | |||
| 19831 | Value is the number of columns displayed. */ | 19823 | Value is the number of columns displayed. */ |
| 19832 | 19824 | ||
| 19833 | static int | 19825 | static int |
| 19834 | display_string (string, lisp_string, face_string, face_string_pos, | 19826 | display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string, |
| 19835 | start, it, field_width, precision, max_x, multibyte) | 19827 | EMACS_INT face_string_pos, EMACS_INT start, struct it *it, |
| 19836 | unsigned char *string; | 19828 | int field_width, int precision, int max_x, int multibyte) |
| 19837 | Lisp_Object lisp_string; | ||
| 19838 | Lisp_Object face_string; | ||
| 19839 | EMACS_INT face_string_pos; | ||
| 19840 | EMACS_INT start; | ||
| 19841 | struct it *it; | ||
| 19842 | int field_width, precision, max_x; | ||
| 19843 | int multibyte; | ||
| 19844 | { | 19829 | { |
| 19845 | int hpos_at_start = it->hpos; | 19830 | int hpos_at_start = it->hpos; |
| 19846 | int saved_face_id = it->face_id; | 19831 | int saved_face_id = it->face_id; |