Hi Sadrul, thanks for your comments. I have used include's in the configure.in tests instead of using external declarations.
I have also fixed compiler warning in the screen code (errors when -Werror is used), tested with gcc 4.4.3. I didn't have time yet to look at the patch on savannah, I'll try to take a look at it. Cheers, Giuseppe PS Please keep me CC'ed as I am not subscribed to this mailing list. Sadrul Habib Chowdhury <ima...@gmail.com> writes: > * Giuseppe Scrivano had this to say on [13 Feb 2010, 22:44:04 +0100]: >> Hello, >> >> this trivial patch fixes ./configure CFLAGS="-Wall -Werror". > > Hi. Thanks for the patch! > > It looks like when we configure with -Wall -Werror, even with your patch, > the configure gets some incorrect results, e.g. in my system, it fails to > find _exit, strftime, vsnprintf etc. It'd be good to catch those cases > too. > > Also, I think it makes more sense to include the appropriate headers, > rather than declaring externs, e.g.: > > @@ -47,7 +47,15 @@ AC_PROG_GCC_TRADITIONAL > AC_ISC_POSIX > AC_USE_SYSTEM_EXTENSIONS > > -AC_TRY_RUN(main(){exit(0);},,[ > +AC_TRY_RUN([ > +#include <stdlib.h> > + > +int main() > +{ > + exit(0); > + return 0; > +} > +],,[ > if test $CC != cc ; then > AC_NOTE(Your $CC failed - restarting with CC=cc) > AC_NOTE() > > instead of: > > @@ -47,7 +47,7 @@ AC_PROG_GCC_TRADITIONAL > AC_ISC_POSIX > AC_USE_SYSTEM_EXTENSIONS > > -AC_TRY_RUN(main(){exit(0);},,[ > +AC_TRY_RUN(extern void exit (int);int main(){exit(0);return 0;},,[ > if test $CC != cc ; then > AC_NOTE(Your $CC failed - restarting with CC=cc) > AC_NOTE() > > Or, perhaps we should just make sure that we remove -Wall -Werror from > CFLAGS when running ./configure, to keep things simple? > > Also, I am very interested in the patch attached at > https://savannah.gnu.org/bugs/?27318. However, I haven't had the time to > test it out. Some help on that would be really appreciated! > > Cheers, > Sadrul
>From fc3f88c947242fc5cb9679b6629398b0c3096961 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano <gscriv...@gnu.org> Date: Sat, 13 Feb 2010 22:38:59 +0100 Subject: [PATCH] Fix build when CFLAGS="-Wall -Werror" is used. --- src/attacher.c | 2 + src/configure.in | 89 +++++++++++-- src/display.c | 7 +- src/extern.h | 12 ++- src/layer.c | 3 +- src/list_display.c | 1 - src/os.h | 4 +- src/process.c | 346 ++++++++++++++++++++++++++-------------------------- src/pty.c | 24 +++-- src/putenv.c | 9 +- src/screen.c | 6 +- src/utmp.c | 14 +- 12 files changed, 296 insertions(+), 221 deletions(-) diff --git a/src/attacher.c b/src/attacher.c index ef3ce8b..a03efb4 100644 --- a/src/attacher.c +++ b/src/attacher.c @@ -535,6 +535,7 @@ AttacherNoDebug SIGDEFARG } #endif /* SIG_NODEBUG */ +#ifdef BSDJOBS static int SuspendPlease; static sigret_t @@ -544,6 +545,7 @@ SigStop SIGDEFARG SuspendPlease = 1; SIGRETURN; } +#endif #ifdef LOCK static int LockPlease; diff --git a/src/configure.in b/src/configure.in index bd29de2..d8ff271 100644 --- a/src/configure.in +++ b/src/configure.in @@ -47,7 +47,13 @@ AC_PROG_GCC_TRADITIONAL AC_ISC_POSIX AC_USE_SYSTEM_EXTENSIONS -AC_TRY_RUN(main(){exit(0);},,[ +AC_TRY_RUN([ +#include <stdlib.h> +int main() +{ +exit(0); +return 0;} +],,[ if test $CC != cc ; then AC_NOTE(Your $CC failed - restarting with CC=cc) AC_NOTE() @@ -57,7 +63,12 @@ exec $0 $configure_args fi ]) -AC_TRY_RUN(main(){exit(0);},, +AC_TRY_RUN( +[#include <stdlib.h> +int main() +{ +exit(0);return 0; +}],, exec 5>&2 eval $ac_link AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;) @@ -295,11 +306,11 @@ dnl **** select() **** dnl AC_CHECKING(select) -AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, -LIBS="$LIBS -lnet -lnsl" +AC_CHECK_FUNCS([select],, +[LIBS="$LIBS -lnet -lnsl" AC_CHECKING(select with $LIBS) -AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, -AC_MSG_ERROR(!!! no select - no screen)) +AC_CHECK_FUNCS([select],, +AC_MSG_ERROR(!!! no select - no screen))] ) dnl dnl **** FIFO tests **** @@ -326,7 +337,8 @@ AC_TRY_RUN([ #endif char *fin = "/tmp/conftest$$"; - +#include <stdlib.h> +int main() { struct stat stb; @@ -369,6 +381,7 @@ main() if (select(1, &f, 0, 0, 0) == -1) exit(1); exit(0); + return 0; } ], AC_NOTE(- your fifos are usable) fifo=1, AC_NOTE(- your fifos are not usable)) @@ -394,9 +407,10 @@ AC_TRY_RUN([ #ifndef S_IFIFO #define S_IFIFO 0010000 #endif - +#include <stdlib.h> char *fin = "/tmp/conftest$$"; +int main() { struct timeval tv; @@ -417,6 +431,7 @@ main() if (select(1, &f, 0, 0, &tv)) exit(1); exit(0); + return 0; } ], AC_NOTE(- your implementation is ok), AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1) @@ -444,8 +459,12 @@ AC_TRY_RUN([ #include <sys/socket.h> #include <sys/un.h> +#include <stdlib.h> + + char *son = "/tmp/conftest$$"; +int main() { int s1, s2, l; @@ -479,6 +498,7 @@ main() if (select(1, &f, 0, 0, 0) == -1) exit(1); exit(0); + return 0; } ], AC_NOTE(- your sockets are usable) sock=1, AC_NOTE(- your sockets are not usable)) @@ -499,8 +519,11 @@ AC_TRY_RUN([ #include <sys/socket.h> #include <sys/un.h> +#include <stdlib.h> + char *son = "/tmp/conftest$$"; +int main() { int s; @@ -517,6 +540,7 @@ main() exit(1); close(s); exit(0); + return 0; } ],AC_NOTE(- you are normal), AC_NOTE(- unix domain sockets are not kept in the filesystem) @@ -567,6 +591,8 @@ AC_TRY_RUN([ char *nam = "/tmp/conftest$$"; +#include <stdlib.h> + #ifdef NAMEDPIPE #ifndef O_NONBLOCK @@ -576,7 +602,10 @@ char *nam = "/tmp/conftest$$"; #define S_IFIFO 0010000 #endif +#include <stdlib.h> + +int main() { fd_set f; @@ -645,6 +674,7 @@ main() if (select(1, &f, &f, 0, 0) != 2) exit(1); exit(0); + return 0; } ],AC_NOTE(- select is ok), AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN)) @@ -661,27 +691,33 @@ AC_TRY_LINK(,[ #ifdef __hpux __sorry_hpux_libcurses_is_totally_broken_in_10_10(); #else +extern void tgetent (char*, char*); tgetent((char *)0, (char *)0); #endif ],, LIBS="-ltermcap $olibs" AC_CHECKING(libtermcap) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +AC_TRY_LINK(,extern void tgetent (char*, char*); tgetent((char *)0, (char *)0);,, LIBS="-ltermlib $olibs" AC_CHECKING(libtermlib) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +AC_TRY_LINK(,extern void tgetent (char*, char*); tgetent((char *)0, (char *)0);,, LIBS="-lncursesw $olibs" AC_CHECKING(libncursesw) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +AC_TRY_LINK(,extern void tgetent (char*, char*); tgetent((char *)0, (char *)0);,, LIBS="-lncurses $olibs" AC_CHECKING(libncurses) -AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, +AC_TRY_LINK(,extern void tgetent (char*, char*); tgetent((char *)0, (char *)0);,, AC_MSG_ERROR(!!! no tgetent - no screen))))))) AC_TRY_RUN([ +( +#include <stdlib.h> + +int main() { - exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); + exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); + return 0; }], AC_NOTE(- you use the termcap database), AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO)) AC_CHECKING(ospeed) @@ -751,6 +787,9 @@ AC_TRY_RUN([ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> +#include <stdlib.h> + +int main() { struct stat sb; @@ -774,6 +813,7 @@ main() fprintf(fp, "%d\n", sb.st_gid); fclose(fp); exit(0); + return 0; } ],[ if test -f conftest_grp; then @@ -946,6 +986,9 @@ $nlist64 struct nlist nl[2]; +#include <stdlib.h> + +int main() { #if !defined(_AUX_SOURCE) && !defined(AUX) @@ -961,6 +1004,7 @@ main() if (nl[0].n_value == 0) exit(1); exit(0); + return 0; } ],avensym=$av;break) if test "$av" = _Loadavg; then @@ -1083,6 +1127,7 @@ hand() got++; } +int main() { /* on hpux we use sigvec to get bsd signals */ @@ -1094,6 +1139,7 @@ main() exit(1); #endif exit(0); + return 0; } ],,AC_DEFINE(SYSVSIGS)) @@ -1164,6 +1210,9 @@ AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK)) AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments) AC_TRY_RUN([ +#include <stdlib.h> + +int main() { char buf[10]; strcpy(buf, "abcdefghi"); @@ -1175,10 +1224,12 @@ main() { if (strncmp(buf, "cdedef", 6)) exit(1); exit(0); /* libc version works properly. */ + return 0; }], AC_DEFINE(USEBCOPY)) AC_TRY_RUN([ #define bcopy(s,d,l) memmove(d,s,l) +int main() { char buf[10]; strcpy(buf, "abcdefghi"); @@ -1190,11 +1241,13 @@ main() { if (strncmp(buf, "cdedef", 6)) exit(1); exit(0); /* libc version works properly. */ + return 0; }], AC_DEFINE(USEMEMMOVE)) AC_TRY_RUN([ #define bcopy(s,d,l) memcpy(d,s,l) +int main() { char buf[10]; strcpy(buf, "abcdefghi"); @@ -1206,6 +1259,7 @@ main() { if (strncmp(buf, "cdedef", 6)) exit(1); exit(0); /* libc version works properly. */ + return 0; }], AC_DEFINE(USEMEMCPY)) AC_SYS_LONG_FILE_NAMES @@ -1292,7 +1346,14 @@ fi dnl Ptx bug workaround -- insert -lc after -ltermcap test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq" -AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.)) +AC_TRY_RUN([ +#include <stdlib.h> + +int main() +{ +exit(0); +return 0; +}],,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.)) AC_OUTPUT(Makefile doc/Makefile, [[ # a hook for preserving undef directive in config.h diff --git a/src/display.c b/src/display.c index 0707805..a0f9dd9 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -51,7 +51,6 @@ static void disp_writeev_eagain __P((struct event *, char *)); static void disp_status_fn __P((struct event *, char *)); static void disp_hstatus_fn __P((struct event *, char *)); static void disp_blocked_fn __P((struct event *, char *)); -static void cv_winid_fn __P((struct event *, char *)); #ifdef MAPKEYS static void disp_map_fn __P((struct event *, char *)); #endif @@ -2122,7 +2121,6 @@ static int strlen_onscreen(unsigned char *c, unsigned char *end) { int len = 0; - char *s = c; while (*c && (!end || c < end)) { int v, dec = 0; @@ -2154,7 +2152,8 @@ int start, max; probably take way more time. So this will have to do for now. */ if (D_encoding == UTF8) { - int chars = strlen_onscreen(s + start, s + max); + int chars = strlen_onscreen((unsigned char *) (s + start), + (unsigned char *) (s + max)); D_encoding = 0; PutWinMsg(s, start, max); D_encoding = UTF8; diff --git a/src/extern.h b/src/extern.h index dc5857e..7c9d9d6 100644 --- a/src/extern.h +++ b/src/extern.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -496,3 +496,13 @@ extern int PrepareEncodedChar __P((int)); # endif #endif extern int EncodeChar __P((char *, int, int, int *)); + +extern int LayProcessMouse __P((struct layer *, unsigned char)); +extern int LayProcessMouseSwitch __P((struct layer *, int)); + +extern void ReceiveRaw __P((int)); + +/* layout.c */ +extern int LayoutDumpCanvas __P((struct canvas *, char *)); +extern void RemoveLayout __P((struct layout *)); + diff --git a/src/layer.c b/src/layer.c index c71c731..588f201 100644 --- a/src/layer.c +++ b/src/layer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -1199,6 +1199,7 @@ LayProcessMouseSwitch(struct layer *l, int s) { l->l_mouseevent.len = 0; } + return 0; } void LayPause(layer, pause) diff --git a/src/list_display.c b/src/list_display.c index 3693f01..5f7354f 100644 --- a/src/list_display.c +++ b/src/list_display.c @@ -217,7 +217,6 @@ struct displaysdata *ddata; for (d = displays; d; d = d->d_next) { - struct mchar *mc; w = d->d_fore; if (y >= flayer->l_height - 3) diff --git a/src/os.h b/src/os.h index 5c17c83..becaead 100644 --- a/src/os.h +++ b/src/os.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -167,7 +167,7 @@ extern int errno; #ifndef HAVE_UTIMES # define utimes utime #endif -#ifndef HAVE_VSNPRINTF +#if defined(HAVE_VSNPRINTF) && !defined(vsnprintf) # define vsnprintf xvsnprintf #endif diff --git a/src/process.c b/src/process.c index c1d2da1..a4247d2 100644 --- a/src/process.c +++ b/src/process.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -246,177 +246,177 @@ struct digraph /* digraph table taken from old vim and rfc1345 */ static struct digraph digraphs[MAX_DIGRAPH + 1] = { - {' ', ' ', 160}, /* */ - {'N', 'S', 160}, /* */ - {'~', '!', 161}, /* ¡ */ - {'!', '!', 161}, /* ¡ */ - {'!', 'I', 161}, /* ¡ */ - {'c', '|', 162}, /* ¢ */ - {'c', 't', 162}, /* ¢ */ - {'$', '$', 163}, /* £ */ - {'P', 'd', 163}, /* £ */ - {'o', 'x', 164}, /* ¤ */ - {'C', 'u', 164}, /* ¤ */ - {'C', 'u', 164}, /* ¤ */ - {'E', 'u', 164}, /* ¤ */ - {'Y', '-', 165}, /* ¥ */ - {'Y', 'e', 165}, /* ¥ */ - {'|', '|', 166}, /* ¦ */ - {'B', 'B', 166}, /* ¦ */ - {'p', 'a', 167}, /* § */ - {'S', 'E', 167}, /* § */ - {'"', '"', 168}, /* ¨ */ - {'\'', ':', 168}, /* ¨ */ - {'c', 'O', 169}, /* © */ - {'C', 'o', 169}, /* © */ - {'a', '-', 170}, /* ª */ - {'<', '<', 171}, /* « */ - {'-', ',', 172}, /* ¬ */ - {'N', 'O', 172}, /* ¬ */ - {'-', '-', 173}, /* */ - {'r', 'O', 174}, /* ® */ - {'R', 'g', 174}, /* ® */ - {'-', '=', 175}, /* ¯ */ - {'\'', 'm', 175}, /* ¯ */ - {'~', 'o', 176}, /* ° */ - {'D', 'G', 176}, /* ° */ - {'+', '-', 177}, /* ± */ - {'2', '2', 178}, /* ² */ - {'2', 'S', 178}, /* ² */ - {'3', '3', 179}, /* ³ */ - {'3', 'S', 179}, /* ³ */ - {'\'', '\'', 180}, /* ´ */ - {'j', 'u', 181}, /* µ */ - {'M', 'y', 181}, /* µ */ - {'p', 'p', 182}, /* ¶ */ - {'P', 'I', 182}, /* ¶ */ - {'~', '.', 183}, /* · */ - {'.', 'M', 183}, /* · */ - {',', ',', 184}, /* ¸ */ - {'\'', ',', 184}, /* ¸ */ - {'1', '1', 185}, /* ¹ */ - {'1', 'S', 185}, /* ¹ */ - {'o', '-', 186}, /* º */ - {'>', '>', 187}, /* » */ - {'1', '4', 188}, /* ¼ */ - {'1', '2', 189}, /* ½ */ - {'3', '4', 190}, /* ¾ */ - {'~', '?', 191}, /* ¿ */ - {'?', '?', 191}, /* ¿ */ - {'?', 'I', 191}, /* ¿ */ - {'A', '`', 192}, /* À */ - {'A', '!', 192}, /* À */ - {'A', '\'', 193}, /* Á */ - {'A', '^', 194}, /* Â */ - {'A', '>', 194}, /* Â */ - {'A', '~', 195}, /* Ã */ - {'A', '?', 195}, /* Ã */ - {'A', '"', 196}, /* Ä */ - {'A', ':', 196}, /* Ä */ - {'A', '@', 197}, /* Å */ - {'A', 'A', 197}, /* Å */ - {'A', 'E', 198}, /* Æ */ - {'C', ',', 199}, /* Ç */ - {'E', '`', 200}, /* È */ - {'E', '!', 200}, /* È */ - {'E', '\'', 201}, /* É */ - {'E', '^', 202}, /* Ê */ - {'E', '>', 202}, /* Ê */ - {'E', '"', 203}, /* Ë */ - {'E', ':', 203}, /* Ë */ - {'I', '`', 204}, /* Ì */ - {'I', '!', 204}, /* Ì */ - {'I', '\'', 205}, /* Í */ - {'I', '^', 206}, /* Î */ - {'I', '>', 206}, /* Î */ - {'I', '"', 207}, /* Ï */ - {'I', ':', 207}, /* Ï */ - {'D', '-', 208}, /* Ð */ - {'N', '~', 209}, /* Ñ */ - {'N', '?', 209}, /* Ñ */ - {'O', '`', 210}, /* Ò */ - {'O', '!', 210}, /* Ò */ - {'O', '\'', 211}, /* Ó */ - {'O', '^', 212}, /* Ô */ - {'O', '>', 212}, /* Ô */ - {'O', '~', 213}, /* Õ */ - {'O', '?', 213}, /* Õ */ - {'O', '"', 214}, /* Ö */ - {'O', ':', 214}, /* Ö */ - {'/', '\\', 215}, /* × */ - {'*', 'x', 215}, /* × */ - {'O', '/', 216}, /* Ø */ - {'U', '`', 217}, /* Ù */ - {'U', '!', 217}, /* Ù */ - {'U', '\'', 218}, /* Ú */ - {'U', '^', 219}, /* Û */ - {'U', '>', 219}, /* Û */ - {'U', '"', 220}, /* Ü */ - {'U', ':', 220}, /* Ü */ - {'Y', '\'', 221}, /* Ý */ - {'I', 'p', 222}, /* Þ */ - {'T', 'H', 222}, /* Þ */ - {'s', 's', 223}, /* ß */ - {'s', '"', 223}, /* ß */ - {'a', '`', 224}, /* à */ - {'a', '!', 224}, /* à */ - {'a', '\'', 225}, /* á */ - {'a', '^', 226}, /* â */ - {'a', '>', 226}, /* â */ - {'a', '~', 227}, /* ã */ - {'a', '?', 227}, /* ã */ - {'a', '"', 228}, /* ä */ - {'a', ':', 228}, /* ä */ - {'a', 'a', 229}, /* å */ - {'a', 'e', 230}, /* æ */ - {'c', ',', 231}, /* ç */ - {'e', '`', 232}, /* è */ - {'e', '!', 232}, /* è */ - {'e', '\'', 233}, /* é */ - {'e', '^', 234}, /* ê */ - {'e', '>', 234}, /* ê */ - {'e', '"', 235}, /* ë */ - {'e', ':', 235}, /* ë */ - {'i', '`', 236}, /* ì */ - {'i', '!', 236}, /* ì */ - {'i', '\'', 237}, /* í */ - {'i', '^', 238}, /* î */ - {'i', '>', 238}, /* î */ - {'i', '"', 239}, /* ï */ - {'i', ':', 239}, /* ï */ - {'d', '-', 240}, /* ð */ - {'n', '~', 241}, /* ñ */ - {'n', '?', 241}, /* ñ */ - {'o', '`', 242}, /* ò */ - {'o', '!', 242}, /* ò */ - {'o', '\'', 243}, /* ó */ - {'o', '^', 244}, /* ô */ - {'o', '>', 244}, /* ô */ - {'o', '~', 245}, /* õ */ - {'o', '?', 245}, /* õ */ - {'o', '"', 246}, /* ö */ - {'o', ':', 246}, /* ö */ - {':', '-', 247}, /* ÷ */ - {'o', '/', 248}, /* ø */ - {'u', '`', 249}, /* ù */ - {'u', '!', 249}, /* ù */ - {'u', '\'', 250}, /* ú */ - {'u', '^', 251}, /* û */ - {'u', '>', 251}, /* û */ - {'u', '"', 252}, /* ü */ - {'u', ':', 252}, /* ü */ - {'y', '\'', 253}, /* ý */ - {'i', 'p', 254}, /* þ */ - {'t', 'h', 254}, /* þ */ - {'y', '"', 255}, /* ÿ */ - {'y', ':', 255}, /* ÿ */ - {'"', '[', 196}, /* Ä */ - {'"', '\\', 214}, /* Ö */ - {'"', ']', 220}, /* Ü */ - {'"', '{', 228}, /* ä */ - {'"', '|', 246}, /* ö */ - {'"', '}', 252}, /* ü */ - {'"', '~', 223} /* ß */ + {{' ', ' '}, 160}, /* */ + {{'N', 'S'}, 160}, /* */ + {{'~', '!'}, 161}, /* ¡ */ + {{'!', '!'}, 161}, /* ¡ */ + {{'!', 'I'}, 161}, /* ¡ */ + {{'c', '|'}, 162}, /* ¢ */ + {{'c', 't'}, 162}, /* ¢ */ + {{'$', '$'}, 163}, /* £ */ + {{'P', 'd'}, 163}, /* £ */ + {{'o', 'x'}, 164}, /* ¤ */ + {{'C', 'u'}, 164}, /* ¤ */ + {{'C', 'u'}, 164}, /* ¤ */ + {{'E', 'u'}, 164}, /* ¤ */ + {{'Y', '-'}, 165}, /* ¥ */ + {{'Y', 'e'}, 165}, /* ¥ */ + {{'|', '|'}, 166}, /* ¦ */ + {{'B', 'B'}, 166}, /* ¦ */ + {{'p', 'a'}, 167}, /* § */ + {{'S', 'E'}, 167}, /* § */ + {{'"', '"'}, 168}, /* ¨ */ + {{'\'', ':'}, 168}, /* ¨ */ + {{'c', 'O'}, 169}, /* © */ + {{'C', 'o'}, 169}, /* © */ + {{'a', '-'}, 170}, /* ª */ + {{'<', '<'}, 171}, /* « */ + {{'-', ','}, 172}, /* ¬ */ + {{'N', 'O'}, 172}, /* ¬ */ + {{'-', '-'}, 173}, /* */ + {{'r', 'O'}, 174}, /* ® */ + {{'R', 'g'}, 174}, /* ® */ + {{'-', '='}, 175}, /* ¯ */ + {{'\'', 'm'}, 175}, /* ¯ */ + {{'~', 'o'}, 176}, /* ° */ + {{'D', 'G'}, 176}, /* ° */ + {{'+', '-'}, 177}, /* ± */ + {{'2', '2'}, 178}, /* ² */ + {{'2', 'S'}, 178}, /* ² */ + {{'3', '3'}, 179}, /* ³ */ + {{'3', 'S'}, 179}, /* ³ */ + {{'\'', '\''}, 180}, /* ´ */ + {{'j', 'u'}, 181}, /* µ */ + {{'M', 'y'}, 181}, /* µ */ + {{'p', 'p'}, 182}, /* ¶ */ + {{'P', 'I'}, 182}, /* ¶ */ + {{'~', '.'}, 183}, /* · */ + {{'.', 'M'}, 183}, /* · */ + {{',', ','}, 184}, /* ¸ */ + {{'\'', ','}, 184}, /* ¸ */ + {{'1', '1'}, 185}, /* ¹ */ + {{'1', 'S'}, 185}, /* ¹ */ + {{'o', '-'}, 186}, /* º */ + {{'>', '>'}, 187}, /* » */ + {{'1', '4'}, 188}, /* ¼ */ + {{'1', '2'}, 189}, /* ½ */ + {{'3', '4'}, 190}, /* ¾ */ + {{'~', '?'}, 191}, /* ¿ */ + {{'?', '?'}, 191}, /* ¿ */ + {{'?', 'I'}, 191}, /* ¿ */ + {{'A', '`'}, 192}, /* À */ + {{'A', '!'}, 192}, /* À */ + {{'A', '\''}, 193}, /* Á */ + {{'A', '^'}, 194}, /* Â */ + {{'A', '>'}, 194}, /* Â */ + {{'A', '~'}, 195}, /* Ã */ + {{'A', '?'}, 195}, /* Ã */ + {{'A', '"'}, 196}, /* Ä */ + {{'A', ':'}, 196}, /* Ä */ + {{'A', '@'}, 197}, /* Å */ + {{'A', 'A'}, 197}, /* Å */ + {{'A', 'E'}, 198}, /* Æ */ + {{'C', ','}, 199}, /* Ç */ + {{'E', '`'}, 200}, /* È */ + {{'E', '!'}, 200}, /* È */ + {{'E', '\''}, 201}, /* É */ + {{'E', '^'}, 202}, /* Ê */ + {{'E', '>'}, 202}, /* Ê */ + {{'E', '"'}, 203}, /* Ë */ + {{'E', ':'}, 203}, /* Ë */ + {{'I', '`'}, 204}, /* Ì */ + {{'I', '!'}, 204}, /* Ì */ + {{'I', '\''}, 205}, /* Í */ + {{'I', '^'}, 206}, /* Î */ + {{'I', '>'}, 206}, /* Î */ + {{'I', '"'}, 207}, /* Ï */ + {{'I', ':'}, 207}, /* Ï */ + {{'D', '-'}, 208}, /* Ð */ + {{'N', '~'}, 209}, /* Ñ */ + {{'N', '?'}, 209}, /* Ñ */ + {{'O', '`'}, 210}, /* Ò */ + {{'O', '!'}, 210}, /* Ò */ + {{'O', '\''}, 211}, /* Ó */ + {{'O', '^'}, 212}, /* Ô */ + {{'O', '>'}, 212}, /* Ô */ + {{'O', '~'}, 213}, /* Õ */ + {{'O', '?'}, 213}, /* Õ */ + {{'O', '"'}, 214}, /* Ö */ + {{'O', ':'}, 214}, /* Ö */ + {{'/', '\\'}, 215}, /* × */ + {{'*', 'x'}, 215}, /* × */ + {{'O', '/'}, 216}, /* Ø */ + {{'U', '`'}, 217}, /* Ù */ + {{'U', '!'}, 217}, /* Ù */ + {{'U', '\''}, 218}, /* Ú */ + {{'U', '^'}, 219}, /* Û */ + {{'U', '>'}, 219}, /* Û */ + {{'U', '"'}, 220}, /* Ü */ + {{'U', ':'}, 220}, /* Ü */ + {{'Y', '\''}, 221}, /* Ý */ + {{'I', 'p'}, 222}, /* Þ */ + {{'T', 'H'}, 222}, /* Þ */ + {{'s', 's'}, 223}, /* ß */ + {{'s', '"'}, 223}, /* ß */ + {{'a', '`'}, 224}, /* à */ + {{'a', '!'}, 224}, /* à */ + {{'a', '\''}, 225}, /* á */ + {{'a', '^'}, 226}, /* â */ + {{'a', '>'}, 226}, /* â */ + {{'a', '~'}, 227}, /* ã */ + {{'a', '?'}, 227}, /* ã */ + {{'a', '"'}, 228}, /* ä */ + {{'a', ':'}, 228}, /* ä */ + {{'a', 'a'}, 229}, /* å */ + {{'a', 'e'}, 230}, /* æ */ + {{'c', ','}, 231}, /* ç */ + {{'e', '`'}, 232}, /* è */ + {{'e', '!'}, 232}, /* è */ + {{'e', '\''}, 233}, /* é */ + {{'e', '^'}, 234}, /* ê */ + {{'e', '>'}, 234}, /* ê */ + {{'e', '"'}, 235}, /* ë */ + {{'e', ':'}, 235}, /* ë */ + {{'i', '`'}, 236}, /* ì */ + {{'i', '!'}, 236}, /* ì */ + {{'i', '\''}, 237}, /* í */ + {{'i', '^'}, 238}, /* î */ + {{'i', '>'}, 238}, /* î */ + {{'i', '"'}, 239}, /* ï */ + {{'i', ':'}, 239}, /* ï */ + {{'d', '-'}, 240}, /* ð */ + {{'n', '~'}, 241}, /* ñ */ + {{'n', '?'}, 241}, /* ñ */ + {{'o', '`'}, 242}, /* ò */ + {{'o', '!'}, 242}, /* ò */ + {{'o', '\''}, 243}, /* ó */ + {{'o', '^'}, 244}, /* ô */ + {{'o', '>'}, 244}, /* ô */ + {{'o', '~'}, 245}, /* õ */ + {{'o', '?'}, 245}, /* õ */ + {{'o', '"'}, 246}, /* ö */ + {{'o', ':'}, 246}, /* ö */ + {{':', '-'}, 247}, /* ÷ */ + {{'o', '/'}, 248}, /* ø */ + {{'u', '`'}, 249}, /* ù */ + {{'u', '!'}, 249}, /* ù */ + {{'u', '\''}, 250}, /* ú */ + {{'u', '^'}, 251}, /* û */ + {{'u', '>'}, 251}, /* û */ + {{'u', '"'}, 252}, /* ü */ + {{'u', ':'}, 252}, /* ü */ + {{'y', '\''}, 253}, /* ý */ + {{'i', 'p'}, 254}, /* þ */ + {{'t', 'h'}, 254}, /* þ */ + {{'y', '"'}, 255}, /* ÿ */ + {{'y', ':'}, 255}, /* ÿ */ + {{'"', '['}, 196}, /* Ä */ + {{'"', '\\'}, 214}, /* Ö */ + {{'"', ']'}, 220}, /* Ü */ + {{'"', '{'}, 228}, /* ä */ + {{'"', '|'}, 246}, /* ö */ + {{'"', '}'}, 252}, /* ü */ + {{'"', '~'}, 223} /* ß */ }; #define RESIZE_FLAG_H 1 @@ -3779,7 +3779,7 @@ int key; else { int t; - unsigned char *s = args[1]; + char *s = args[1]; digraphs[i].value = 0; while (*s) { diff --git a/src/pty.c b/src/pty.c index def7f93..691481b 100644 --- a/src/pty.c +++ b/src/pty.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -51,6 +51,8 @@ # include <sys/tty.h> # include <sys/sioctl.h> # include <sys/pty.h> +#else +# include <pty.h> #endif #ifdef sgi @@ -76,20 +78,26 @@ extern int eff_uid; +#ifdef __GNUC__ +#define UNUSED __attribute__ ((unused)) +#else +#define UNUSED +#endif + /* used for opening a new pty-pair: */ -static char PtyName[32], TtyName[32]; +static char UNUSED PtyName[32] = "", UNUSED TtyName[32] = ""; #if !(defined(sequent) || defined(_SEQUENT_) || defined(HAVE_SVR4_PTYS)) # ifdef hpux -static char PtyProto[] = "/dev/ptym/ptyXY"; -static char TtyProto[] = "/dev/pty/ttyXY"; +static char UNUSED PtyProto[] = "/dev/ptym/ptyXY"; +static char UNUSEDTtyProto[] = "/dev/pty/ttyXY"; # else # ifdef M_UNIX -static char PtyProto[] = "/dev/ptypXY"; -static char TtyProto[] = "/dev/ttypXY"; +static char UNUSED PtyProto[] = "/dev/ptypXY"; +static char UNUSED TtyProto[] = "/dev/ttypXY"; # else -static char PtyProto[] = "/dev/ptyXY"; -static char TtyProto[] = "/dev/ttyXY"; +static char UNUSED PtyProto[] = "/dev/ptyXY"; +static char UNUSED TtyProto[] = "/dev/ttyXY"; # endif # endif /* hpux */ #endif diff --git a/src/putenv.c b/src/putenv.c index 2a907f9..69c6399 100644 --- a/src/putenv.c +++ b/src/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -61,15 +61,10 @@ */ #include "config.h" +#include <string.h> #ifdef NEEDPUTENV -#if defined(__STDC__) -# define __P(a) a -#else -# define __P(a) () -#endif - char *malloc __P((int)); char *realloc __P((char *, int)); void free __P((char *)); diff --git a/src/screen.c b/src/screen.c index 67cddbc..d577dc6 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -821,8 +821,8 @@ char **av; char *newbuf = malloc(3 * len); if (!newbuf) Panic(0, strnomem); - newsz = RecodeBuf(nwin_options.aka, len, - nwin_options.encoding, 0, newbuf); + newsz = RecodeBuf((unsigned char *) nwin_options.aka, len, + nwin_options.encoding, 0, (unsigned char *) newbuf); newbuf[newsz] = '\0'; nwin_options.aka = newbuf; } diff --git a/src/utmp.c b/src/utmp.c index 20f3c3c..c5b89c0 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 +/* Copyright (c) 2008, 2009, 2010 * Juergen Weigert (jnwei...@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlsch...@immd4.informatik.uni-erlangen.de) * Micah Cowan (mi...@cowan.name) @@ -89,10 +89,10 @@ static void makedead __P((struct utmp *)); static int pututslot __P((slot_t, struct utmp *, char *, struct win *)); static struct utmp *getutslot __P((slot_t)); #ifndef GETUTENT -static struct utmp *getutent __P((void)); -static void endutent __P((void)); +struct utmp *getutent __P((void)); +void endutent __P((void)); static int initutmp __P((void)); -static void setutent __P((void)); +void setutent __P((void)); #endif #if defined(linux) && defined(GETUTENT) static struct utmp *xpututline __P((struct utmp *utmp)); @@ -661,14 +661,14 @@ initutmp() return (utmpfd = open(UtmpName, O_RDWR)) >= 0; } -static void +void setutent() { if (utmpfd >= 0) (void)lseek(utmpfd, (off_t)0, 0); } -static void +void endutent() { if (utmpfd >= 0) @@ -676,7 +676,7 @@ endutent() utmpfd = -1; } -static struct utmp * +struct utmp * getutent() { if (utmpfd < 0 && !initutmp()) -- 1.6.6.1