diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2010-07-04 00:50:25 -0700 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2010-07-04 00:50:25 -0700 |
commit | 971de7fb158335fbda39525feb2d7776a26bc030 (patch) | |
tree | 605333d85f16e35bb06baffcb66ac49f4ec0dce9 /src/region-cache.c | |
parent | b8463cbfbe2c5183cf40772df2746e58b787ddeb (diff) | |
download | emacs-971de7fb158335fbda39525feb2d7776a26bc030.tar.gz |
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/region-cache.c')
-rw-r--r-- | src/region-cache.c | 59 |
1 files changed, 14 insertions, 45 deletions
diff --git a/src/region-cache.c b/src/region-cache.c index d03d7df0bda..45eb723c885 100644 --- a/src/region-cache.c +++ b/src/region-cache.c @@ -122,13 +122,13 @@ struct region_cache { preserve that information, instead of throwing it away. */ #define PRESERVE_THRESHOLD (500) -static void revalidate_region_cache (); +static void revalidate_region_cache (struct buffer *buf, struct region_cache *c); /* Interface: Allocating, initializing, and disposing of region caches. */ struct region_cache * -new_region_cache () +new_region_cache (void) { struct region_cache *c = (struct region_cache *) xmalloc (sizeof (struct region_cache)); @@ -156,8 +156,7 @@ new_region_cache () } void -free_region_cache (c) - struct region_cache *c; +free_region_cache (struct region_cache *c) { xfree (c->boundaries); xfree (c); @@ -174,9 +173,7 @@ free_region_cache (c) entries. It would be nice if it took advantage of locality of reference, too, by searching entries near the last entry found. */ static int -find_cache_boundary (c, pos) - struct region_cache *c; - int pos; +find_cache_boundary (struct region_cache *c, int pos) { int low = 0, high = c->cache_len; @@ -210,10 +207,7 @@ find_cache_boundary (c, pos) /* Move the gap of cache C to index POS, and make sure it has space for at least MIN_SIZE boundaries. */ static void -move_cache_gap (c, pos, min_size) - struct region_cache *c; - int pos; - int min_size; +move_cache_gap (struct region_cache *c, int pos, int min_size) { /* Copy these out of the cache and into registers. */ int gap_start = c->gap_start; @@ -298,10 +292,7 @@ move_cache_gap (c, pos, min_size) /* Insert a new boundary in cache C; it will have cache index INDEX, and have the specified POS and VALUE. */ static void -insert_cache_boundary (c, index, pos, value) - struct region_cache *c; - int index; - int pos, value; +insert_cache_boundary (struct region_cache *c, int index, int pos, int value) { /* index must be a valid cache index. */ if (index < 0 || index > c->cache_len) @@ -337,9 +328,7 @@ insert_cache_boundary (c, index, pos, value) /* Delete the i'th entry from cache C if START <= i < END. */ static void -delete_cache_boundaries (c, start, end) - struct region_cache *c; - int start, end; +delete_cache_boundaries (struct region_cache *c, int start, int end) { int len = end - start; @@ -391,10 +380,7 @@ delete_cache_boundaries (c, start, end) /* Set the value in cache C for the region START..END to VALUE. */ static void -set_cache_region (c, start, end, value) - struct region_cache *c; - int start, end; - int value; +set_cache_region (struct region_cache *c, int start, int end, int value) { if (start > end) abort (); @@ -495,10 +481,7 @@ set_cache_region (c, start, end, value) buffer positions in the presence of insertions and deletions; the args to pass are the same before and after such an operation.) */ void -invalidate_region_cache (buf, c, head, tail) - struct buffer *buf; - struct region_cache *c; - int head, tail; +invalidate_region_cache (struct buffer *buf, struct region_cache *c, int head, int tail) { /* Let chead = c->beg_unchanged, and ctail = c->end_unchanged. @@ -576,9 +559,7 @@ invalidate_region_cache (buf, c, head, tail) the cache, and causes cache gap motion. */ static void -revalidate_region_cache (buf, c) - struct buffer *buf; - struct region_cache *c; +revalidate_region_cache (struct buffer *buf, struct region_cache *c) { /* The boundaries now in the cache are expressed relative to the buffer_beg and buffer_end values stored in the cache. Now, @@ -706,10 +687,7 @@ revalidate_region_cache (buf, c) buffer positions) is "known," for the purposes of CACHE (e.g. "has no newlines", in the case of the line cache). */ void -know_region_cache (buf, c, start, end) - struct buffer *buf; - struct region_cache *c; - int start, end; +know_region_cache (struct buffer *buf, struct region_cache *c, int start, int end) { revalidate_region_cache (buf, c); @@ -723,11 +701,7 @@ know_region_cache (buf, c, start, end) the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest position after POS where the knownness changes. */ int -region_cache_forward (buf, c, pos, next) - struct buffer *buf; - struct region_cache *c; - int pos; - int *next; +region_cache_forward (struct buffer *buf, struct region_cache *c, int pos, int *next) { revalidate_region_cache (buf, c); @@ -762,11 +736,7 @@ region_cache_forward (buf, c, pos, next) /* Return true if the text immediately before POS in BUF is known, for the purposes of CACHE. If NEXT is non-zero, set *NEXT to the nearest position before POS where the knownness changes. */ -int region_cache_backward (buf, c, pos, next) - struct buffer *buf; - struct region_cache *c; - int pos; - int *next; +int region_cache_backward (struct buffer *buf, struct region_cache *c, int pos, int *next) { revalidate_region_cache (buf, c); @@ -804,8 +774,7 @@ int region_cache_backward (buf, c, pos, next) /* Debugging: pretty-print a cache to the standard error output. */ void -pp_cache (c) - struct region_cache *c; +pp_cache (struct region_cache *c) { int i; int beg_u = c->buffer_beg + c->beg_unchanged; |