diff options
| author | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-04 00:50:25 -0700 |
| commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
| tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/indent.c | |
| parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
| download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz emacs-971de7fb158335fbda39525feb2d7776a26bc030.zip | |
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
Diffstat (limited to 'src/indent.c')
| -rw-r--r-- | src/indent.c | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/src/indent.c b/src/indent.c index de0026fe103..66f1f4cac49 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -72,7 +72,7 @@ static EMACS_INT current_column_bol_cache; | |||
| 72 | /* Get the display table to use for the current buffer. */ | 72 | /* Get the display table to use for the current buffer. */ |
| 73 | 73 | ||
| 74 | struct Lisp_Char_Table * | 74 | struct Lisp_Char_Table * |
| 75 | buffer_display_table () | 75 | buffer_display_table (void) |
| 76 | { | 76 | { |
| 77 | Lisp_Object thisbuf; | 77 | Lisp_Object thisbuf; |
| 78 | 78 | ||
| @@ -89,9 +89,7 @@ buffer_display_table () | |||
| 89 | /* Return the width of character C under display table DP. */ | 89 | /* Return the width of character C under display table DP. */ |
| 90 | 90 | ||
| 91 | static int | 91 | static int |
| 92 | character_width (c, dp) | 92 | character_width (int c, struct Lisp_Char_Table *dp) |
| 93 | int c; | ||
| 94 | struct Lisp_Char_Table *dp; | ||
| 95 | { | 93 | { |
| 96 | Lisp_Object elt; | 94 | Lisp_Object elt; |
| 97 | 95 | ||
| @@ -125,9 +123,7 @@ character_width (c, dp) | |||
| 125 | invalidate the buffer's width_run_cache. */ | 123 | invalidate the buffer's width_run_cache. */ |
| 126 | 124 | ||
| 127 | int | 125 | int |
| 128 | disptab_matches_widthtab (disptab, widthtab) | 126 | disptab_matches_widthtab (struct Lisp_Char_Table *disptab, struct Lisp_Vector *widthtab) |
| 129 | struct Lisp_Char_Table *disptab; | ||
| 130 | struct Lisp_Vector *widthtab; | ||
| 131 | { | 127 | { |
| 132 | int i; | 128 | int i; |
| 133 | 129 | ||
| @@ -145,9 +141,7 @@ disptab_matches_widthtab (disptab, widthtab) | |||
| 145 | /* Recompute BUF's width table, using the display table DISPTAB. */ | 141 | /* Recompute BUF's width table, using the display table DISPTAB. */ |
| 146 | 142 | ||
| 147 | void | 143 | void |
| 148 | recompute_width_table (buf, disptab) | 144 | recompute_width_table (struct buffer *buf, struct Lisp_Char_Table *disptab) |
| 149 | struct buffer *buf; | ||
| 150 | struct Lisp_Char_Table *disptab; | ||
| 151 | { | 145 | { |
| 152 | int i; | 146 | int i; |
| 153 | struct Lisp_Vector *widthtab; | 147 | struct Lisp_Vector *widthtab; |
| @@ -166,7 +160,7 @@ recompute_width_table (buf, disptab) | |||
| 166 | state of current_buffer's cache_long_line_scans variable. */ | 160 | state of current_buffer's cache_long_line_scans variable. */ |
| 167 | 161 | ||
| 168 | static void | 162 | static void |
| 169 | width_run_cache_on_off () | 163 | width_run_cache_on_off (void) |
| 170 | { | 164 | { |
| 171 | if (NILP (current_buffer->cache_long_line_scans) | 165 | if (NILP (current_buffer->cache_long_line_scans) |
| 172 | /* And, for the moment, this feature doesn't work on multibyte | 166 | /* And, for the moment, this feature doesn't work on multibyte |
| @@ -217,11 +211,7 @@ width_run_cache_on_off () | |||
| 217 | will equal the return value. */ | 211 | will equal the return value. */ |
| 218 | 212 | ||
| 219 | EMACS_INT | 213 | EMACS_INT |
| 220 | skip_invisible (pos, next_boundary_p, to, window) | 214 | skip_invisible (EMACS_INT pos, EMACS_INT *next_boundary_p, EMACS_INT to, Lisp_Object window) |
| 221 | EMACS_INT pos; | ||
| 222 | EMACS_INT *next_boundary_p; | ||
| 223 | EMACS_INT to; | ||
| 224 | Lisp_Object window; | ||
| 225 | { | 215 | { |
| 226 | Lisp_Object prop, position, overlay_limit, proplimit; | 216 | Lisp_Object prop, position, overlay_limit, proplimit; |
| 227 | Lisp_Object buffer, tmp; | 217 | Lisp_Object buffer, tmp; |
| @@ -332,13 +322,13 @@ Text that has an invisible property is considered as having width 0, unless | |||
| 332 | /* Cancel any recorded value of the horizontal position. */ | 322 | /* Cancel any recorded value of the horizontal position. */ |
| 333 | 323 | ||
| 334 | void | 324 | void |
| 335 | invalidate_current_column () | 325 | invalidate_current_column (void) |
| 336 | { | 326 | { |
| 337 | last_known_column_point = 0; | 327 | last_known_column_point = 0; |
| 338 | } | 328 | } |
| 339 | 329 | ||
| 340 | double | 330 | double |
| 341 | current_column () | 331 | current_column (void) |
| 342 | { | 332 | { |
| 343 | register int col; | 333 | register int col; |
| 344 | register unsigned char *ptr, *stop; | 334 | register unsigned char *ptr, *stop; |
| @@ -723,7 +713,7 @@ scan_for_column (EMACS_INT *endpos, EMACS_INT *goalcol, EMACS_INT *prevcol) | |||
| 723 | due to text properties or overlays. */ | 713 | due to text properties or overlays. */ |
| 724 | 714 | ||
| 725 | static double | 715 | static double |
| 726 | current_column_1 () | 716 | current_column_1 (void) |
| 727 | { | 717 | { |
| 728 | EMACS_INT col = MOST_POSITIVE_FIXNUM; | 718 | EMACS_INT col = MOST_POSITIVE_FIXNUM; |
| 729 | EMACS_INT opoint = PT; | 719 | EMACS_INT opoint = PT; |
| @@ -887,8 +877,7 @@ following any initial whitespace. */) | |||
| 887 | } | 877 | } |
| 888 | 878 | ||
| 889 | static double | 879 | static double |
| 890 | position_indentation (pos_byte) | 880 | position_indentation (register int pos_byte) |
| 891 | register int pos_byte; | ||
| 892 | { | 881 | { |
| 893 | register EMACS_INT column = 0; | 882 | register EMACS_INT column = 0; |
| 894 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); | 883 | register EMACS_INT tab_width = XINT (current_buffer->tab_width); |
| @@ -977,9 +966,7 @@ position_indentation (pos_byte) | |||
| 977 | preceding line. */ | 966 | preceding line. */ |
| 978 | 967 | ||
| 979 | int | 968 | int |
| 980 | indented_beyond_p (pos, pos_byte, column) | 969 | indented_beyond_p (int pos, int pos_byte, double column) |
| 981 | int pos, pos_byte; | ||
| 982 | double column; | ||
| 983 | { | 970 | { |
| 984 | double val; | 971 | double val; |
| 985 | int opoint = PT, opoint_byte = PT_BYTE; | 972 | int opoint = PT, opoint_byte = PT_BYTE; |
| @@ -1137,12 +1124,7 @@ struct position val_compute_motion; | |||
| 1137 | the scroll bars if they are turned on. */ | 1124 | the scroll bars if they are turned on. */ |
| 1138 | 1125 | ||
| 1139 | struct position * | 1126 | struct position * |
| 1140 | compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hscroll, tab_offset, win) | 1127 | compute_motion (EMACS_INT from, EMACS_INT fromvpos, EMACS_INT fromhpos, int did_motion, EMACS_INT to, EMACS_INT tovpos, EMACS_INT tohpos, EMACS_INT width, EMACS_INT hscroll, EMACS_INT tab_offset, struct window *win) |
| 1141 | EMACS_INT from, fromvpos, fromhpos, to, tovpos, tohpos; | ||
| 1142 | int did_motion; | ||
| 1143 | EMACS_INT width; | ||
| 1144 | EMACS_INT hscroll, tab_offset; | ||
| 1145 | struct window *win; | ||
| 1146 | { | 1128 | { |
| 1147 | register EMACS_INT hpos = fromhpos; | 1129 | register EMACS_INT hpos = fromhpos; |
| 1148 | register EMACS_INT vpos = fromvpos; | 1130 | register EMACS_INT vpos = fromvpos; |
| @@ -1856,9 +1838,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) | |||
| 1856 | struct position val_vmotion; | 1838 | struct position val_vmotion; |
| 1857 | 1839 | ||
| 1858 | struct position * | 1840 | struct position * |
| 1859 | vmotion (from, vtarget, w) | 1841 | vmotion (register EMACS_INT from, register EMACS_INT vtarget, struct window *w) |
| 1860 | register EMACS_INT from, vtarget; | ||
| 1861 | struct window *w; | ||
| 1862 | { | 1842 | { |
| 1863 | EMACS_INT hscroll = XINT (w->hscroll); | 1843 | EMACS_INT hscroll = XINT (w->hscroll); |
| 1864 | struct position pos; | 1844 | struct position pos; |
| @@ -2183,7 +2163,7 @@ whether or not it is currently displayed in some window. */) | |||
| 2183 | /* File's initialization. */ | 2163 | /* File's initialization. */ |
| 2184 | 2164 | ||
| 2185 | void | 2165 | void |
| 2186 | syms_of_indent () | 2166 | syms_of_indent (void) |
| 2187 | { | 2167 | { |
| 2188 | DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode, | 2168 | DEFVAR_BOOL ("indent-tabs-mode", &indent_tabs_mode, |
| 2189 | doc: /* *Indentation can insert tabs if this is non-nil. */); | 2169 | doc: /* *Indentation can insert tabs if this is non-nil. */); |