Browse Source

Plan 9 from Bell Labs 2004-03-06

David du Colombier 16 years ago
parent
commit
67a90d8e85

+ 3 - 0
386/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 3 - 0
68020/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 3 - 0
alpha/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 3 - 0
arm/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 12 - 12
dist/replica/plan9.db

@@ -502,7 +502,7 @@
 386/include - 20000000775 sys sys 953243048 0
 386/include/ape - 20000000775 sys sys 944946041 0
 386/include/ape/float.h - 664 sys sys 969656988 1643
-386/include/ape/math.h - 664 sys sys 1046282351 2123
+386/include/ape/math.h - 664 sys sys 1078495286 2176
 386/include/ape/stdarg.h - 664 sys sys 944946040 276
 386/include/ape/ureg.h - 664 sys sys 944946041 812
 386/include/u.h - 664 sys sys 1042604326 1450
@@ -584,7 +584,7 @@
 68020/include - 20000000775 sys sys 944946363 0
 68020/include/ape - 20000000775 sys sys 944946347 0
 68020/include/ape/float.h - 664 sys sys 969656988 1639
-68020/include/ape/math.h - 664 sys sys 1046282351 2123
+68020/include/ape/math.h - 664 sys sys 1078495286 2176
 68020/include/ape/stdarg.h - 664 sys sys 944946347 324
 68020/include/ape/ureg.h - 664 sys sys 944946347 741
 68020/include/dac.h - 664 sys sys 944946363 154
@@ -815,7 +815,7 @@ alpha/conf/10.0.0.2 - 644 sys sys 954267393 128
 alpha/include - 20000000775 sys sys 944946362 0
 alpha/include/ape - 20000000775 sys sys 944946346 0
 alpha/include/ape/float.h - 664 sys sys 969656988 1674
-alpha/include/ape/math.h - 664 sys sys 1046282352 2123
+alpha/include/ape/math.h - 664 sys sys 1078495286 2176
 alpha/include/ape/stdarg.h - 664 sys sys 958591172 413
 alpha/include/ape/ureg.h - 664 sys sys 944946346 1241
 alpha/include/u.h - 664 sys sys 1042604328 1536
@@ -843,7 +843,7 @@ arm/bin/venti - 20000000775 sys sys 1019679272 0
 arm/include - 20000000775 sys sys 985642212 0
 arm/include/ape - 20000000775 sys sys 985642227 0
 arm/include/ape/float.h - 664 sys sys 985642226 1643
-arm/include/ape/math.h - 664 sys sys 1046282352 2123
+arm/include/ape/math.h - 664 sys sys 1078495287 2176
 arm/include/ape/stdarg.h - 664 sys sys 985642227 276
 arm/include/ape/ureg.h - 664 sys sys 985642227 617
 arm/include/u.h - 664 sys sys 1042604329 1419
@@ -2852,7 +2852,7 @@ mips/bin/venti - 20000000775 sys sys 1019679272 0
 mips/include - 20000000775 sys sys 953243035 0
 mips/include/ape - 20000000775 sys sys 944946346 0
 mips/include/ape/float.h - 664 sys sys 969656988 1608
-mips/include/ape/math.h - 664 sys sys 1046282353 2123
+mips/include/ape/math.h - 664 sys sys 1078495287 2176
 mips/include/ape/stdarg.h - 664 sys sys 944946346 324
 mips/include/ape/ureg.h - 664 sys sys 944946346 991
 mips/include/mips2ureg.h - 664 sys sys 952879416 886
@@ -2948,7 +2948,7 @@ power/bin/venti - 20000000775 sys sys 1019679272 0
 power/include - 20000000775 sys sys 945275835 0
 power/include/ape - 20000000775 sys sys 944946355 0
 power/include/ape/float.h - 664 sys sys 969656988 1608
-power/include/ape/math.h - 664 sys sys 1046282353 2123
+power/include/ape/math.h - 664 sys sys 1078495287 2176
 power/include/ape/stdarg.h - 664 sys sys 944946355 324
 power/include/ape/ureg.h - 664 sys sys 944946362 1025
 power/include/u.h - 664 sys sys 1042604330 2764
@@ -3130,7 +3130,7 @@ sparc/bin/venti - 20000000775 sys sys 1019679272 0
 sparc/include - 20000000775 sys sys 944946363 0
 sparc/include/ape - 20000000775 sys sys 944946348 0
 sparc/include/ape/float.h - 664 sys sys 969656988 1624
-sparc/include/ape/math.h - 664 sys sys 1046282354 2123
+sparc/include/ape/math.h - 664 sys sys 1078495288 2176
 sparc/include/ape/stdarg.h - 664 sys sys 944946348 324
 sparc/include/ape/ureg.h - 664 sys sys 944946348 1048
 sparc/include/u.h - 664 sys sys 1042604330 1423
@@ -3885,7 +3885,7 @@ sys/lib/lp/kill/generic - 775 sys sys 954037458 638
 sys/lib/lp/kill/xerox - 775 sys sys 954037458 89
 sys/lib/lp/kill/xerox-4512 - 775 sys sys 954037458 75
 sys/lib/lp/kill/xerox-4517 - 775 sys sys 954037458 75
-sys/lib/lp/log - 20000000775 sys sys 1071620128 0
+sys/lib/lp/log - 20000000777 sys sys 1071620128 0
 sys/lib/lp/perm - 20000000775 sys sys 954037458 0
 sys/lib/lp/process - 20000000775 sys sys 1015012169 0
 sys/lib/lp/process/dpost - 775 sys sys 1015012079 2412
@@ -6806,7 +6806,7 @@ sys/src/cmd/acme/rows.c - 664 sys sys 1068140772 14637
 sys/src/cmd/acme/scrl.c - 664 sys sys 1014926095 3072
 sys/src/cmd/acme/text.c - 664 sys sys 1077376258 27226
 sys/src/cmd/acme/time.c - 664 sys sys 1014926095 1783
-sys/src/cmd/acme/util.c - 664 sys sys 1077376259 7310
+sys/src/cmd/acme/util.c - 664 sys sys 1078466661 7312
 sys/src/cmd/acme/wind.c - 664 sys sys 1073566950 11094
 sys/src/cmd/acme/xfid.c - 664 sys sys 1077376259 19260
 sys/src/cmd/ar.c - 664 sys sys 1046643027 23717
@@ -11832,7 +11832,7 @@ sys/src/libdraw/ellipse.c - 664 sys sys 1040442971 1936
 sys/src/libdraw/emenuhit.c - 664 sys sys 1014927874 7136
 sys/src/libdraw/event.c - 664 sys sys 1014927875 8985
 sys/src/libdraw/fmt.c - 664 sys sys 1070344369 270
-sys/src/libdraw/font.c - 664 sys sys 1014927875 7542
+sys/src/libdraw/font.c - 664 sys sys 1078466654 7542
 sys/src/libdraw/freesubfont.c - 664 sys sys 984709664 259
 sys/src/libdraw/getdefont.c - 664 sys sys 944961724 1082
 sys/src/libdraw/getrect.c - 664 sys sys 1014927875 3046
@@ -11860,7 +11860,7 @@ sys/src/libdraw/rgb.c - 664 sys sys 984709666 1679
 sys/src/libdraw/string.c - 664 sys sys 1040442975 2978
 sys/src/libdraw/stringbg.c - 664 sys sys 1040442975 1611
 sys/src/libdraw/stringsubfont.c - 664 sys sys 944961725 960
-sys/src/libdraw/stringwidth.c - 664 sys sys 1014927877 1587
+sys/src/libdraw/stringwidth.c - 664 sys sys 1078466654 1587
 sys/src/libdraw/subfont.c - 664 sys sys 984709666 495
 sys/src/libdraw/subfontcache.c - 664 sys sys 984709666 745
 sys/src/libdraw/subfontname.c - 664 sys sys 1014927877 762
@@ -11885,7 +11885,7 @@ sys/src/libflate/inflatezlibblock.c - 664 sys sys 984709217 1057
 sys/src/libflate/mkfile - 664 sys sys 1035389777 375
 sys/src/libflate/zlib.h - 664 sys sys 984709217 219
 sys/src/libframe - 20000000775 sys sys 944961726 0
-sys/src/libframe/frbox.c - 664 sys sys 944961726 2995
+sys/src/libframe/frbox.c - 664 sys sys 1078466650 3028
 sys/src/libframe/frdelete.c - 664 sys sys 944961726 3079
 sys/src/libframe/frdraw.c - 664 sys sys 945275945 3277
 sys/src/libframe/frinit.c - 664 sys sys 1019498851 1761

+ 12 - 0
dist/replica/plan9.log

@@ -14017,3 +14017,15 @@
 1078279247 0 c sys/games/lib/fortunes - 664 sys sys 1078279274 247590
 1078281047 0 c sys/games/lib/fortunes - 664 sys sys 1078279900 247772
 1078455619 0 c sys/games/lib/fortunes - 664 sys sys 1078453847 248109
+1078468222 0 c sys/src/cmd/acme/util.c - 664 sys sys 1078466661 7312
+1078468222 1 c sys/src/libdraw/font.c - 664 sys sys 1078466654 7542
+1078468222 2 c sys/src/libdraw/stringwidth.c - 664 sys sys 1078466654 1587
+1078468222 3 c sys/src/libframe/frbox.c - 664 sys sys 1078466650 3028
+1078488026 0 m sys/lib/lp/log - 20000000777 sys sys 1071620128 0
+1078497028 0 c 386/include/ape/math.h - 664 sys sys 1078495286 2176
+1078497028 1 c 68020/include/ape/math.h - 664 sys sys 1078495286 2176
+1078497028 2 c alpha/include/ape/math.h - 664 sys sys 1078495286 2176
+1078497028 3 c arm/include/ape/math.h - 664 sys sys 1078495287 2176
+1078497028 4 c mips/include/ape/math.h - 664 sys sys 1078495287 2176
+1078497028 5 c power/include/ape/math.h - 664 sys sys 1078495287 2176
+1078497028 6 c sparc/include/ape/math.h - 664 sys sys 1078495288 2176

+ 3 - 0
mips/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 3 - 0
power/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 3 - 0
sparc/include/ape/math.h

@@ -71,4 +71,7 @@ extern double yn(int, double);
 }
 #endif
 
+#define isnan(x) isNaN(x)
+#define isinf(x) isInf(x)
+
 #endif /* __MATH */

+ 1 - 1
sys/src/cmd/acme/util.c

@@ -295,7 +295,7 @@ tgetc(void *a, uint n)
 Rune*
 skipbl(Rune *r, int n, int *np)
 {
-	while(n>0 && *r==' ' || *r=='\t' || *r=='\n'){
+	while(n>0 && (*r==' ' || *r=='\t' || *r=='\n')){
 		--n;
 		r++;
 	}

+ 1 - 1
sys/src/libdraw/font.c

@@ -25,7 +25,7 @@ cachechars(Font *f, char **ss, Rune **rr, ushort *cp, int max, int *wp, char **s
 	}
 	wid = 0;
 	*subfontname = 0;
-	for(i=0; (*sp || *rp) && i<max; sp+=w, rp+=rw){
+	for(i=0; i<max && (*sp || *rp); sp+=w, rp+=rw){
 		if(ss){
 			r = *(uchar*)sp;
 			if(r < Runeself)

+ 1 - 1
sys/src/libdraw/stringwidth.c

@@ -24,7 +24,7 @@ _stringnwidth(Font *f, char *s, Rune *r, int len)
 	}else
 		rptr = &r;
 	twid = 0;
-	while((*s || *r) && len){
+	while(len && (*s || *r)){
 		max = Max;
 		if(len < max)
 			max = len;

+ 4 - 1
sys/src/libframe/frbox.c

@@ -116,9 +116,12 @@ static
 void
 chopbox(Frame *f, Frbox *b, int n)	/* drop first n chars; no allocation done */
 {
+	char *p;
+
 	if(b->nrune<0 || b->nrune<n)
 		drawerror(f->display, "chopbox");
-	strcpy((char*)b->ptr, (char*)runeindex(b->ptr, n));
+	p = (char*)runeindex(b->ptr, n);
+	memmove((char*)b->ptr, p, strlen(p)+1);
 	b->nrune -= n;
 	b->wid = stringwidth(f->font, (char *)b->ptr);
 }