| @@ -1,24 +1,25 @@ | | | @@ -1,24 +1,25 @@ |
1 | $NetBSD: patch-ag,v 1.3 2012/05/10 20:53:30 dholland Exp $ | | 1 | $NetBSD: patch-ag,v 1.4 2012/05/14 07:06:16 dholland Exp $ |
2 | | | 2 | |
3 | - needs term.h for termcap | | 3 | - needs term.h for termcap |
4 | - get terminal size from termcap only if LINES and COLUMNS aren't set | | 4 | - get terminal size from termcap only if LINES and COLUMNS aren't set |
5 | in the environment | | 5 | in the environment |
6 | - return values from non-void functions | | 6 | - return values from non-void functions |
7 | (arguably these should be made void but it causes complications) | | 7 | (arguably these should be made void but it causes complications) |
8 | - don't use implicit int | | 8 | - don't use implicit int |
9 | - add missing conditionals around conditionally-used declaration | | 9 | - add missing conditionals around conditionally-used declaration |
10 | - remove unused variables | | 10 | - remove unused variables |
11 | - use correct type signature for signal handler | | 11 | - use correct type signature for signal handler |
| | | 12 | - use time_t for calling time() |
12 | | | 13 | |
13 | --- src/unix.c.orig 1995-11-18 21:36:58.000000000 +0000 | | 14 | --- src/unix.c.orig 1995-11-18 21:36:58.000000000 +0000 |
14 | +++ src/unix.c | | 15 | +++ src/unix.c |
15 | @@ -123,6 +123,7 @@ int scnothing() | | 16 | @@ -123,6 +123,7 @@ int scnothing() |
16 | #include <curses.h> /* Curses screen output */ | | 17 | #include <curses.h> /* Curses screen output */ |
17 | #undef WINDOW /* Oh no! */ | | 18 | #undef WINDOW /* Oh no! */ |
18 | #endif /* CURSES */ | | 19 | #endif /* CURSES */ |
19 | +#include <term.h> | | 20 | +#include <term.h> |
20 | | | 21 | |
21 | /** Completion include files **/ | | 22 | /** Completion include files **/ |
22 | /** Directory accessing: Try and figure this out... if you can! **/ | | 23 | /** Directory accessing: Try and figure this out... if you can! **/ |
23 | @@ -816,9 +817,19 @@ int scopen() | | 24 | @@ -816,9 +817,19 @@ int scopen() |
24 | exit(1); | | 25 | exit(1); |
| @@ -68,35 +69,48 @@ $NetBSD: patch-ag,v 1.3 2012/05/10 20:53 | | | @@ -68,35 +69,48 @@ $NetBSD: patch-ag,v 1.3 2012/05/10 20:53 |
68 | { | | 69 | { |
69 | #if TERMCAP || TERMIOS | | 70 | #if TERMCAP || TERMIOS |
70 | #if !NOISY | | 71 | #if !NOISY |
71 | @@ -1085,7 +1098,9 @@ scbeep() | | 72 | @@ -1085,7 +1098,9 @@ scbeep() |
72 | } | | 73 | } |
73 | | | 74 | |
74 | #if COLOR | | 75 | #if COLOR |
75 | +#if USG || AUX | | 76 | +#if USG || AUX |
76 | static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; | | 77 | static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; |
77 | +#endif | | 78 | +#endif |
78 | | | 79 | |
79 | /** Set foreground color **/ | | 80 | /** Set foreground color **/ |
80 | int scfcol(color) | | 81 | int scfcol(color) |
81 | @@ -1553,7 +1568,6 @@ char *fspec; /* Filename specificatio | | 82 | @@ -1230,11 +1245,9 @@ int bktoshell(f, n) |
| | | 83 | /** Get time of day **/ |
| | | 84 | char * timeset() |
| | | 85 | { |
| | | 86 | - long int buf; /* Should be time_t */ |
| | | 87 | + time_t buf; |
| | | 88 | char * sp, * cp; |
| | | 89 | |
| | | 90 | - char * ctime(); |
| | | 91 | - |
| | | 92 | /* Get system time */ |
| | | 93 | time(&buf); |
| | | 94 | |
| | | 95 | @@ -1553,7 +1566,6 @@ char *fspec; /* Filename specificatio |
82 | /** Get next filename from pattern **/ | | 96 | /** Get next filename from pattern **/ |
83 | char *getnfile() | | 97 | char *getnfile() |
84 | { | | 98 | { |
85 | - int index; | | 99 | - int index; |
86 | struct DIRENTRY * dp; | | 100 | struct DIRENTRY * dp; |
87 | struct stat fstat; | | 101 | struct stat fstat; |
88 | | | 102 | |
89 | @@ -1706,15 +1720,15 @@ char *name; /* name of directory to dele | | 103 | @@ -1706,15 +1718,15 @@ char *name; /* name of directory to dele |
90 | /* | | 104 | /* |
91 | * Window size changes handled via signals. | | 105 | * Window size changes handled via signals. |
92 | */ | | 106 | */ |
93 | -void winch_changed() | | 107 | -void winch_changed() |
94 | +void winch_changed(int sig) | | 108 | +void winch_changed(int sig) |
95 | { | | 109 | { |
96 | + (void)sig; | | 110 | + (void)sig; |
97 | signal(SIGWINCH,winch_changed); | | 111 | signal(SIGWINCH,winch_changed); |
98 | winch_flag = 1; | | 112 | winch_flag = 1; |
99 | } | | 113 | } |
100 | | | 114 | |
101 | void winch_new_size() | | 115 | void winch_new_size() |
102 | { | | 116 | { |