Commit 6f704c76 authored by Dan Nicolaescu's avatar Dan Nicolaescu
Browse files

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.
parent e6cfa7c3
2010-07-12 Dan Nicolaescu <dann@ics.uci.edu>
Convert more function definitions to standard C.
* xdisp.c (window_box_edges, handle_single_display_spec)
(display_string): Convert definition to standard C.
* scroll.c (do_direct_scrolling, scrolling_1):
* dispnew.c (allocate_matrices_for_frame_redisplay)
(mirrored_line_dance):
* coding.c (code_convert_string):
* charset.c (map_charset_chars):
* ccl.c (Fccl_program_p, Fccl_execute, Fccl_execute_on_string)
(Fregister_ccl_program, Fregister_code_conversion_map):
* keyboard.c (kbd_buffer_nr_stored): Likewise.
(head_table): Make static and const.
2010-07-12 Andreas Schwab <schwab@linux-m68k.org> 2010-07-12 Andreas Schwab <schwab@linux-m68k.org>
   
* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) * Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
......
...@@ -1968,8 +1968,7 @@ check_ccl_update (struct ccl_program *ccl) ...@@ -1968,8 +1968,7 @@ check_ccl_update (struct ccl_program *ccl)
DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code.
See the documentation of `define-ccl-program' for the detail of CCL program. */) See the documentation of `define-ccl-program' for the detail of CCL program. */)
(object) (Lisp_Object object)
Lisp_Object object;
{ {
Lisp_Object val; Lisp_Object val;
...@@ -2003,8 +2002,7 @@ the corresponding register after the execution. ...@@ -2003,8 +2002,7 @@ the corresponding register after the execution.
See the documentation of `define-ccl-program' for a definition of CCL See the documentation of `define-ccl-program' for a definition of CCL
programs. */) programs. */)
(ccl_prog, reg) (Lisp_Object ccl_prog, Lisp_Object reg)
Lisp_Object ccl_prog, reg;
{ {
struct ccl_program ccl; struct ccl_program ccl;
int i; int i;
...@@ -2058,8 +2056,7 @@ is a unibyte string. By default it is a multibyte string. ...@@ -2058,8 +2056,7 @@ is a unibyte string. By default it is a multibyte string.
See the documentation of `define-ccl-program' for the detail of CCL program. See the documentation of `define-ccl-program' for the detail of CCL program.
usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */) usage: (ccl-execute-on-string CCL-PROGRAM STATUS STRING &optional CONTINUE UNIBYTE-P) */)
(ccl_prog, status, str, contin, unibyte_p) (Lisp_Object ccl_prog, Lisp_Object status, Lisp_Object str, Lisp_Object contin, Lisp_Object unibyte_p)
Lisp_Object ccl_prog, status, str, contin, unibyte_p;
{ {
Lisp_Object val; Lisp_Object val;
struct ccl_program ccl; struct ccl_program ccl;
...@@ -2189,8 +2186,7 @@ DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program, ...@@ -2189,8 +2186,7 @@ DEFUN ("register-ccl-program", Fregister_ccl_program, Sregister_ccl_program,
CCL-PROG should be a compiled CCL program (vector), or nil. CCL-PROG should be a compiled CCL program (vector), or nil.
If it is nil, just reserve NAME as a CCL program name. If it is nil, just reserve NAME as a CCL program name.
Return index number of the registered CCL program. */) Return index number of the registered CCL program. */)
(name, ccl_prog) (Lisp_Object name, Lisp_Object ccl_prog)
Lisp_Object name, ccl_prog;
{ {
int len = ASIZE (Vccl_program_table); int len = ASIZE (Vccl_program_table);
int idx; int idx;
...@@ -2265,8 +2261,7 @@ DEFUN ("register-code-conversion-map", Fregister_code_conversion_map, ...@@ -2265,8 +2261,7 @@ DEFUN ("register-code-conversion-map", Fregister_code_conversion_map,
2, 2, 0, 2, 2, 0,
doc: /* Register SYMBOL as code conversion map MAP. doc: /* Register SYMBOL as code conversion map MAP.
Return index number of the registered map. */) Return index number of the registered map. */)
(symbol, map) (Lisp_Object symbol, Lisp_Object map)
Lisp_Object symbol, map;
{ {
int len = ASIZE (Vcode_conversion_map_vector); int len = ASIZE (Vcode_conversion_map_vector);
int i; int i;
......
...@@ -730,12 +730,8 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object ...@@ -730,12 +730,8 @@ map_charset_for_dump (void (*c_function) (Lisp_Object, Lisp_Object), Lisp_Object
} }
void void
map_charset_chars (c_function, function, arg, map_charset_chars (void (*c_function)(Lisp_Object, Lisp_Object), Lisp_Object function,
charset, from, to) Lisp_Object arg, struct charset *charset, unsigned from, unsigned to)
void (*c_function) (Lisp_Object, Lisp_Object);
Lisp_Object function, arg;
struct charset *charset;
unsigned from, to;
{ {
Lisp_Object range; Lisp_Object range;
int partial; int partial;
......
...@@ -9017,10 +9017,8 @@ not fully specified.) */) ...@@ -9017,10 +9017,8 @@ not fully specified.) */)
} }
Lisp_Object Lisp_Object
code_convert_string (string, coding_system, dst_object, code_convert_string (Lisp_Object string, Lisp_Object coding_system,
encodep, nocopy, norecord) Lisp_Object dst_object, int encodep, int nocopy, int norecord)
Lisp_Object string, coding_system, dst_object;
int encodep, nocopy, norecord;
{ {
struct coding_system coding; struct coding_system coding;
EMACS_INT chars, bytes; EMACS_INT chars, bytes;
......
...@@ -1776,12 +1776,8 @@ check_matrix_invariants (w) ...@@ -1776,12 +1776,8 @@ check_matrix_invariants (w)
#define CHANGED_LEAF_MATRIX (1 << 1) #define CHANGED_LEAF_MATRIX (1 << 1)
static struct dim static struct dim
allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p, allocate_matrices_for_frame_redisplay (Lisp_Object window, int x, int y,
window_change_flags) int dim_only_p, int *window_change_flags)
Lisp_Object window;
int x, y;
int dim_only_p;
int *window_change_flags;
{ {
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window))); struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
int x0 = x, y0 = y; int x0 = x, y0 = y;
...@@ -2915,12 +2911,8 @@ mirror_make_current (struct window *w, int frame_row) ...@@ -2915,12 +2911,8 @@ mirror_make_current (struct window *w, int frame_row)
This function is called from do_scrolling and do_direct_scrolling. */ This function is called from do_scrolling and do_direct_scrolling. */
void void
mirrored_line_dance (matrix, unchanged_at_top, nlines, copy_from, mirrored_line_dance (struct glyph_matrix *matrix, int unchanged_at_top, int nlines,
retained_p) int *copy_from, char *retained_p)
struct glyph_matrix *matrix;
int unchanged_at_top, nlines;
int *copy_from;
char *retained_p;
{ {
/* A copy of original rows. */ /* A copy of original rows. */
struct glyph_row *old_rows; struct glyph_row *old_rows;
......
...@@ -3593,7 +3593,7 @@ event_to_kboard (struct input_event *event) ...@@ -3593,7 +3593,7 @@ event_to_kboard (struct input_event *event)
/* Return the number of slots occupied in kbd_buffer. */ /* Return the number of slots occupied in kbd_buffer. */
static int static int
kbd_buffer_nr_stored () kbd_buffer_nr_stored (void)
{ {
return kbd_fetch_ptr == kbd_store_ptr return kbd_fetch_ptr == kbd_store_ptr
? 0 ? 0
...@@ -11536,7 +11536,7 @@ struct event_head { ...@@ -11536,7 +11536,7 @@ struct event_head {
Lisp_Object *kind; Lisp_Object *kind;
}; };
struct event_head head_table[] = { static const struct event_head head_table[] = {
{&Qmouse_movement, "mouse-movement", &Qmouse_movement}, {&Qmouse_movement, "mouse-movement", &Qmouse_movement},
{&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement}, {&Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement},
{&Qswitch_frame, "switch-frame", &Qswitch_frame}, {&Qswitch_frame, "switch-frame", &Qswitch_frame},
...@@ -11721,7 +11721,7 @@ syms_of_keyboard (void) ...@@ -11721,7 +11721,7 @@ syms_of_keyboard (void)
last_point_position_window = Qnil; last_point_position_window = Qnil;
{ {
struct event_head *p; const struct event_head *p;
for (p = head_table; for (p = head_table;
p < head_table + (sizeof (head_table) / sizeof (head_table[0])); p < head_table + (sizeof (head_table) / sizeof (head_table[0]));
......
...@@ -640,13 +640,9 @@ calculate_direct_scrolling (FRAME_PTR frame, ...@@ -640,13 +640,9 @@ calculate_direct_scrolling (FRAME_PTR frame,
the cost matrix for this approach is constructed. */ the cost matrix for this approach is constructed. */
static void static void
do_direct_scrolling (frame, current_matrix, cost_matrix, do_direct_scrolling (struct frame *frame, struct glyph_matrix *current_matrix,
window_size, unchanged_at_top) struct matrix_elt *cost_matrix, int window_size,
struct frame *frame; int unchanged_at_top)
struct glyph_matrix *current_matrix;
struct matrix_elt *cost_matrix;
int window_size;
int unchanged_at_top;
{ {
struct matrix_elt *p; struct matrix_elt *p;
int i, j; int i, j;
...@@ -796,15 +792,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix, ...@@ -796,15 +792,9 @@ do_direct_scrolling (frame, current_matrix, cost_matrix,
void void
scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom, scrolling_1 (FRAME_PTR frame, int window_size, int unchanged_at_top,
draw_cost, old_draw_cost, old_hash, new_hash, free_at_end) int unchanged_at_bottom, int *draw_cost, int *old_draw_cost,
FRAME_PTR frame; int *old_hash, int *new_hash, int free_at_end)
int window_size, unchanged_at_top, unchanged_at_bottom;
int *draw_cost;
int *old_draw_cost;
int *old_hash;
int *new_hash;
int free_at_end;
{ {
struct matrix_elt *matrix; struct matrix_elt *matrix;
matrix = ((struct matrix_elt *) matrix = ((struct matrix_elt *)
......
...@@ -1311,11 +1311,8 @@ window_box (struct window *w, int area, int *box_x, int *box_y, ...@@ -1311,11 +1311,8 @@ window_box (struct window *w, int area, int *box_x, int *box_y,
box. */ box. */
   
INLINE void INLINE void
window_box_edges (w, area, top_left_x, top_left_y, window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
bottom_right_x, bottom_right_y) int *bottom_right_x, int *bottom_right_y)
struct window *w;
int area;
int *top_left_x, *top_left_y, *bottom_right_x, *bottom_right_y;
{ {
window_box (w, area, top_left_x, top_left_y, bottom_right_x, window_box (w, area, top_left_x, top_left_y, bottom_right_x,
bottom_right_y); bottom_right_y);
...@@ -4078,14 +4075,9 @@ display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos) ...@@ -4078,14 +4075,9 @@ display_prop_end (struct it *it, Lisp_Object object, struct text_pos start_pos)
of buffer or string text. */ of buffer or string text. */
   
static int static int
handle_single_display_spec (it, spec, object, overlay, position, handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
display_replaced_before_p) Lisp_Object overlay, struct text_pos *position,
struct it *it; int display_replaced_before_p)
Lisp_Object spec;
Lisp_Object object;
Lisp_Object overlay;
struct text_pos *position;
int display_replaced_before_p;
{ {
Lisp_Object form; Lisp_Object form;
Lisp_Object location, value; Lisp_Object location, value;
...@@ -19831,16 +19823,9 @@ display_count_lines (int start, int start_byte, int limit_byte, int count, ...@@ -19831,16 +19823,9 @@ display_count_lines (int start, int start_byte, int limit_byte, int count,
Value is the number of columns displayed. */ Value is the number of columns displayed. */
   
static int static int
display_string (string, lisp_string, face_string, face_string_pos, display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string,
start, it, field_width, precision, max_x, multibyte) EMACS_INT face_string_pos, EMACS_INT start, struct it *it,
unsigned char *string; int field_width, int precision, int max_x, int multibyte)
Lisp_Object lisp_string;
Lisp_Object face_string;
EMACS_INT face_string_pos;
EMACS_INT start;
struct it *it;
int field_width, precision, max_x;
int multibyte;
{ {
int hpos_at_start = it->hpos; int hpos_at_start = it->hpos;
int saved_face_id = it->face_id; int saved_face_id = it->face_id;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment