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