diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-08 10:26:34 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-03-08 10:26:34 -0800 |
commit | 50938595880fd87c7dcd39a607cba1b0a7598baf (patch) | |
tree | e505cffa90ab1c25e1f15c931e6e47c7575b4e2d /src/tparam.c | |
parent | 75f8807fe6cc437f58845ec21621614d1dbb7f36 (diff) | |
download | emacs-50938595880fd87c7dcd39a607cba1b0a7598baf.tar.gz |
* 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.
Diffstat (limited to 'src/tparam.c')
-rw-r--r-- | src/tparam.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 <config.h> #include <setjmp.h> #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 */ - |