diff options
| author | Eli Zaretskii | 2011-03-12 14:03:24 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2011-03-12 14:03:24 +0200 |
| commit | 058e5dad0e18c6c67cf8ad7681f98f0768b60f31 (patch) | |
| tree | 74405be16e7109eff6f82029e93c537e58a100bc /src | |
| parent | 7ac80be95aaa92eacb454d4fa6aa3d2f56058978 (diff) | |
| download | emacs-058e5dad0e18c6c67cf8ad7681f98f0768b60f31.tar.gz emacs-058e5dad0e18c6c67cf8ad7681f98f0768b60f31.zip | |
Make termcap.c implementations consistent with tparam.h prototypes.
src/termcap.c [MSDOS]: Include "msdos.h.
(find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
Constify `char *' arguments and their references according to
prototypes in tparam.h.
src/deps.mk (termcap.o): Depend on tparam.h and msdos.h.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/deps.mk | 2 | ||||
| -rw-r--r-- | src/termcap.c | 18 |
3 files changed, 19 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8534c3b455f..9e4023e996a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2011-03-12 Eli Zaretskii <eliz@gnu.org> | 1 | 2011-03-12 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * termcap.c [MSDOS]: Include "msdos.h. | ||
| 4 | (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent): | ||
| 5 | Constify `char *' arguments and their references according to | ||
| 6 | prototypes in tparam.h. | ||
| 7 | |||
| 8 | * deps.mk (termcap.o): Depend on tparam.h. | ||
| 9 | |||
| 3 | * msdos.c (XMenuAddPane): 3rd argument is `const char *' now. | 10 | * msdos.c (XMenuAddPane): 3rd argument is `const char *' now. |
| 4 | Adapt all references accordingly. | 11 | Adapt all references accordingly. |
| 5 | 12 | ||
diff --git a/src/deps.mk b/src/deps.mk index 2b162b07bb8..d3a21cfe628 100644 --- a/src/deps.mk +++ b/src/deps.mk | |||
| @@ -191,7 +191,7 @@ term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \ | |||
| 191 | cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ | 191 | cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ |
| 192 | xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ | 192 | xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ |
| 193 | systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h | 193 | systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h |
| 194 | termcap.o: termcap.c lisp.h $(config_h) | 194 | termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h) |
| 195 | terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ | 195 | terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ |
| 196 | keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ | 196 | keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ |
| 197 | msdos.h | 197 | msdos.h |
diff --git a/src/termcap.c b/src/termcap.c index 69ce56d93b3..27a20a67ae1 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */ | |||
| 25 | #include <unistd.h> | 25 | #include <unistd.h> |
| 26 | 26 | ||
| 27 | #include "lisp.h" | 27 | #include "lisp.h" |
| 28 | #include "tparam.h" | ||
| 29 | #ifdef MSDOS | ||
| 30 | #include "msdos.h" | ||
| 31 | #endif | ||
| 28 | 32 | ||
| 29 | #ifndef NULL | 33 | #ifndef NULL |
| 30 | #define NULL (char *) 0 | 34 | #define NULL (char *) 0 |
| @@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area); | |||
| 65 | 0 if not found. */ | 69 | 0 if not found. */ |
| 66 | 70 | ||
| 67 | static char * | 71 | static char * |
| 68 | find_capability (register char *bp, register char *cap) | 72 | find_capability (register char *bp, register const char *cap) |
| 69 | { | 73 | { |
| 70 | for (; *bp; bp++) | 74 | for (; *bp; bp++) |
| 71 | if (bp[0] == ':' | 75 | if (bp[0] == ':' |
| @@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap) | |||
| 76 | } | 80 | } |
| 77 | 81 | ||
| 78 | int | 82 | int |
| 79 | tgetnum (char *cap) | 83 | tgetnum (const char *cap) |
| 80 | { | 84 | { |
| 81 | register char *ptr = find_capability (term_entry, cap); | 85 | register char *ptr = find_capability (term_entry, cap); |
| 82 | if (!ptr || ptr[-1] != '#') | 86 | if (!ptr || ptr[-1] != '#') |
| @@ -85,7 +89,7 @@ tgetnum (char *cap) | |||
| 85 | } | 89 | } |
| 86 | 90 | ||
| 87 | int | 91 | int |
| 88 | tgetflag (char *cap) | 92 | tgetflag (const char *cap) |
| 89 | { | 93 | { |
| 90 | register char *ptr = find_capability (term_entry, cap); | 94 | register char *ptr = find_capability (term_entry, cap); |
| 91 | return ptr && ptr[-1] == ':'; | 95 | return ptr && ptr[-1] == ':'; |
| @@ -97,7 +101,7 @@ tgetflag (char *cap) | |||
| 97 | If AREA is null, space is allocated with `malloc'. */ | 101 | If AREA is null, space is allocated with `malloc'. */ |
| 98 | 102 | ||
| 99 | char * | 103 | char * |
| 100 | tgetstr (char *cap, char **area) | 104 | tgetstr (const char *cap, char **area) |
| 101 | { | 105 | { |
| 102 | register char *ptr = find_capability (term_entry, cap); | 106 | register char *ptr = find_capability (term_entry, cap); |
| 103 | if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) | 107 | if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) |
| @@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area) | |||
| 263 | char PC; | 267 | char PC; |
| 264 | 268 | ||
| 265 | void | 269 | void |
| 266 | tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) | 270 | tputs (register const char *str, int nlines, int (*outfun) (int)) |
| 267 | { | 271 | { |
| 268 | register int padcount = 0; | 272 | register int padcount = 0; |
| 269 | register int speed; | 273 | register int speed; |
| @@ -355,7 +359,7 @@ valid_filename_p (fn) | |||
| 355 | in it, and some other value otherwise. */ | 359 | in it, and some other value otherwise. */ |
| 356 | 360 | ||
| 357 | int | 361 | int |
| 358 | tgetent (char *bp, char *name) | 362 | tgetent (char *bp, const char *name) |
| 359 | { | 363 | { |
| 360 | register char *termcap_name; | 364 | register char *termcap_name; |
| 361 | register int fd; | 365 | register int fd; |
| @@ -442,7 +446,7 @@ tgetent (char *bp, char *name) | |||
| 442 | buf.size = BUFSIZE; | 446 | buf.size = BUFSIZE; |
| 443 | /* Add 1 to size to ensure room for terminating null. */ | 447 | /* Add 1 to size to ensure room for terminating null. */ |
| 444 | buf.beg = (char *) xmalloc (buf.size + 1); | 448 | buf.beg = (char *) xmalloc (buf.size + 1); |
| 445 | term = indirect ? indirect : name; | 449 | term = indirect ? indirect : (char *)name; |
| 446 | 450 | ||
| 447 | if (!bp) | 451 | if (!bp) |
| 448 | { | 452 | { |