Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/1106/16

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


64-bit fixes.
 [rsc] --rw-rw-r-- M 451989 glenda sys 7295 Nov  6 11:11 sys/src/cmd/tbl/t6.c
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:9,16 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:9,16
	  void
	  maktab(void)			/* define the tab stops of the table */
	  {
	- 	int	icol, ilin, tsep, k, ik, vforml, il, text;
	- 	char	*s;
	+ 	int	icol, ilin, tsep, k, ik, vforml, il, s, text;
	+ 	char	*ss;
	  
	  	for (icol = 0; icol < ncol; icol++) {
	  		doubled[icol] = acase[icol] = 0;
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:34,47 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:34,48
	  				switch (ctype(vforml, icol)) {
	  				case 'a':
	  					acase[icol] = 1;
	- 					s = table[ilin][icol].col;
	- 					if ((int)s > 0 && (int)s < 128 && text) {
	+ 					ss = table[ilin][icol].col;
	+ 					s = (int)(uintptr)ss;
	+ 					if (s > 0 && s < 128 && text) {
	  						if (doubled[icol] == 0)
	  							Bprint(&tabout, ".nr %d 0\n.nr %d 0\n",
	  							    S1, S2);
	  						doubled[icol] = 1;
	  						Bprint(&tabout, ".if \\n(%c->\\n(%d .nr %d \\n(%c-\n",
	- 						    (int)s, S2, S2, (int)s);
	+ 						    s, S2, S2, (int)s);
	  					}
	  				case 'n':
	  					if (table[ilin][icol].rcol != 0) {
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:49,66 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:50,68
	  							Bprint(&tabout, ".nr %d 0\n.nr %d 0\n",
	  							    S1, S2);
	  						doubled[icol] = 1;
	- 						if (real(s = table[ilin][icol].col) && !vspen(s)) {
	- 							if (tx((int)s) != text) 
	+ 						if (real(ss = table[ilin][icol].col) && !vspen(ss)) {
	+ 							s = (int)(uintptr)ss;
	+ 							if (tx(s) != text) 
	  								continue;
	  							Bprint(&tabout, ".nr %d ", TMP);
	- 							wide(s, FN(vforml, icol), SZ(vforml, icol)); 
	+ 							wide(ss, FN(vforml, icol), SZ(vforml, icol)); 
	  							Bprint(&tabout, "\n");
	  							Bprint(&tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n",
	  							    S1, TMP, S1, TMP);
	  						}
	- 						if (text == 0 && real(s = table[ilin][icol].rcol) && !vspen(s) && !barent(s)) {
	+ 						if (text == 0 && real(ss = table[ilin][icol].rcol) && !vspen(ss) && !barent(ss)) {
	  							Bprint(&tabout, ".nr %d \\w%c%s%c\n",
	- 							    TMP, F1, s, F1);
	+ 							    TMP, F1, ss, F1);
	  							Bprint(&tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n", S2, TMP, S2,
	  							     TMP);
	  						}
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:69,79 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:71,82
	  				case 'r':
	  				case 'c':
	  				case 'l':
	- 					if (real(s = table[ilin][icol].col) && !vspen(s)) {
	- 						if (tx((int)s) != text) 
	+ 					if (real(ss = table[ilin][icol].col) && !vspen(ss)) {
	+ 						s = (int)(uintptr)ss;
	+ 						if (tx(s) != text) 
	  							continue;
	  						Bprint(&tabout, ".nr %d ", TMP);
	- 						wide(s, FN(vforml, icol), SZ(vforml, icol)); 
	+ 						wide(ss, FN(vforml, icol), SZ(vforml, icol)); 
	  						Bprint(&tabout, "\n");
	  						Bprint(&tabout, ".if \\n(%2s<\\n(%d .nr %2s \\n(%d\n",
	  						     reg(icol, CRIGHT), TMP, reg(icol, CRIGHT), TMP);
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:100,107 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:103,110
	  		}
	  		for (ilin = 0; ilin < nlin; ilin++)
	  			if (k = lspan(ilin, icol)) {
	- 				s = table[ilin][icol-k].col;
	- 				if (!real(s) || barent(s) || vspen(s) ) 
	+ 				ss = table[ilin][icol-k].col;
	+ 				if (!real(ss) || barent(ss) || vspen(ss) ) 
	  					continue;
	  				Bprint(&tabout, ".nr %d ", TMP);
	  				wide(table[ilin][icol-k].col, FN(ilin, icol - k), SZ(ilin, icol - k));
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t6.c:210,216 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t6.c:213,219
	  			putsize("0");
	  		Bprint(&tabout, "%c", F1);
	  	} else
	- 		Bprint(&tabout, "\\n(%c-", (int)s);
	+ 		Bprint(&tabout, "\\n(%c-", (int)(uintptr)s);
	  }
	  
	  
 [rsc] --rw-rw-r-- M 451989 glenda sys 9041 Nov  6 11:11 sys/src/cmd/tbl/t8.c
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:9,17 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:9,17
	  				/* i is line number for deciding format */
	  				/* nl is line number for finding data   usually identical */
	  {
	- 	int	c, lf, ct, form, lwid, vspf, ip, cmidx, exvspen, vforml;
	+ 	int	c, s, lf, ct, form, lwid, vspf, ip, cmidx, exvspen, vforml;
	  	int	vct, chfont, uphalf;
	- 	char	*s, *size, *fn, *rct;
	+ 	char	*ss, *size, *fn, *rct;
	  
	  	cmidx = watchout = vspf = exvspen = 0;
	  	if (i == 0) 
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:20,39 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:20,43
	  		fullwide(0,   dboxflg ? '=' : '-');
	  	if (instead[nl] == 0 && fullbot[nl] == 0)
	  		for (c = 0; c < ncol; c++) {
	- 			s = table[nl][c].col;
	- 			if (s == 0) 
	+ 			ss = table[nl][c].col;
	+ 			if (ss == 0) 
	  				continue;
	- 			if (vspen(s)) {
	- 				for (ip = nl; ip < nlin; ip = next(ip))
	- 					if (!vspen(s = table[ip][c].col)) 
	+ 			if (vspen(ss)) {
	+ 				for (ip = nl; ip < nlin; ip = next(ip)){
	+ 					ss = table[ip][c].col;
	+ 					if (!vspen(ss)) 
	  						break;
	- 				if ((int)s > 0 && (int)s < 128)
	- 					Bprint(&tabout, ".ne \\n(%c|u+\\n(.Vu\n", (int)s);
	+ 				}
	+ 				s = (int)(uintptr)ss;
	+ 				if (s > 0 && s < 128)
	+ 					Bprint(&tabout, ".ne \\n(%c|u+\\n(.Vu\n", s);
	  				continue;
	  			}
	- 			if (point(s)) 
	+ 			if (point(ss)) 
	  				continue;
	- 			Bprint(&tabout, ".ne \\n(%c|u+\\n(.Vu\n", (int)s);
	+ 			s = (int)(uintptr)ss;
	+ 			Bprint(&tabout, ".ne \\n(%c|u+\\n(.Vu\n", s);
	  			watchout = 1;
	  		}
	  	if (linestop[nl])
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:66,86 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:70,92
	  	vspf = 0;
	  	chfont = 0;
	  	for (c = 0; c < ncol; c++) {
	- 		s = table[nl][c].col;
	- 		if (s == 0) 
	+ 		ss = table[nl][c].col;
	+ 		if (ss == 0) 
	  			continue;
	- 		chfont |= (int)(font[c][stynum[nl]]);
	- 		if (point(s) ) 
	+ 		if(font[c][stynum[nl]])
	+ 			chfont = 1;
	+ 		if (point(ss) ) 
	  			continue;
	+ 		s = (int)(uintptr)ss;
	  		lf = prev(nl);
	  		if (lf >= 0 && vspen(table[lf][c].col))
	  			Bprint(&tabout,
	  			   ".if (\\n(%c|+\\n(^%c-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(^%c-\\n(#--1v)\n",
	- 			    (int)s, 'a' + c, (int)s, 'a' + c);
	+ 			    s, 'a' + c, s, 'a' + c);
	  		else
	  			Bprint(&tabout,
	  			    ".if (\\n(%c|+\\n(#^-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(#^-\\n(#--1v)\n",
	- 			    (int)s, (int)s);
	+ 			    s, s);
	  	}
	  	if (allflg && once > 0 )
	  		fullwide(i, '-');
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:117,123 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:123,129
	  				rct = reg(c, CMID);
	  			Bprint(&tabout, "\\h'|\\n(%2su'", rct);
	  		}
	- 		s = table[nl][c].col;
	+ 		ss = table[nl][c].col;
	  		fn = font[c][stynum[vforml]];
	  		size = csize[c][stynum[vforml]];
	  		if (*size == 0)
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:150,161 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:156,167
	  					Bprint(&tabout, "%c%c", F1, F2);
	  					if (uphalf) 
	  						Bprint(&tabout, "\\u");
	- 					puttext(s, fn, size);
	+ 					puttext(ss, fn, size);
	  					if (uphalf) 
	  						Bprint(&tabout, "\\d");
	  					Bprint(&tabout, "%c", F1);
	  				}
	- 				s = table[nl][c].rcol;
	+ 				ss = table[nl][c].rcol;
	  				form = 1;
	  				break;
	  			}
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:179,190 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:185,196
	  		}
	  		if (realsplit ? rused[c] : used[c]) /*Zero field width*/ {
	  			/* form: 1 left, 2 right, 3 center adjust */
	- 			if (ifline(s)) {
	- 				makeline(i, c, ifline(s));
	+ 			if (ifline(ss)) {
	+ 				makeline(i, c, ifline(ss));
	  				continue;
	  			}
	- 			if (filler(s)) {
	- 				Bprint(&tabout, "\\l'|\\n(%2su\\&%s'", reg(c, CRIGHT), s + 2);
	+ 			if (filler(ss)) {
	+ 				Bprint(&tabout, "\\l'|\\n(%2su\\&%s'", reg(c, CRIGHT), ss + 2);
	  				continue;
	  			}
	  			ip = prev(nl);
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:204,216 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:210,222
	  			Bprint(&tabout, "%c", F1);
	  			if (form != 1)
	  				Bprint(&tabout, "%c", F2);
	- 			if (vspen(s))
	+ 			if (vspen(ss))
	  				vspf = 1;
	  			else
	  			 {
	  				if (uphalf) 
	  					Bprint(&tabout, "\\u");
	- 				puttext(s, fn, size);
	+ 				puttext(ss, fn, size);
	  				if (uphalf) 
	  					Bprint(&tabout, "\\d");
	  			}
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/t8.c:289,295 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/t8.c:295,301
	  			continue;
	  		if (ss == 0) 
	  			continue;
	- 		s = (int)ss;
	+ 		s = (int)(uintptr)ss;
	  		Bprint(&tabout, ".sp |\\n(##u-1v\n");
	  		Bprint(&tabout, ".nr %d ", SIND);
	  		ct = 0;
 [rsc] --rw-rw-r-- M 451989 glenda sys 1274 Nov  6 11:11 sys/src/cmd/tbl/tc.c
	/n/sourcesdump/2005/1106/plan9/sys/src/cmd/tbl/tc.c:54,65 - 
	/n/sourcesdump/2005/1107/plan9/sys/src/cmd/tbl/tc.c:54,63
	  	return;
	  }
	  
	- 
	  int
	- point(char *s)
	+ point(char *ss)
	  {
	- 	int	ss = (int)s;
	- 	return(ss >= 128 || ss < 0);
	- }
	+ 	int s = (int)(uintptr)ss;
	  
	- 
	+ 	return(s >= 128 || s < 0);
	+ }


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.