From 50938595880fd87c7dcd39a607cba1b0a7598baf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 8 Mar 2011 10:26:34 -0800 Subject: * tparam.h: New file. * term.c, tparam.h: Include it. * deps.mk (term.o, tparam.o): Depend on tparam.h. * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr): Move these decls to tparam.h, and make them agree with what is actually in tparam.c. The previous trick of using incompatible decls in different modules does not conform to the C standard. All callers of tparam changed to use tparam's actual API. * tparam.c (tparam1, tparam, tgoto): Use const pointers where appropriate. --- src/tparam.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/tparam.c') diff --git a/src/tparam.c b/src/tparam.c index fcbb63881e6..6aae0b97db9 100644 --- a/src/tparam.c +++ b/src/tparam.c @@ -21,6 +21,7 @@ Boston, MA 02110-1301, USA. */ #include #include #include "lisp.h" /* for xmalloc */ +#include "tparam.h" #ifndef NULL #define NULL (char *) 0 @@ -38,11 +39,12 @@ Boston, MA 02110-1301, USA. */ The fourth and following args to tparam serve as the parameter values. */ -static char *tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp); +static char *tparam1 (char const *string, char *outstring, int len, + char *up, char *left, int *argp); -/* VARARGS 2 */ char * -tparam (char *string, char *outstring, int len, int arg0, int arg1, int arg2, int arg3) +tparam (const char *string, char *outstring, int len, + int arg0, int arg1, int arg2, int arg3) { int arg[4]; @@ -59,7 +61,7 @@ char *UP; static char tgoto_buf[50]; char * -tgoto (char *cm, int hpos, int vpos) +tgoto (const char *cm, int hpos, int vpos) { int args[2]; if (!cm) @@ -70,10 +72,11 @@ tgoto (char *cm, int hpos, int vpos) } static char * -tparam1 (char *string, char *outstring, int len, char *up, char *left, register int *argp) +tparam1 (const char *string, char *outstring, int len, + char *up, char *left, register int *argp) { register int c; - register char *p = string; + register const char *p = string; register char *op = outstring; char *outend; int outlen = 0; @@ -277,4 +280,3 @@ main (argc, argv) } #endif /* DEBUG */ - -- cgit v1.2.1