changeset 109360:f37b85834f7e

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.
author Dan Nicolaescu <dann@ics.uci.edu>
date Mon, 12 Jul 2010 09:32:53 -0700
parents b7e047772c64
children 8ee7c0cee7f9
files src/ChangeLog src/ccl.c src/charset.c src/coding.c src/dispnew.c src/keyboard.c src/scroll.c src/xdisp.c
diffstat 8 files changed, 45 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/ChangeLog	Mon Jul 12 09:32:53 2010 -0700
@@ -1,3 +1,18 @@
+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)
--- a/src/ccl.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/ccl.c	Mon Jul 12 09:32:53 2010 -0700
@@ -1968,8 +1968,7 @@
 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 @@
 
 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 @@
 
 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 @@
 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 @@
        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;
--- a/src/charset.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/charset.c	Mon Jul 12 09:32:53 2010 -0700
@@ -730,12 +730,8 @@
 }
 
 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;
--- a/src/coding.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/coding.c	Mon Jul 12 09:32:53 2010 -0700
@@ -9017,10 +9017,8 @@
 }
 
 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;
--- a/src/dispnew.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/dispnew.c	Mon Jul 12 09:32:53 2010 -0700
@@ -1776,12 +1776,8 @@
 #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 @@
    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;
--- a/src/keyboard.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/keyboard.c	Mon Jul 12 09:32:53 2010 -0700
@@ -3593,7 +3593,7 @@
 /* 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 @@
   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 @@
   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]));
--- a/src/scroll.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/scroll.c	Mon Jul 12 09:32:53 2010 -0700
@@ -640,13 +640,9 @@
    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 @@
 
 
 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 *)
--- a/src/xdisp.c	Mon Jul 12 16:16:38 2010 +0200
+++ b/src/xdisp.c	Mon Jul 12 09:32:53 2010 -0700
@@ -1311,11 +1311,8 @@
    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 @@
    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 @@
    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;