Commit 058e5dad authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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.
parent 7ac80be9
2011-03-12 Eli Zaretskii <eliz@gnu.org> 2011-03-12 Eli Zaretskii <eliz@gnu.org>
   
* 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.
* deps.mk (termcap.o): Depend on tparam.h.
* msdos.c (XMenuAddPane): 3rd argument is `const char *' now. * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
Adapt all references accordingly. Adapt all references accordingly.
   
...@@ -191,7 +191,7 @@ term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \ ...@@ -191,7 +191,7 @@ term.o: term.c termchar.h termhooks.h termopts.h lisp.h globals.h $(config_h) \
cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \
xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \
systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h systty.h syssignal.h tparam.h $(INTERVALS_H) buffer.h ../lib/unistd.h
termcap.o: termcap.c lisp.h $(config_h) termcap.o: termcap.c lisp.h tparam.h msdos.h $(config_h)
terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \ terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \ keyboard.h lisp.h globals.h $(config_h) dispextern.h composite.h systime.h \
msdos.h msdos.h
......
...@@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */ ...@@ -25,6 +25,10 @@ Boston, MA 02110-1301, USA. */
#include <unistd.h> #include <unistd.h>
#include "lisp.h" #include "lisp.h"
#include "tparam.h"
#ifdef MSDOS
#include "msdos.h"
#endif
#ifndef NULL #ifndef NULL
#define NULL (char *) 0 #define NULL (char *) 0
...@@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area); ...@@ -65,7 +69,7 @@ static char *tgetst1 (char *ptr, char **area);
0 if not found. */ 0 if not found. */
static char * static char *
find_capability (register char *bp, register char *cap) find_capability (register char *bp, register const char *cap)
{ {
for (; *bp; bp++) for (; *bp; bp++)
if (bp[0] == ':' if (bp[0] == ':'
...@@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap) ...@@ -76,7 +80,7 @@ find_capability (register char *bp, register char *cap)
} }
int int
tgetnum (char *cap) tgetnum (const char *cap)
{ {
register char *ptr = find_capability (term_entry, cap); register char *ptr = find_capability (term_entry, cap);
if (!ptr || ptr[-1] != '#') if (!ptr || ptr[-1] != '#')
...@@ -85,7 +89,7 @@ tgetnum (char *cap) ...@@ -85,7 +89,7 @@ tgetnum (char *cap)
} }
int int
tgetflag (char *cap) tgetflag (const char *cap)
{ {
register char *ptr = find_capability (term_entry, cap); register char *ptr = find_capability (term_entry, cap);
return ptr && ptr[-1] == ':'; return ptr && ptr[-1] == ':';
...@@ -97,7 +101,7 @@ tgetflag (char *cap) ...@@ -97,7 +101,7 @@ tgetflag (char *cap)
If AREA is null, space is allocated with `malloc'. */ If AREA is null, space is allocated with `malloc'. */
char * char *
tgetstr (char *cap, char **area) tgetstr (const char *cap, char **area)
{ {
register char *ptr = find_capability (term_entry, cap); register char *ptr = find_capability (term_entry, cap);
if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~')) if (!ptr || (ptr[-1] != '=' && ptr[-1] != '~'))
...@@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area) ...@@ -263,7 +267,7 @@ tgetst1 (char *ptr, char **area)
char PC; char PC;
void void
tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) tputs (register const char *str, int nlines, int (*outfun) (int))
{ {
register int padcount = 0; register int padcount = 0;
register int speed; register int speed;
...@@ -355,7 +359,7 @@ valid_filename_p (fn) ...@@ -355,7 +359,7 @@ valid_filename_p (fn)
in it, and some other value otherwise. */ in it, and some other value otherwise. */
int int
tgetent (char *bp, char *name) tgetent (char *bp, const char *name)
{ {
register char *termcap_name; register char *termcap_name;
register int fd; register int fd;
...@@ -442,7 +446,7 @@ tgetent (char *bp, char *name) ...@@ -442,7 +446,7 @@ tgetent (char *bp, char *name)
buf.size = BUFSIZE; buf.size = BUFSIZE;
/* Add 1 to size to ensure room for terminating null. */ /* Add 1 to size to ensure room for terminating null. */
buf.beg = (char *) xmalloc (buf.size + 1); buf.beg = (char *) xmalloc (buf.size + 1);
term = indirect ? indirect : name; term = indirect ? indirect : (char *)name;
if (!bp) if (!bp)
{ {
......
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