Re: [9fans] Conversion of constants in C compiler

2022-04-21 Thread ori
Quoth adr :
> On Wed, 20 Apr 2022, o...@eigenstate.org wrote:
> > When you have a patch, let me know -- I'll happily test
> > and apply to 9front.
> 
> Hi ori, this patch applyes to the sources served at 9front.org.

Highly appreciated -- I'm busy this week, but I'll take a look
in the coming week.

> By the way, do you plan to keep in sync
> http://only9fans.com/ori/git9/HEAD/info.html or should I forget
> about that repo?

I'll update it. There are a few changes in flight that are being
worked on, and once I commit them to 9front I'll sync back.


--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T22754f10b241991c-M355f4cd245105b2412ae537d
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] kerTeX: LaTeX fixes

2022-04-21 Thread tlaronde
FWIW, for LaTeX users (I'm not), I had made a blunder in the latex.sh
recipe preventing the installation of a part of the (huge) psnfss font
collection. It has been corrected.

Since a LaTeX user hit a capacity limit, I have also increased the 'BIG'
version of the prote engine.

One thing that may hit other (not LaTeX) users: if a line was not
terminated by a newline, but it was the end of the file, it was an
error. After a multiplication of files not ending with a newline, I have
modified the input routine to consider the eof to be a valid end of
line.

Everything is online.
-- 
Thierry Laronde 
 http://www.kergis.com/
http://kertex.kergis.com/
   http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Te611298245b35d96-M77e2f0634eda5684dc7bfd8c
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Conversion of constants in C compiler

2022-04-21 Thread adr

On Wed, 20 Apr 2022, o...@eigenstate.org wrote:

When you have a patch, let me know -- I'll happily test
and apply to 9front.


Hi ori, this patch applyes to the sources served at 9front.org.
By the way, do you plan to keep in sync
http://only9fans.com/ori/git9/HEAD/info.html or should I forget
about that repo?

Regards,
adr.

--- /n/9front/sys/src/cmd/cc/lex.c  Wed Apr  6 14:45:26 2022
+++ /tmp/lex.c  Thu Apr 21 08:39:14 2022
@@ -848,16 +848,9 @@
   yyerror("overflow in constant");

   vv = yylval.vval;
-   /*
-* c99 is silly: decimal constants stay signed,
-* hex and octal go unsigned before widening.
-*/
-   w = 32;
-   if((c1 & (Numdec|Numuns)) == Numdec)
-   w = 31;
-   if(c1 & Numvlong || (c1 & Numlong) == 0 && (uvlong)vv >= 1ULL< convvtox(vv, TULONG) ||
+ (c1 & (Numdec|Numuns)) == Numdec && convvtox(vv, TLONG) < 0) {
   if((c1 & Numuns) || convvtox(vv, TVLONG) < 0) {
   c = LUVLCONST;
   t = TUVLONG;
@@ -867,7 +860,9 @@
   t = TVLONG;
   goto nret;
   }
-   if(c1 & Numlong) {
+   if(c1 & Numlong ||
+ convvtox(vv, TULONG) > convvtox(vv, TUINT) ||
+ (c1 & (Numdec|Numuns)) == Numdec && convvtox(vv, TINT) < 0) {
   if((c1 & Numuns) || convvtox(vv, TLONG) < 0) {
   c = LULCONST;
   t = TULONG;
--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T22754f10b241991c-Mefe97ddcd27aad8f1a072269
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
--- /n/9front/sys/src/cmd/cc/lex.c	Wed Apr  6 14:45:26 2022
+++ /tmp/lex.c	Thu Apr 21 08:39:14 2022
@@ -848,16 +848,9 @@
 		yyerror("overflow in constant");
 
 	vv = yylval.vval;
-	/*
-	 * c99 is silly: decimal constants stay signed,
-	 * hex and octal go unsigned before widening.
-	 */
-	w = 32;
-	if((c1 & (Numdec|Numuns)) == Numdec)
-		w = 31;
-	if(c1 & Numvlong || (c1 & Numlong) == 0 && (uvlong)vv >= 1ULL< convvtox(vv, TULONG) ||
+	  (c1 & (Numdec|Numuns)) == Numdec && convvtox(vv, TLONG) < 0) {
 		if((c1 & Numuns) || convvtox(vv, TVLONG) < 0) {
 			c = LUVLCONST;
 			t = TUVLONG;
@@ -867,7 +860,9 @@
 		t = TVLONG;
 		goto nret;
 	}
-	if(c1 & Numlong) {
+	if(c1 & Numlong ||
+	  convvtox(vv, TULONG) > convvtox(vv, TUINT) ||
+	  (c1 & (Numdec|Numuns)) == Numdec && convvtox(vv, TINT) < 0) {
 		if((c1 & Numuns) || convvtox(vv, TLONG) < 0) {
 			c = LULCONST;
 			t = TULONG;