summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-Drop-using-register-keyword.patch
blob: f508711d34dae8986f6193644255108961427165 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
From af89f36fbeb5f6a078b349eed8fc4ad6fbfdf5d1 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 16 Jan 2023 15:26:12 -0800
Subject: [PATCH] Drop using register keyword

Its gone since c++17

Fixes
error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
|         register char c;
|         ^~~~~~~~~

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 telnet/commands.cc     |  14 +++++++-------
 telnet/defines.h       |   1 +
 telnet/sys_bsd.cc      |   2 +-
 telnet/telnet.cc       |  18 +++++++++---------
 telnet/terminal.cc     |   4 ++--
 telnet/tn3270.cc       |   4 ++--
 telnet/tn3270.o        | Bin 4008 -> 4008 bytes
 telnet/utilities.cc    |   6 +++---
 telnetd/setproctitle.c |   6 +++---
 telnetd/slc.c          |   4 ++--
 telnetd/state.c        |  12 ++++++------
 telnetd/sys_term.c     |   4 ++--
 telnetd/telnetd.c      |   4 ++--
 telnetd/termstat.c     |   4 ++--
 telnetd/utility.c      |  16 ++++++++--------
 15 files changed, 50 insertions(+), 49 deletions(-)

--- a/telnet/commands.cc
+++ b/telnet/commands.cc
@@ -192,8 +192,8 @@ static int margc;
 static const char *margv[20];
 
 static void makeargv(void) {
-    register char *cp, *cp2, c;
-    register const char **argp = margv;
+    char *cp, *cp2, c;
+    const char **argp = margv;
 
     margc = 0;
     cp = line;
@@ -204,7 +204,7 @@ static void makeargv(void) {
 	cp++;
     }
     while ((c = *cp)!=0) {
-	register int inquote = 0;
+	int inquote = 0;
 	while (isspace(c))
 	    c = *++cp;
 	if (c == '\0')
@@ -281,7 +281,7 @@ static const char *control(cc_t c)
 	 * was to assign "c" to an unsigned int variable...
 	 * Arggg....
 	 */
-	register unsigned int uic = (unsigned int)c;
+	unsigned int uic = (unsigned int)c;
 
 	if (uic == 0x7f)
 		return ("^?");
@@ -479,7 +479,7 @@ int send_tncmd(int (*func)(int, int), co
     long opt;
 
     if (isprefix(name, "help") || isprefix(name, "?")) {
-	register int col, len;
+	int col, len;
 
 	printf("Usage: send %s <option>\n", cmd);
 	printf("Valid options are:\n\t");
@@ -2212,8 +2212,8 @@ static unsigned long sourceroute(char *a
 	static char lsr[44];
 	char *cp, *cp2, *lsrp, *lsrep;
 	struct in_addr sin_addr;
-	register struct hostent *host = 0;
-	register char c;
+	struct hostent *host = 0;
+	char c;
 
 	/*
 	 * Verify the arguments, and make sure we have
--- a/telnet/defines.h
+++ b/telnet/defines.h
@@ -52,3 +52,4 @@
 #define	CONTROL(x)	((x)&0x1f)		/* CTRL(x) is not portable */
 
 #define MODE_OUT8	0x8000			/* binary mode sans -opost */
+
--- a/telnet/sys_bsd.cc
+++ b/telnet/sys_bsd.cc
@@ -285,7 +285,7 @@ void sys_telnet_init(void) {
 int process_rings(int netin, int netout, int netex, int ttyin, int ttyout, 
 		  int poll /* If 0, then block until something to do */)
 {
-    register int c, maxfd;
+    int c, maxfd;
 		/* One wants to be a bit careful about setting returnValue
 		 * to one, since a one implies we did some useful work,
 		 * and therefore probably won't be called to block next
--- a/telnet/telnet.cc
+++ b/telnet/telnet.cc
@@ -864,7 +864,7 @@ struct spc {
 static int slc_mode = SLC_EXPORT;
 
 void slc_init(void) {
-  register struct spc *spcp;
+  struct spc *spcp;
   
   localchars = 1;
   for (spcp = spc_data; spcp < &spc_data[NSLC+1]; spcp++) {
@@ -944,7 +944,7 @@ void slc_import(int def) {
 }
 
 void slc_export(void) {
-  register struct spc *spcp;
+  struct spc *spcp;
   
   TerminalDefaultChars();
   
@@ -966,8 +966,8 @@ void slc_export(void) {
 }
 
 void slc(unsigned char *cp, int len) {
-  register struct spc *spcp;
-  register int func,level;
+  struct spc *spcp;
+  int func,level;
   
   slc_start_reply();
   
@@ -1032,7 +1032,7 @@ void slc(unsigned char *cp, int len) {
 }
 
 void slc_check(void) {
-  register struct spc *spcp;
+  struct spc *spcp;
   
   slc_start_reply();
   for (spcp = &spc_data[1]; spcp < &spc_data[NSLC+1]; spcp++) {
@@ -1080,7 +1080,7 @@ void slc_add_reply(int func, int flags,
 }
 
 void slc_end_reply(void) {
-  register int len;
+  int len;
   
   *slc_replyp++ = IAC;
   *slc_replyp++ = SE;
@@ -1200,7 +1200,7 @@ void env_opt_add(const char *ep) {
   tp = opt_replyp + (vp ? strlen(vp) * 2 : 0) + strlen(ep) * 2 + 6;
   if (tp > opt_replyend)
     {
-      register int len;
+      int len;
       len = ((tp - opt_reply) + OPT_REPLY_SIZE - 1) & ~(OPT_REPLY_SIZE - 1);
       opt_replyend = opt_reply + len;
       opt_reply = (unsigned char *)realloc(opt_reply, len);
@@ -1236,7 +1236,7 @@ void env_opt_add(const char *ep) {
 }
 
 void env_opt_end(int emptyok) {
-  register int len;
+  int len;
   
   len = opt_replyp - opt_reply + 2;
   if (emptyok || len > 6) {
@@ -1874,7 +1874,7 @@ static unsigned char *nextitem(unsigned
 
 static void netclear(void) {
 #if	0	/* XXX */
-  register char *thisitem, *next;
+  char *thisitem, *next;
   char *good;
 #define	wewant(p)	((nfrontp > p) && (*p == IAC) && \
 			 (p[1] != EC) && (p[1] != EL))
--- a/telnet/terminal.cc
+++ b/telnet/terminal.cc
@@ -569,8 +569,8 @@ struct termspeeds {
 };
 
 void TerminalSpeeds(long *ispeed, long *ospeed) {
-    register struct termspeeds *tp;
-    register long in, out;
+    struct termspeeds *tp;
+    long in, out;
 
     out = cfgetospeed(&old_tc);
     in = cfgetispeed(&old_tc);
--- a/telnet/tn3270.cc
+++ b/telnet/tn3270.cc
@@ -103,7 +103,7 @@ void init_3270(void) {
  * done:	is this the last of a logical block
  */
 int DataToNetwork(char *buffer, int count, int done) {
-    register int loop, c;
+    int loop, c;
     int origCount;
     
     origCount = count;
@@ -179,7 +179,7 @@ void outputPurge(void) {
  * count:	how much to send
  */
 int DataToTerminal(char *buffer, int count) {
-    register int c;
+    int c;
     int origCount;
 
     origCount = count;
--- a/telnet/utilities.cc
+++ b/telnet/utilities.cc
@@ -252,7 +252,7 @@ void optionstatus(void) {
 /* pointer: where suboption data sits */
 /* length: length of suboption data */
 void printsub(int direction, unsigned char *pointer, int length) {
-    register int i = 0;
+    int i = 0;
 
     extern int want_status_response;
 
@@ -262,7 +262,7 @@ void printsub(int direction, unsigned ch
 	    fprintf(NetTrace, "%s IAC SB ",
 				(direction == '<')? "RCVD":"SENT");
 	    if (length >= 3) {
-		register int j;
+		int j;
 
 		i = pointer[length-2];
 		j = pointer[length-1];
@@ -577,7 +577,7 @@ void printsub(int direction, unsigned ch
 		fprintf(NetTrace, "INFO ");
 	    env_common:
 		{
-		    register int noquote = 2;
+		    int noquote = 2;
 		    for (i = 2; i < length; i++ ) {
 			switch (pointer[i]) {
 			case ENV_VAR:
--- a/telnetd/setproctitle.c
+++ b/telnetd/setproctitle.c
@@ -76,7 +76,7 @@ static char Argv0[128];			/* program nam
 void
 initsetproctitle(int argc, char **argv, char **envp)
 {
-	register int i;
+	int i;
 	char *tmp;
 
 	/*
@@ -111,8 +111,8 @@ initsetproctitle(int argc, char **argv,
 void
 setproctitle(const char *fmt, ...)
 {
-	register char *p;
-	register int i=0;
+	char *p;
+	int i=0;
 	static char buf[2048];
 	va_list ap;
 
--- a/telnetd/slc.c
+++ b/telnetd/slc.c
@@ -196,7 +196,7 @@ int end_slc(unsigned char **bufp) {
  * Figure out what to do about the client's slc
  */
 void process_slc(unsigned char func, unsigned char flag, cc_t val) {
-    register int hislevel, mylevel, ack;
+    int hislevel, mylevel, ack;
 
     /*
      * Ensure that we know something about this function
@@ -260,7 +260,7 @@ void process_slc(unsigned char func, uns
  * Compare client's request with what we are capable of supporting.
  */
 void change_slc(char func, char flag, cc_t val) {
-    register int hislevel, mylevel;
+    int hislevel, mylevel;
     
     hislevel = flag & SLC_LEVELBITS;
     mylevel = slctab[func].defset.flag & SLC_LEVELBITS;
--- a/telnetd/state.c
+++ b/telnetd/state.c
@@ -79,7 +79,7 @@ unsigned char subbuffer[512], *subpointe
 #define	TS_DONT		8	/* dont " */
 
 void telrcv(void) {
-    register int c;
+    int c;
     static int state = TS_DATA;
 
     while (ncc > 0) {
@@ -1081,7 +1081,7 @@ void suboption(void) {
 
 #ifdef	LINEMODE
     case TELOPT_LINEMODE: {
-	register int request;
+	int request;
 
 	if (his_state_is_wont(TELOPT_LINEMODE))	/* Ignore if option disabled */
 		break;
@@ -1158,8 +1158,8 @@ void suboption(void) {
     }  /* end of case TELOPT_XDISPLOC */
 
     case TELOPT_ENVIRON: {
-	register int c;
-	register char *cp, *varp, *valp;
+	int c;
+	char *cp, *varp, *valp;
 
 	if (SB_EOF())
 		return;
@@ -1299,8 +1299,8 @@ static void doclientstat(void) {
 
 void send_status(void) {
     unsigned char statusbuf[256];
-    register unsigned char *ncp;
-    register unsigned char i;
+    unsigned char *ncp;
+    unsigned char i;
     
     ncp = statusbuf;
     
--- a/telnetd/sys_term.c
+++ b/telnetd/sys_term.c
@@ -413,7 +413,7 @@ extern int def_tspeed, def_rspeed;
 
 static int getptyslave(void) {
 #if 0
-    register int t = -1;
+    int t = -1;
 
 # ifdef	LINEMODE
     int waslm;
@@ -505,7 +505,7 @@ static int getptyslave(void) {
  * making sure that we have a clean tty.
  */
 static int cleanopen(char *lyne) {
-    register int t;
+    int t;
 
     /*
      * Make sure that other people can't open the
--- a/telnetd/telnetd.c
+++ b/telnetd/telnetd.c
@@ -93,7 +93,7 @@ main(int argc, char *argv[], char *env[]
 	struct sockaddr_in from;
 	int on = 1;
 	socklen_t fromlen;
-	register int ch;
+	int ch;
 
 #if	defined(HAS_IPPROTO_IP) && defined(IP_TOS)
 	int tos = -1;
@@ -837,7 +837,7 @@ void telnet(int f, int p)
     
 #ifdef TIOCNOTTY
     {
-	register int t;
+	int t;
 	t = open(_PATH_TTY, O_RDWR);
 	if (t >= 0) {
 	    (void) ioctl(t, TIOCNOTTY, (char *)0);
--- a/telnetd/termstat.c
+++ b/telnetd/termstat.c
@@ -347,7 +347,7 @@ done:
  * at a time, and if using kludge linemode, then only linemode may be
  * affected.
  */
-void clientstat(register int code, register int parm1, register int parm2)
+void clientstat(int code, register int parm1, register int parm2)
 {
 	/*
 	 * Get a copy of terminal characteristics.
@@ -419,7 +419,7 @@ void clientstat(register int code, regis
 	
 	case LM_MODE:
 	    {
-		register int ack, changed;
+		int ack, changed;
 
 		/*
 		 * Client has sent along a mode mask.  If it agrees with
--- a/telnetd/utility.c
+++ b/telnetd/utility.c
@@ -189,7 +189,7 @@ nextitem(char *current, const char *endp
 	return current+3 <= endp ? current+3 : NULL;
     case SB:		/* loop forever looking for the SE */
 	{
-	    register char *look = current+2;
+	    char *look = current+2;
 
 	    while (look < endp) {
 		if ((*look++&0xff) == IAC) {
@@ -224,7 +224,7 @@ nextitem(char *current, const char *endp
  */
 void netclear(void)
 {
-    register char *thisitem, *next;
+    char *thisitem, *next;
     char *good;
 #define	wewant(p)	((nfrontp > p) && ((*p&0xff) == IAC) && \
 				(nfrontp > p+1 && (((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL))))
@@ -354,7 +354,7 @@ netflush(void)
  *    ptr - A pointer to a character string to write
  *    len - How many bytes to write
  */
-void writenet(register unsigned char *ptr, register int len)
+void writenet(unsigned char *ptr, register int len)
 {
 	/* flush buffer if no room for new data) */
 	if ((&netobuf[BUFSIZ] - nfrontp) < len) {
@@ -589,7 +589,7 @@ printoption(const char *fmt, int option)
 void
 printsub(char direction, unsigned char *pointer, int length)
 {
-    register int i = -1;
+    int i = -1;
 #ifdef AUTHENTICATE
     char buf[512];
 #endif
@@ -601,7 +601,7 @@ printsub(char direction, unsigned char *
 	    netoprintf("td: %s suboption ",
 		       direction == '<' ? "recv" : "send");
 	    if (length >= 3) {
-		register int j;
+		int j;
 
 		i = pointer[length-2];
 		j = pointer[length-1];
@@ -817,7 +817,7 @@ printsub(char direction, unsigned char *
 
 	case TELOPT_STATUS: {
 	    const char *cp;
-	    register int j, k;
+	    int j, k;
 
 	    netoprintf("STATUS");
 
@@ -914,7 +914,7 @@ printsub(char direction, unsigned char *
 		netoprintf("INFO ");
 	    env_common:
 		{
-		    register int noquote = 2;
+		    int noquote = 2;
 		    for (i = 2; i < length; i++ ) {
 			switch (pointer[i]) {
 			case ENV_VAR:
@@ -1125,7 +1125,7 @@ printsub(char direction, unsigned char *
 void
 printdata(const char *tag, const char *ptr, int cnt)
 {
-	register int i;
+	int i;
 	char xbuf[30];
 
 	while (cnt) {