diff options
author | Andreas Scherer <andreas_tex@freenet.de> | 2023-11-18 23:31:31 +0000 |
---|---|---|
committer | Andreas Scherer <andreas_tex@freenet.de> | 2023-11-18 23:31:31 +0000 |
commit | 2a9df9dfa26bbb66de871acbd6d1de85394f44ee (patch) | |
tree | c1467518b14a4c00ab4fc202bc806c6c78f7b2ee /Build | |
parent | 26d6f3fd916b1baebe24ab80e72212299d4f42fd (diff) |
[CWEB] Use zero-initialisation.
This trick works, because 'ignore' and 'NULL' are in fact '0'.
git-svn-id: svn://tug.org/texlive/trunk@68894 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/ChangeLog | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/ctangleboot.cin | 197 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebboot.cin | 165 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ChangeLog | 9 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.c | 121 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/common.w | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.c | 145 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctangle.w | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/ctwill-mini.ch | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/cwebdir/cweave.w | 20 |
10 files changed, 338 insertions, 346 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog index 4bc6d326a1e..d8b8c81d16c 100644 --- a/Build/source/texk/web2c/ChangeLog +++ b/Build/source/texk/web2c/ChangeLog @@ -1,3 +1,8 @@ +2023-11-19 Andreas Scherer <https://ascherer.github.io> + + * ctangleboot.cin, + * cwebboot.cin: Use zero-initialisation. + 2023-11-15 Karl Berry <karl@freefriends.org> * tex.ch, diff --git a/Build/source/texk/web2c/ctangleboot.cin b/Build/source/texk/web2c/ctangleboot.cin index dbd0d74cb26..39ceae9d14f 100644 --- a/Build/source/texk/web2c/ctangleboot.cin +++ b/Build/source/texk/web2c/ctangleboot.cin @@ -367,21 +367,21 @@ static char translit[0200][translit_length]; /*:57*//*62:*/ #line 770 "cwebdir/ctangle.w" -static eight_bits ccode[256]; +static eight_bits ccode[256]= {ignore}; /*:62*//*66:*/ -#line 830 "cwebdir/ctangle.w" +#line 827 "cwebdir/ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 867 "cwebdir/ctangle.w" +#line 864 "cwebdir/ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1185 "cwebdir/ctangle.w" +#line 1182 "cwebdir/ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -450,29 +450,29 @@ static void output_defs(void); static void out_char(eight_bits); /*:49*//*65:*/ -#line 810 "cwebdir/ctangle.w" +#line 807 "cwebdir/ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); /*:65*//*70:*/ -#line 918 "cwebdir/ctangle.w" +#line 915 "cwebdir/ctangle.w" static eight_bits get_next(void); /*:70*//*84:*/ -#line 1211 "cwebdir/ctangle.w" +#line 1208 "cwebdir/ctangle.w" static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1402 "cwebdir/ctangle.w" +#line 1399 "cwebdir/ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1479 "cwebdir/ctangle.w" +#line 1476 "cwebdir/ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1512 "cwebdir/ctangle.w" +#line 1509 "cwebdir/ctangle.w" static void skip_limbo(void); /*:101*/ @@ -520,10 +520,7 @@ snprintf(translit[i],translit_length,"X%02X",(unsigned int)(0200+i)); #line 166 "cwebdir/ctang-w2c.ch" /*:58*//*63:*/ #line 773 "cwebdir/ctangle.w" -{ -int c; -for(c= 0;c<256;c++)ccode[c]= ignore; -} + ccode[' ']= ccode['\t']= ccode['\n']= ccode['\v']= ccode['\r']= ccode['\f'] = ccode['*']= new_section; ccode['@']= (eight_bits)'@';ccode['=']= string; @@ -539,7 +536,7 @@ ccode['<']= ccode['(']= section_name; ccode['\'']= ord; /*:63*//*78:*/ -#line 1106 "cwebdir/ctangle.w" +#line 1103 "cwebdir/ctangle.w" section_text[0]= ' '; /*:78*//*117:*/ @@ -1183,7 +1180,7 @@ default:C_putc(cur_char);out_state= normal;break; } /*:55*//*64:*/ -#line 794 "cwebdir/ctangle.w" +#line 791 "cwebdir/ctangle.w" static eight_bits skip_ahead(void) @@ -1201,7 +1198,7 @@ if(c!=ignore||*(loc-1)=='>')return c; } /*:64*//*67:*/ -#line 833 "cwebdir/ctangle.w" +#line 830 "cwebdir/ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -1214,7 +1211,7 @@ if(get_line())return comment_continues= true; else{ #line 215 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in mid-comment")); -#line 844 "cwebdir/ctangle.w" +#line 841 "cwebdir/ctangle.w" return comment_continues= false; } @@ -1229,7 +1226,7 @@ if(c=='@'){ if(ccode[(eight_bits)*loc]==new_section){ #line 221 "cwebdir/ctang-w2c.ch" err_print(_("! Section name ended in mid-comment"));loc--; -#line 857 "cwebdir/ctangle.w" +#line 854 "cwebdir/ctangle.w" return comment_continues= false; } @@ -1239,7 +1236,7 @@ else loc++; } /*:67*//*69:*/ -#line 874 "cwebdir/ctangle.w" +#line 871 "cwebdir/ctangle.w" static eight_bits get_next(void) @@ -1254,7 +1251,7 @@ else if(print_where&&!no_where){ sixteen_bits a; print_where= false; /*85:*/ -#line 1221 "cwebdir/ctangle.w" +#line 1218 "cwebdir/ctangle.w" { store_two_bytes(0150000); @@ -1270,7 +1267,7 @@ store_id(a); } /*:85*/ -#line 887 "cwebdir/ctangle.w" +#line 884 "cwebdir/ctangle.w" } else return(eight_bits)'\n'; @@ -1283,7 +1280,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 959 "cwebdir/ctangle.w" +#line 956 "cwebdir/ctangle.w" { boolean hex_flag= false; id_first= loc-1; @@ -1317,13 +1314,13 @@ return constant; } /*:73*/ -#line 898 "cwebdir/ctangle.w" +#line 895 "cwebdir/ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 996 "cwebdir/ctangle.w" +#line 993 "cwebdir/ctangle.w" { char delim= (char)c; id_first= section_text+1; @@ -1337,13 +1334,13 @@ if(loc>=limit){ if(*(limit-1)!='\\'){ #line 227 "cwebdir/ctang-w2c.ch" err_print(_("! String didn't end"));loc= limit;break; -#line 1008 "cwebdir/ctangle.w" +#line 1005 "cwebdir/ctangle.w" } if(get_line()==false){ #line 233 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in middle of string"));loc= buffer;break; -#line 1012 "cwebdir/ctangle.w" +#line 1009 "cwebdir/ctangle.w" } else if(++id_loc<=section_text_end)*id_loc= '\n'; @@ -1363,7 +1360,7 @@ if(++id_loc<=section_text_end)*id_loc= (char)c; if(id_loc>=section_text_end){ #line 239 "cwebdir/ctang-w2c.ch" printf("%s",_("\n! String too long: ")); -#line 1030 "cwebdir/ctangle.w" +#line 1027 "cwebdir/ctangle.w" term_write(section_text+1,25); err_print("..."); @@ -1373,11 +1370,11 @@ return string; } /*:74*/ -#line 902 "cwebdir/ctangle.w" +#line 899 "cwebdir/ctangle.w" else if(isalpha((int)c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 950 "cwebdir/ctangle.w" +#line 947 "cwebdir/ctangle.w" { id_first= --loc; do @@ -1388,45 +1385,45 @@ id_loc= loc;return identifier; } /*:72*/ -#line 904 "cwebdir/ctangle.w" +#line 901 "cwebdir/ctangle.w" else if(c=='@')/*75:*/ -#line 1041 "cwebdir/ctangle.w" +#line 1038 "cwebdir/ctangle.w" switch(c= ccode[(eight_bits)*loc++]){ case ignore:continue; #line 245 "cwebdir/ctang-w2c.ch" case translit_code:err_print(_("! Use @l in limbo only"));continue; -#line 1045 "cwebdir/ctangle.w" +#line 1042 "cwebdir/ctangle.w" case control_text:while((c= skip_ahead())=='@'); if(*(loc-1)!='>') #line 251 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1050 "cwebdir/ctangle.w" +#line 1047 "cwebdir/ctangle.w" continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1086 "cwebdir/ctangle.w" +#line 1083 "cwebdir/ctangle.w" { char*k= section_text; /*79:*/ -#line 1108 "cwebdir/ctangle.w" +#line 1105 "cwebdir/ctangle.w" while(true){ if(loc> limit&&get_line()==false){ #line 269 "cwebdir/ctang-w2c.ch" err_print(_("! Input ended in section name")); -#line 1112 "cwebdir/ctangle.w" +#line 1109 "cwebdir/ctangle.w" loc= buffer+1;break; } c= (eight_bits)*loc; /*80:*/ -#line 1131 "cwebdir/ctangle.w" +#line 1128 "cwebdir/ctangle.w" if(c=='@'){ c= (eight_bits)*(loc+1); @@ -1436,20 +1433,20 @@ loc+= 2;break; if(ccode[(eight_bits)c]==new_section){ #line 281 "cwebdir/ctang-w2c.ch" err_print(_("! Section name didn't end"));break; -#line 1139 "cwebdir/ctangle.w" +#line 1136 "cwebdir/ctangle.w" } if(ccode[(eight_bits)c]==section_name){ #line 287 "cwebdir/ctang-w2c.ch" err_print(_("! Nesting of section names not allowed"));break; -#line 1143 "cwebdir/ctangle.w" +#line 1140 "cwebdir/ctangle.w" } *(++k)= '@';loc++; } /*:80*/ -#line 1116 "cwebdir/ctangle.w" +#line 1113 "cwebdir/ctangle.w" loc++;if(k<section_text_end)k++; if(xisspace(c)){ @@ -1460,7 +1457,7 @@ c= (eight_bits)' ';if(*(k-1)==' ')k--; if(k>=section_text_end){ #line 275 "cwebdir/ctang-w2c.ch" printf("%s",_("\n! Section name too long: ")); -#line 1125 "cwebdir/ctangle.w" +#line 1122 "cwebdir/ctangle.w" term_write(section_text+1,25); printf("...");mark_harmless(); @@ -1468,7 +1465,7 @@ printf("...");mark_harmless(); if(*k==' '&&k> section_text)k--; /*:79*/ -#line 1088 "cwebdir/ctangle.w" +#line 1085 "cwebdir/ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,true); @@ -1493,31 +1490,31 @@ else overflow(_("output files")); } /*:47*/ -#line 1096 "cwebdir/ctangle.w" +#line 1093 "cwebdir/ctangle.w" return section_name; } /*:77*/ -#line 1054 "cwebdir/ctangle.w" +#line 1051 "cwebdir/ctangle.w" case string:/*81:*/ -#line 1153 "cwebdir/ctangle.w" +#line 1150 "cwebdir/ctangle.w" id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; #line 293 "cwebdir/ctang-w2c.ch" if(loc>=limit)err_print(_("! Verbatim string didn't end")); -#line 1157 "cwebdir/ctangle.w" +#line 1154 "cwebdir/ctangle.w" id_loc= loc;loc+= 2; return string; /*:81*/ -#line 1055 "cwebdir/ctangle.w" +#line 1052 "cwebdir/ctangle.w" case ord:/*76:*/ -#line 1066 "cwebdir/ctangle.w" +#line 1063 "cwebdir/ctangle.w" id_first= loc; if(*loc=='\\') @@ -1527,7 +1524,7 @@ if(*loc=='@'){ if(*(loc+1)!='@') #line 257 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in ASCII constant")); -#line 1074 "cwebdir/ctangle.w" +#line 1071 "cwebdir/ctangle.w" else loc++; } @@ -1535,7 +1532,7 @@ loc++; if(loc> limit){ #line 263 "cwebdir/ctang-w2c.ch" err_print(_("! String didn't end"));loc= limit-1;break; -#line 1080 "cwebdir/ctangle.w" +#line 1077 "cwebdir/ctangle.w" } } @@ -1543,13 +1540,13 @@ loc++; return ord; /*:76*/ -#line 1056 "cwebdir/ctangle.w" +#line 1053 "cwebdir/ctangle.w" default:return c; } /*:75*/ -#line 905 "cwebdir/ctangle.w" +#line 902 "cwebdir/ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1559,7 +1556,7 @@ else return(eight_bits)' '; } else if(c=='#'&&loc==buffer+1)preprocessing= true; mistake:/*71:*/ -#line 927 "cwebdir/ctangle.w" +#line 924 "cwebdir/ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1584,14 +1581,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 913 "cwebdir/ctangle.w" +#line 910 "cwebdir/ctangle.w" return c; } } /*:69*//*83:*/ -#line 1189 "cwebdir/ctangle.w" +#line 1186 "cwebdir/ctangle.w" static void scan_repl( @@ -1599,7 +1596,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name)/*85:*/ -#line 1221 "cwebdir/ctangle.w" +#line 1218 "cwebdir/ctangle.w" { store_two_bytes(0150000); @@ -1615,11 +1612,11 @@ store_id(a); } /*:85*/ -#line 1195 "cwebdir/ctangle.w" +#line 1192 "cwebdir/ctangle.w" while(true)switch(a= get_next()){ /*86:*/ -#line 1235 "cwebdir/ctangle.w" +#line 1232 "cwebdir/ctangle.w" case identifier:store_id(a); if(*buffer=='#'&&( @@ -1632,7 +1629,7 @@ break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1276 "cwebdir/ctangle.w" +#line 1273 "cwebdir/ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1640,20 +1637,20 @@ if(*try_loc=='+'&&try_loc<limit)try_loc++; while(*try_loc==' '&&try_loc<limit)try_loc++; #line 329 "cwebdir/ctang-w2c.ch" if(*try_loc=='=')err_print(_("! Missing `@ ' before a named section")); -#line 1282 "cwebdir/ctangle.w" +#line 1279 "cwebdir/ctangle.w" } /*:87*/ -#line 1246 "cwebdir/ctangle.w" +#line 1243 "cwebdir/ctangle.w" a= cur_section_name-name_dir; app_repl((a/0400)+0250); app_repl(a%0400); /*85:*/ -#line 1221 "cwebdir/ctangle.w" +#line 1218 "cwebdir/ctangle.w" { store_two_bytes(0150000); @@ -1669,13 +1666,13 @@ store_id(a); } /*:85*/ -#line 1250 "cwebdir/ctangle.w" +#line 1247 "cwebdir/ctangle.w" } break; #line 317 "cwebdir/ctang-w2c.ch" case output_defs_code:if(t!=section_name)err_print(_("! Misplaced @h")); -#line 1254 "cwebdir/ctangle.w" +#line 1251 "cwebdir/ctangle.w" else{ output_defs_seen= true; @@ -1683,7 +1680,7 @@ a= output_defs_flag; app_repl((a/0400)+0200); app_repl(a%0400); /*85:*/ -#line 1221 "cwebdir/ctangle.w" +#line 1218 "cwebdir/ctangle.w" { store_two_bytes(0150000); @@ -1699,13 +1696,13 @@ store_id(a); } /*:85*/ -#line 1260 "cwebdir/ctangle.w" +#line 1257 "cwebdir/ctangle.w" } break; case constant:case string: /*88:*/ -#line 1293 "cwebdir/ctangle.w" +#line 1290 "cwebdir/ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1713,7 +1710,7 @@ if(*id_first=='@'){ if(*(id_first+1)=='@')id_first++; #line 335 "cwebdir/ctang-w2c.ch" else err_print(_("! Double @ should be used in string")); -#line 1299 "cwebdir/ctangle.w" +#line 1296 "cwebdir/ctangle.w" } else if(a==constant&&*id_first=='\''&&!keep_digit_separators) @@ -1723,12 +1720,12 @@ app_repl(*id_first++); app_repl(a); /*:88*/ -#line 1264 "cwebdir/ctangle.w" +#line 1261 "cwebdir/ctangle.w" break; case ord: /*89:*/ -#line 1311 "cwebdir/ctangle.w" +#line 1308 "cwebdir/ctangle.w" { int c= (int)((eight_bits)*id_first); if(c=='\\'){ @@ -1767,7 +1764,7 @@ case'\'':c= '\'';break; case'\"':c= '\"';break; #line 341 "cwebdir/ctang-w2c.ch" default:err_print(_("! Unrecognized escape sequence")); -#line 1348 "cwebdir/ctangle.w" +#line 1345 "cwebdir/ctangle.w" } } @@ -1780,20 +1777,20 @@ app_repl(constant); } /*:89*/ -#line 1267 "cwebdir/ctangle.w" +#line 1264 "cwebdir/ctangle.w" break; case definition:case format_code:case begin_C:if(t!=section_name)goto done; else{ #line 323 "cwebdir/ctang-w2c.ch" err_print(_("! @d, @f and @c are ignored in C text"));continue; -#line 1272 "cwebdir/ctangle.w" +#line 1269 "cwebdir/ctangle.w" } case new_section:goto done; /*:86*/ -#line 1200 "cwebdir/ctangle.w" +#line 1197 "cwebdir/ctangle.w" case')':app_repl(a); if(t==macro)app_repl(' '); @@ -1803,12 +1800,12 @@ default:app_repl(a); done:next_control= (eight_bits)a; #line 311 "cwebdir/ctang-w2c.ch" if(text_ptr> text_info_end)overflow(_("text")); -#line 1208 "cwebdir/ctangle.w" +#line 1205 "cwebdir/ctangle.w" cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:83*//*90:*/ -#line 1369 "cwebdir/ctangle.w" +#line 1366 "cwebdir/ctangle.w" static void scan_section(void) @@ -1823,7 +1820,7 @@ printf("*%d",(int)section_count);update_terminal(); next_control= ignore; while(true){ /*92:*/ -#line 1410 "cwebdir/ctangle.w" +#line 1407 "cwebdir/ctangle.w" while(next_control<definition) @@ -1832,17 +1829,17 @@ loc-= 2;next_control= get_next(); } /*:92*/ -#line 1383 "cwebdir/ctangle.w" +#line 1380 "cwebdir/ctangle.w" if(next_control==definition){ /*93:*/ -#line 1417 "cwebdir/ctangle.w" +#line 1414 "cwebdir/ctangle.w" while((next_control= get_next())=='\n'); if(next_control!=identifier){ #line 347 "cwebdir/ctang-w2c.ch" err_print(_("! Definition flushed, must start with identifier")); -#line 1421 "cwebdir/ctangle.w" +#line 1418 "cwebdir/ctangle.w" continue; } @@ -1854,7 +1851,7 @@ scan_repl(macro); cur_text->text_link= macro; /*:93*/ -#line 1385 "cwebdir/ctangle.w" +#line 1382 "cwebdir/ctangle.w" continue; } @@ -1864,14 +1861,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1439 "cwebdir/ctangle.w" +#line 1436 "cwebdir/ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1393 "cwebdir/ctangle.w" +#line 1390 "cwebdir/ctangle.w" break; } @@ -1879,20 +1876,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1444 "cwebdir/ctangle.w" +#line 1441 "cwebdir/ctangle.w" /*96:*/ -#line 1449 "cwebdir/ctangle.w" +#line 1446 "cwebdir/ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1445 "cwebdir/ctangle.w" +#line 1442 "cwebdir/ctangle.w" scan_repl(section_name); /*97:*/ -#line 1453 "cwebdir/ctangle.w" +#line 1450 "cwebdir/ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1909,16 +1906,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1447 "cwebdir/ctangle.w" +#line 1444 "cwebdir/ctangle.w" /*:95*/ -#line 1399 "cwebdir/ctangle.w" +#line 1396 "cwebdir/ctangle.w" } /*:90*//*98:*/ -#line 1468 "cwebdir/ctangle.w" +#line 1465 "cwebdir/ctangle.w" static void phase_one(void){ @@ -1931,7 +1928,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1484 "cwebdir/ctangle.w" +#line 1481 "cwebdir/ctangle.w" static void skip_limbo(void) @@ -1945,7 +1942,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1514 "cwebdir/ctangle.w" +#line 1511 "cwebdir/ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1953,7 +1950,7 @@ if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2)) ||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1))) #line 367 "cwebdir/ctang-w2c.ch" err_print(_("! Improper hex number following @l")); -#line 1520 "cwebdir/ctangle.w" +#line 1517 "cwebdir/ctangle.w" else{ unsigned int i; @@ -1965,7 +1962,7 @@ while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||isxalpha(*loc)))loc++; if(loc-beg>=translit_length) #line 373 "cwebdir/ctang-w2c.ch" err_print(_("! Replacement string in @l too long")); -#line 1530 "cwebdir/ctangle.w" +#line 1527 "cwebdir/ctangle.w" else{ strncpy(translit[i-0200],beg,(size_t)(loc-beg)); @@ -1974,7 +1971,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1496 "cwebdir/ctangle.w" +#line 1493 "cwebdir/ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1982,13 +1979,13 @@ while((c= (char)skip_ahead())=='@'); if(*(loc-1)!='>') #line 353 "cwebdir/ctang-w2c.ch" err_print(_("! Double @ should be used in control text")); -#line 1502 "cwebdir/ctangle.w" +#line 1499 "cwebdir/ctangle.w" break; #line 360 "cwebdir/ctang-w2c.ch" }/* otherwise fall through */ default:err_print(_("! Double @ should be used in limbo")); -#line 1506 "cwebdir/ctangle.w" +#line 1503 "cwebdir/ctangle.w" } } @@ -1996,7 +1993,7 @@ default:err_print(_("! Double @ should be used in limbo")); } /*:100*//*103:*/ -#line 1540 "cwebdir/ctangle.w" +#line 1537 "cwebdir/ctangle.w" void print_stats(void){ @@ -2009,7 +2006,7 @@ printf(_("%td replacement texts (out of %ld)\n"), printf(_("%td bytes (out of %ld)\n"), (ptrdiff_t)(byte_ptr-byte_mem),(long)max_bytes); printf(_("%td tokens (out of %ld)\n"), -#line 1551 "cwebdir/ctangle.w" +#line 1548 "cwebdir/ctangle.w" (ptrdiff_t)(tok_ptr-tok_mem),(long)max_toks); } diff --git a/Build/source/texk/web2c/cwebboot.cin b/Build/source/texk/web2c/cwebboot.cin index 0e8c22b6660..b1c95adf57f 100644 --- a/Build/source/texk/web2c/cwebboot.cin +++ b/Build/source/texk/web2c/cwebboot.cin @@ -365,17 +365,17 @@ name_pointer name_ptr; /*:44*//*46:*/ #line 621 "cwebdir/common.w" -name_pointer hash[hash_size]; +name_pointer hash[hash_size]= {NULL}; hash_pointer hash_end= hash+hash_size-1; hash_pointer hash_ptr; /*:46*//*65:*/ -#line 1002 "cwebdir/common.w" +#line 999 "cwebdir/common.w" int history= spotless; /*:65*//*73:*/ -#line 1127 "cwebdir/common.w" +#line 1124 "cwebdir/common.w" int argc; char**argv; @@ -385,11 +385,11 @@ char idx_file_name[max_file_name_length]; #line 456 "cwebdir/comm-w2c.ch" char scn_file_name[max_file_name_length]; char check_file_name[max_file_name_length]; -#line 1134 "cwebdir/common.w" +#line 1131 "cwebdir/common.w" boolean flags[128]; /*:73*//*83:*/ -#line 1270 "cwebdir/common.w" +#line 1267 "cwebdir/common.w" FILE*C_file; FILE*tex_file; @@ -398,7 +398,7 @@ FILE*scn_file; #line 584 "cwebdir/comm-w2c.ch" FILE*active_file; FILE*check_file; -#line 1276 "cwebdir/common.w" +#line 1273 "cwebdir/common.w" #line 601 "cwebdir/comm-w2c.ch" /*:83*//*86:*/ @@ -472,18 +472,18 @@ static void prime_the_change_buffer(void); static void check_change(void); /*:33*//*55:*/ -#line 763 "cwebdir/common.w" +#line 760 "cwebdir/common.w" static int web_strcmp(char*,size_t,char*,size_t); static name_pointer add_section_name(name_pointer,int,char*,char*,boolean); static void extend_section_name(name_pointer,char*,char*,boolean); /*:55*//*64:*/ -#line 990 "cwebdir/common.w" +#line 987 "cwebdir/common.w" static int section_name_cmp(char**,size_t,name_pointer); /*:64*//*76:*/ -#line 1187 "cwebdir/common.w" +#line 1184 "cwebdir/common.w" static void scan_args(void); #line 514 "cwebdir/comm-w2c.ch" @@ -512,12 +512,7 @@ name_ptr= name_dir+1; name_ptr->byte_start= byte_mem; root= NULL; -/*:45*//*47:*/ -#line 628 "cwebdir/common.w" - -for(hash_ptr= hash;hash_ptr<=hash_end;*hash_ptr++= NULL); - -/*:47*/ +/*:45*/ #line 78 "cwebdir/comm-w2c.ch" /*94:*/ @@ -549,11 +544,11 @@ textdomain("cweb"); #line 85 "cwebdir/comm-w2c.ch" /*74:*/ -#line 1140 "cwebdir/common.w" +#line 1137 "cwebdir/common.w" #line 463 "cwebdir/comm-w2c.ch" make_xrefs= true; -#line 1142 "cwebdir/common.w" +#line 1139 "cwebdir/common.w" /*:74*/ #line 86 "cwebdir/comm-w2c.ch" @@ -612,7 +607,7 @@ fatal(_("! Cannot open output file "),check_file_name); else if((tex_file= fopen(tex_file_name,"wb"))==NULL) fatal(_("! Cannot open output file "),tex_file_name); } -#line 1288 "cwebdir/common.w" +#line 1285 "cwebdir/common.w" #line 619 "cwebdir/comm-w2c.ch" /*:84*/ @@ -976,7 +971,7 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; } /*:40*//*48:*/ -#line 633 "cwebdir/common.w" +#line 630 "cwebdir/common.w" name_pointer id_lookup( @@ -991,17 +986,17 @@ name_pointer p; if(last==NULL)for(last= first;*last!='\0';last++); l= (size_t)(last-first); /*49:*/ -#line 656 "cwebdir/common.w" +#line 653 "cwebdir/common.w" h= (int)((eight_bits)*i); while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size; /*:49*/ -#line 646 "cwebdir/common.w" +#line 643 "cwebdir/common.w" /*50:*/ -#line 664 "cwebdir/common.w" +#line 661 "cwebdir/common.w" p= hash[h]; while(p&&!names_match(p,first,l,t))p= p->link; @@ -1011,30 +1006,30 @@ p->link= hash[h];hash[h]= p; } /*:50*/ -#line 647 "cwebdir/common.w" +#line 644 "cwebdir/common.w" if(p==name_ptr)/*51:*/ -#line 675 "cwebdir/common.w" +#line 672 "cwebdir/common.w" { #line 300 "cwebdir/comm-w2c.ch" if(byte_ptr+l> byte_mem_end)overflow(_("byte memory")); if(name_ptr>=name_dir_end)overflow(_("name")); -#line 678 "cwebdir/common.w" +#line 675 "cwebdir/common.w" strncpy(byte_ptr,first,l); (++name_ptr)->byte_start= byte_ptr+= l; #line 307 "cwebdir/comm-w2c.ch" if(program!=ctangle)p->ilk= t,init_node(p); -#line 681 "cwebdir/common.w" +#line 678 "cwebdir/common.w" } /*:51*/ -#line 648 "cwebdir/common.w" +#line 645 "cwebdir/common.w" return p; } /*:48*//*52:*/ -#line 707 "cwebdir/common.w" +#line 704 "cwebdir/common.w" void print_section_name( @@ -1053,7 +1048,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 724 "cwebdir/common.w" +#line 721 "cwebdir/common.w" void sprint_section_name( @@ -1073,7 +1068,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 742 "cwebdir/common.w" +#line 739 "cwebdir/common.w" void print_prefix_name( @@ -1086,7 +1081,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 768 "cwebdir/common.w" +#line 765 "cwebdir/common.w" static int web_strcmp( char*j, @@ -1104,7 +1099,7 @@ else return greater; } /*:56*//*57:*/ -#line 797 "cwebdir/common.w" +#line 794 "cwebdir/common.w" static name_pointer add_section_name( @@ -1120,7 +1115,7 @@ size_t name_len= (size_t)(last-first+(int)ispref); #line 314 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); if(name_ptr+1>=name_dir_end)overflow(_("name")); -#line 811 "cwebdir/common.w" +#line 808 "cwebdir/common.w" (++name_ptr)->byte_start= byte_ptr= s+name_len; if(ispref){ *(byte_ptr-1)= ' '; @@ -1136,7 +1131,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 825 "cwebdir/common.w" +#line 822 "cwebdir/common.w" static void extend_section_name( @@ -1150,21 +1145,21 @@ name_pointer q= p+1; size_t name_len= (size_t)(last-first+(int)ispref); #line 321 "cwebdir/comm-w2c.ch" if(name_ptr>=name_dir_end)overflow(_("name")); -#line 837 "cwebdir/common.w" +#line 834 "cwebdir/common.w" while(q->link!=name_dir)q= q->link; q->link= name_ptr; s= name_ptr->byte_start; name_ptr->link= name_dir; #line 327 "cwebdir/comm-w2c.ch" if(s+name_len> byte_mem_end)overflow(_("byte memory")); -#line 842 "cwebdir/common.w" +#line 839 "cwebdir/common.w" (++name_ptr)->byte_start= byte_ptr= s+name_len; strncpy(s,first,name_len); if(ispref)*(byte_ptr-1)= ' '; } /*:58*//*59:*/ -#line 853 "cwebdir/common.w" +#line 850 "cwebdir/common.w" name_pointer section_lookup( @@ -1179,7 +1174,7 @@ name_pointer par= NULL; size_t name_len= (size_t)(last-first+1); /*60:*/ -#line 877 "cwebdir/common.w" +#line 874 "cwebdir/common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -1191,12 +1186,12 @@ p= (c==less?p->llink:p->rlink); if(r!=NULL){ #line 333 "cwebdir/comm-w2c.ch" printf("%s",_("\n! Ambiguous prefix: matches <")); -#line 887 "cwebdir/common.w" +#line 884 "cwebdir/common.w" print_prefix_name(p); #line 339 "cwebdir/comm-w2c.ch" printf("%s",_(">\n and <")); -#line 890 "cwebdir/common.w" +#line 887 "cwebdir/common.w" print_prefix_name(r); err_print(">"); return name_dir; @@ -1210,19 +1205,19 @@ p= q,q= NULL; } /*:60*/ -#line 867 "cwebdir/common.w" +#line 864 "cwebdir/common.w" /*61:*/ -#line 902 "cwebdir/common.w" +#line 899 "cwebdir/common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 868 "cwebdir/common.w" +#line 865 "cwebdir/common.w" /*62:*/ -#line 910 "cwebdir/common.w" +#line 907 "cwebdir/common.w" switch(section_name_cmp(&first,name_len,r)){ @@ -1230,7 +1225,7 @@ case prefix: if(!ispref){ #line 345 "cwebdir/comm-w2c.ch" printf("%s",_("\n! New name is a prefix of <")); -#line 916 "cwebdir/common.w" +#line 913 "cwebdir/common.w" print_section_name(r); err_print(">"); @@ -1244,7 +1239,7 @@ break; case bad_extension: #line 351 "cwebdir/comm-w2c.ch" printf("%s",_("\n! New name extends <")); -#line 928 "cwebdir/common.w" +#line 925 "cwebdir/common.w" print_section_name(r); err_print(">"); @@ -1252,24 +1247,24 @@ break; default: #line 357 "cwebdir/comm-w2c.ch" printf("%s",_("\n! Section name incompatible with <")); -#line 934 "cwebdir/common.w" +#line 931 "cwebdir/common.w" print_prefix_name(r); #line 363 "cwebdir/comm-w2c.ch" printf("%s",_(">,\n which abbreviates <")); -#line 937 "cwebdir/common.w" +#line 934 "cwebdir/common.w" print_section_name(r); err_print(">"); } return r; /*:62*/ -#line 869 "cwebdir/common.w" +#line 866 "cwebdir/common.w" } /*:59*//*63:*/ -#line 958 "cwebdir/common.w" +#line 955 "cwebdir/common.w" static int section_name_cmp( char**pfirst, @@ -1303,7 +1298,7 @@ default:return c; } /*:63*//*66:*/ -#line 1012 "cwebdir/common.w" +#line 1009 "cwebdir/common.w" void err_print( @@ -1311,7 +1306,7 @@ const char*s) { printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ -#line 1031 "cwebdir/common.w" +#line 1028 "cwebdir/common.w" {char*k,*l; if(changing&&include_depth==change_depth&&change_line> 0) @@ -1320,7 +1315,7 @@ printf(_(". (l. %d of change file)\n"),change_line); else if(cur_line> 0){ if(include_depth==0)printf(_(". (l. %d)\n"),cur_line); else printf(_(". (l. %d of include file %s)\n"),cur_line,cur_file_name); -#line 1038 "cwebdir/common.w" +#line 1035 "cwebdir/common.w" } l= (loc>=limit?limit:loc); if(l> buffer){ @@ -1336,13 +1331,13 @@ putchar(' '); } /*:67*/ -#line 1018 "cwebdir/common.w" +#line 1015 "cwebdir/common.w" update_terminal();mark_error(); } /*:66*//*68:*/ -#line 1066 "cwebdir/common.w" +#line 1063 "cwebdir/common.w" int wrap_up(void){ if(show_progress||show_happiness||history!=spotless)new_line(); @@ -1350,7 +1345,7 @@ if(show_stats) print_stats(); #line 403 "cwebdir/comm-w2c.ch" /*69:*/ -#line 1076 "cwebdir/common.w" +#line 1073 "cwebdir/common.w" switch(history){ #line 429 "cwebdir/comm-w2c.ch" @@ -1362,7 +1357,7 @@ case error_message: puts(_("(Pardon me, but I think I spotted something wrong.)"));break; case fatal_message:default: puts(_("(That was a fatal error, my friend.)")); -#line 1086 "cwebdir/common.w" +#line 1083 "cwebdir/common.w" } /*:69*/ @@ -1387,11 +1382,11 @@ case harmless_message:return RETURN_WARN; case error_message:return RETURN_ERROR; case fatal_message:default:return RETURN_FAIL; } -#line 1074 "cwebdir/common.w" +#line 1071 "cwebdir/common.w" } /*:68*//*70:*/ -#line 1094 "cwebdir/common.w" +#line 1091 "cwebdir/common.w" void fatal( const char*s,const char*t) @@ -1402,19 +1397,19 @@ history= fatal_message;exit(wrap_up()); } /*:70*//*71:*/ -#line 1105 "cwebdir/common.w" +#line 1102 "cwebdir/common.w" void overflow( const char*t) { #line 442 "cwebdir/comm-w2c.ch" printf(_("\n! Sorry, %s capacity exceeded"),t);fatal("",""); -#line 1110 "cwebdir/common.w" +#line 1107 "cwebdir/common.w" } /*:71*//*75:*/ -#line 1158 "cwebdir/common.w" +#line 1155 "cwebdir/common.w" static void scan_args(void) @@ -1437,10 +1432,10 @@ change_file_name[max_file_name_length-2]= '\0'; #endif #line 494 "cwebdir/comm-w2c.ch" -#line 1169 "cwebdir/common.w" +#line 1166 "cwebdir/common.w" while(--argc> 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1248 "cwebdir/common.w" +#line 1245 "cwebdir/common.w" #line 527 "cwebdir/comm-w2c.ch" { @@ -1485,7 +1480,7 @@ if(sscanf(++dot_pos,"%u",&kpathsea_debug)!=1)/*81:*/ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1263 "cwebdir/common.w" +#line 1260 "cwebdir/common.w" #line 578 "cwebdir/comm-w2c.ch" /*:81*/ @@ -1500,11 +1495,11 @@ default:flags[(eight_bits)*dot_pos]= flag_change;continue; break; } } -#line 1251 "cwebdir/common.w" +#line 1248 "cwebdir/common.w" #line 570 "cwebdir/comm-w2c.ch" /*:80*/ -#line 1170 "cwebdir/common.w" +#line 1167 "cwebdir/common.w" else{ s= name_pos= *argv;dot_pos= NULL; @@ -1515,20 +1510,20 @@ else if(*s==DIR_SEPARATOR||*s==DEVICE_SEPARATOR||*s=='/') dot_pos= NULL,name_pos= ++s; else s++; -#line 1177 "cwebdir/common.w" +#line 1174 "cwebdir/common.w" if(!found_web)/*77:*/ -#line 1196 "cwebdir/common.w" +#line 1193 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ #line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" /*:82*/ -#line 1199 "cwebdir/common.w" +#line 1196 "cwebdir/common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); @@ -1536,7 +1531,7 @@ else{ strcpy(web_file_name,*argv); *dot_pos= '\0'; } -#line 1207 "cwebdir/common.w" +#line 1204 "cwebdir/common.w" sprintf(tex_file_name,"%s.tex",name_pos); if(make_xrefs){ sprintf(idx_file_name,"%s.idx",name_pos); @@ -1547,10 +1542,10 @@ found_web= true; } /*:77*/ -#line 1178 "cwebdir/common.w" +#line 1175 "cwebdir/common.w" else if(!found_change)/*78:*/ -#line 1216 "cwebdir/common.w" +#line 1213 "cwebdir/common.w" { if(strcmp(*argv,"-")!=0){ @@ -1558,11 +1553,11 @@ if(s-*argv> max_file_name_length-4) /*82:*/ #line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" /*:82*/ -#line 1220 "cwebdir/common.w" +#line 1217 "cwebdir/common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1572,21 +1567,21 @@ found_change= true; } /*:78*/ -#line 1179 "cwebdir/common.w" +#line 1176 "cwebdir/common.w" else if(!found_out)/*79:*/ -#line 1228 "cwebdir/common.w" +#line 1225 "cwebdir/common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ #line 578 "cwebdir/comm-w2c.ch" fatal(_("! Filename too long\n"),*argv); -#line 1265 "cwebdir/common.w" +#line 1262 "cwebdir/common.w" /*:82*/ -#line 1231 "cwebdir/common.w" +#line 1228 "cwebdir/common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1604,18 +1599,18 @@ found_out= true; } /*:79*/ -#line 1180 "cwebdir/common.w" +#line 1177 "cwebdir/common.w" else/*81:*/ #line 570 "cwebdir/comm-w2c.ch" cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1263 "cwebdir/common.w" +#line 1260 "cwebdir/common.w" #line 578 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1181 "cwebdir/common.w" +#line 1178 "cwebdir/common.w" } } @@ -1624,11 +1619,11 @@ if(!found_web)/*81:*/ cb_usage(program==ctangle?"ctangle":program==cweave?"cweave":"ctwill"); -#line 1263 "cwebdir/common.w" +#line 1260 "cwebdir/common.w" #line 578 "cwebdir/comm-w2c.ch" /*:81*/ -#line 1184 "cwebdir/common.w" +#line 1181 "cwebdir/common.w" } diff --git a/Build/source/texk/web2c/cwebdir/ChangeLog b/Build/source/texk/web2c/cwebdir/ChangeLog index be1de8cb1b1..437c2b6e755 100644 --- a/Build/source/texk/web2c/cwebdir/ChangeLog +++ b/Build/source/texk/web2c/cwebdir/ChangeLog @@ -1,3 +1,12 @@ +2023-11-19 Andreas Scherer <https://ascherer.github.io> + + * common.c, + * common.w, + * ctangle.c, + * ctangle.w, + * ctwill-mini.ch, + * cweave.w: Use zero-initialisation. + 2023-10-29 Andreas Scherer <https://ascherer.github.io> * ctwill-proofsort, diff --git a/Build/source/texk/web2c/cwebdir/common.c b/Build/source/texk/web2c/cwebdir/common.c index 5e4e12917a9..4c9ad7c198e 100644 --- a/Build/source/texk/web2c/cwebdir/common.c +++ b/Build/source/texk/web2c/cwebdir/common.c @@ -302,17 +302,17 @@ name_pointer name_ptr; /*:44*//*46:*/ #line 621 "common.w" -name_pointer hash[hash_size]; +name_pointer hash[hash_size]= {NULL}; hash_pointer hash_end= hash+hash_size-1; hash_pointer hash_ptr; /*:46*//*65:*/ -#line 1002 "common.w" +#line 999 "common.w" int history= spotless; /*:65*//*73:*/ -#line 1127 "common.w" +#line 1124 "common.w" int argc; char**argv; @@ -323,7 +323,7 @@ char scn_file_name[max_file_name_length]; boolean flags[128]; /*:73*//*83:*/ -#line 1270 "common.w" +#line 1267 "common.w" FILE*C_file; FILE*tex_file; @@ -383,18 +383,18 @@ static void prime_the_change_buffer(void); static void check_change(void); /*:33*//*55:*/ -#line 763 "common.w" +#line 760 "common.w" static int web_strcmp(char*,size_t,char*,size_t); static name_pointer add_section_name(name_pointer,int,char*,char*,boolean); static void extend_section_name(name_pointer,char*,char*,boolean); /*:55*//*64:*/ -#line 990 "common.w" +#line 987 "common.w" static int section_name_cmp(char**,size_t,name_pointer); /*:64*//*76:*/ -#line 1187 "common.w" +#line 1184 "common.w" static void scan_args(void); /*:76*/ @@ -415,16 +415,11 @@ name_ptr= name_dir+1; name_ptr->byte_start= byte_mem; root= NULL; -/*:45*//*47:*/ -#line 628 "common.w" - -for(hash_ptr= hash;hash_ptr<=hash_end;*hash_ptr++= NULL); - -/*:47*/ +/*:45*/ #line 99 "common.w" /*74:*/ -#line 1140 "common.w" +#line 1137 "common.w" show_banner= show_happiness= show_progress= make_xrefs= true; @@ -432,7 +427,7 @@ show_banner= show_happiness= show_progress= make_xrefs= true; #line 100 "common.w" /*84:*/ -#line 1277 "common.w" +#line 1274 "common.w" scan_args(); if(program==ctangle){ @@ -776,7 +771,7 @@ limit= buffer;loc= buffer+1;buffer[0]= ' ';input_has_ended= false; } /*:40*//*48:*/ -#line 633 "common.w" +#line 630 "common.w" name_pointer id_lookup( @@ -791,17 +786,17 @@ name_pointer p; if(last==NULL)for(last= first;*last!='\0';last++); l= (size_t)(last-first); /*49:*/ -#line 656 "common.w" +#line 653 "common.w" h= (int)((eight_bits)*i); while(++i<last)h= (h+h+(int)((eight_bits)*i))%hash_size; /*:49*/ -#line 646 "common.w" +#line 643 "common.w" /*50:*/ -#line 664 "common.w" +#line 661 "common.w" p= hash[h]; while(p&&!names_match(p,first,l,t))p= p->link; @@ -811,10 +806,10 @@ p->link= hash[h];hash[h]= p; } /*:50*/ -#line 647 "common.w" +#line 644 "common.w" if(p==name_ptr)/*51:*/ -#line 675 "common.w" +#line 672 "common.w" { if(byte_ptr+l> byte_mem_end)overflow("byte memory"); if(name_ptr>=name_dir_end)overflow("name"); @@ -824,13 +819,13 @@ if(program==cweave)p->ilk= t,init_node(p); } /*:51*/ -#line 648 "common.w" +#line 645 "common.w" return p; } /*:48*//*52:*/ -#line 707 "common.w" +#line 704 "common.w" void print_section_name( @@ -849,7 +844,7 @@ if(q)term_write("...",3); } /*:52*//*53:*/ -#line 724 "common.w" +#line 721 "common.w" void sprint_section_name( @@ -869,7 +864,7 @@ s= p->byte_start; } /*:53*//*54:*/ -#line 742 "common.w" +#line 739 "common.w" void print_prefix_name( @@ -882,7 +877,7 @@ if(s+l<(p+1)->byte_start)term_write("...",3); } /*:54*//*56:*/ -#line 768 "common.w" +#line 765 "common.w" static int web_strcmp( char*j, @@ -900,7 +895,7 @@ else return greater; } /*:56*//*57:*/ -#line 797 "common.w" +#line 794 "common.w" static name_pointer add_section_name( @@ -930,7 +925,7 @@ return par==NULL?(root= p):c==less?(par->llink= p):(par->rlink= p); } /*:57*//*58:*/ -#line 825 "common.w" +#line 822 "common.w" static void extend_section_name( @@ -954,7 +949,7 @@ if(ispref)*(byte_ptr-1)= ' '; } /*:58*//*59:*/ -#line 853 "common.w" +#line 850 "common.w" name_pointer section_lookup( @@ -969,7 +964,7 @@ name_pointer par= NULL; size_t name_len= (size_t)(last-first+1); /*60:*/ -#line 877 "common.w" +#line 874 "common.w" while(p){ c= web_strcmp(first,name_len,first_chunk(p),prefix_length(p)); @@ -996,19 +991,19 @@ p= q,q= NULL; } /*:60*/ -#line 867 "common.w" +#line 864 "common.w" /*61:*/ -#line 902 "common.w" +#line 899 "common.w" if(r==NULL) return add_section_name(par,c,first,last+1,ispref); /*:61*/ -#line 868 "common.w" +#line 865 "common.w" /*62:*/ -#line 910 "common.w" +#line 907 "common.w" switch(section_name_cmp(&first,name_len,r)){ @@ -1042,12 +1037,12 @@ err_print(">"); return r; /*:62*/ -#line 869 "common.w" +#line 866 "common.w" } /*:59*//*63:*/ -#line 958 "common.w" +#line 955 "common.w" static int section_name_cmp( char**pfirst, @@ -1081,7 +1076,7 @@ default:return c; } /*:63*//*66:*/ -#line 1012 "common.w" +#line 1009 "common.w" void err_print( @@ -1089,7 +1084,7 @@ const char*s) { printf(*s=='!'?"\n%s":"%s",s); if(web_file_open)/*67:*/ -#line 1031 "common.w" +#line 1028 "common.w" {char*k,*l; if(changing&&include_depth==change_depth&&change_line> 0) @@ -1112,20 +1107,20 @@ putchar(' '); } /*:67*/ -#line 1018 "common.w" +#line 1015 "common.w" update_terminal();mark_error(); } /*:66*//*68:*/ -#line 1066 "common.w" +#line 1063 "common.w" int wrap_up(void){ if(show_progress||show_happiness||history!=spotless)new_line(); if(show_stats) print_stats(); /*69:*/ -#line 1076 "common.w" +#line 1073 "common.w" switch(history){ case spotless: @@ -1139,14 +1134,14 @@ puts("(That was a fatal error, my friend.)"); } /*:69*/ -#line 1071 "common.w" +#line 1068 "common.w" if(history> harmless_message)return EXIT_FAILURE; else return EXIT_SUCCESS; } /*:68*//*70:*/ -#line 1094 "common.w" +#line 1091 "common.w" void fatal( const char*s,const char*t) @@ -1157,7 +1152,7 @@ history= fatal_message;exit(wrap_up()); } /*:70*//*71:*/ -#line 1105 "common.w" +#line 1102 "common.w" void overflow( const char*t) @@ -1167,7 +1162,7 @@ printf("\n! Sorry, %s capacity exceeded",t);fatal("",""); /*:71*//*75:*/ -#line 1158 "common.w" +#line 1155 "common.w" static void scan_args(void) @@ -1181,13 +1176,13 @@ boolean found_web= false,found_change= false,found_out= false; strcpy(change_file_name,"/dev/null"); while(--argc> 0){ if((**(++argv)=='-'||**argv=='+')&&*(*argv+1))/*80:*/ -#line 1248 "common.w" +#line 1245 "common.w" for(dot_pos= *argv+1;*dot_pos> '\0';dot_pos++) flags[(eight_bits)*dot_pos]= flag_change; /*:80*/ -#line 1170 "common.w" +#line 1167 "common.w" else{ s= name_pos= *argv;dot_pos= NULL; @@ -1196,17 +1191,17 @@ if(*s=='.')dot_pos= s++; else if(*s=='/')dot_pos= NULL,name_pos= ++s; else s++; if(!found_web)/*77:*/ -#line 1196 "common.w" +#line 1193 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1264 "common.w" +#line 1261 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1199 "common.w" +#line 1196 "common.w" if(dot_pos==NULL) sprintf(web_file_name,"%s.w",*argv); @@ -1225,21 +1220,21 @@ found_web= true; } /*:77*/ -#line 1178 "common.w" +#line 1175 "common.w" else if(!found_change)/*78:*/ -#line 1216 "common.w" +#line 1213 "common.w" { if(strcmp(*argv,"-")!=0){ if(s-*argv> max_file_name_length-4) /*82:*/ -#line 1264 "common.w" +#line 1261 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1220 "common.w" +#line 1217 "common.w" if(dot_pos==NULL) sprintf(change_file_name,"%s.ch",*argv); @@ -1249,20 +1244,20 @@ found_change= true; } /*:78*/ -#line 1179 "common.w" +#line 1176 "common.w" else if(!found_out)/*79:*/ -#line 1228 "common.w" +#line 1225 "common.w" { if(s-*argv> max_file_name_length-5) /*82:*/ -#line 1264 "common.w" +#line 1261 "common.w" fatal("! Filename too long\n",*argv); /*:82*/ -#line 1231 "common.w" +#line 1228 "common.w" if(dot_pos==NULL){ sprintf(tex_file_name,"%s.tex",*argv); @@ -1280,10 +1275,10 @@ found_out= true; } /*:79*/ -#line 1180 "common.w" +#line 1177 "common.w" else/*81:*/ -#line 1252 "common.w" +#line 1249 "common.w" { if(program==ctangle) @@ -1297,12 +1292,12 @@ else fatal( } /*:81*/ -#line 1181 "common.w" +#line 1178 "common.w" } } if(!found_web)/*81:*/ -#line 1252 "common.w" +#line 1249 "common.w" { if(program==ctangle) @@ -1316,7 +1311,7 @@ else fatal( } /*:81*/ -#line 1184 "common.w" +#line 1181 "common.w" } diff --git a/Build/source/texk/web2c/cwebdir/common.w b/Build/source/texk/web2c/cwebdir/common.w index c2f88bd0029..ef88b84357a 100644 --- a/Build/source/texk/web2c/cwebdir/common.w +++ b/Build/source/texk/web2c/cwebdir/common.w @@ -619,15 +619,12 @@ it is inserted into the table. @d hash_size 353 /* should be prime */ @<Global var...@>= -name_pointer hash[hash_size]; /* heads of hash lists */ +name_pointer hash[hash_size]={NULL}; /* heads of hash lists */ hash_pointer hash_end = hash+hash_size-1; /* end of |hash| */ hash_pointer hash_ptr; /* index into hash-head array */ @ Initially all the hash lists are empty. -@<Init...@>= -for (hash_ptr=hash; hash_ptr<=hash_end; *hash_ptr++=NULL) ; - @ Here is the main procedure for finding identifiers: @c diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c index 2ea47459543..73cd266687e 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.c +++ b/Build/source/texk/web2c/cwebdir/ctangle.c @@ -337,21 +337,21 @@ static char translit[0200][translit_length]; /*:57*//*62:*/ #line 770 "ctangle.w" -static eight_bits ccode[256]; +static eight_bits ccode[256]= {ignore}; /*:62*//*66:*/ -#line 830 "ctangle.w" +#line 827 "ctangle.w" static boolean comment_continues= false; /*:66*//*68:*/ -#line 867 "ctangle.w" +#line 864 "ctangle.w" static name_pointer cur_section_name; static boolean no_where; /*:68*//*82:*/ -#line 1185 "ctangle.w" +#line 1182 "ctangle.w" static text_pointer cur_text; static eight_bits next_control; @@ -418,29 +418,29 @@ static void output_defs(void); static void out_char(eight_bits); /*:49*//*65:*/ -#line 810 "ctangle.w" +#line 807 "ctangle.w" static eight_bits skip_ahead(void); static boolean skip_comment(boolean); /*:65*//*70:*/ -#line 918 "ctangle.w" +#line 915 "ctangle.w" static eight_bits get_next(void); /*:70*//*84:*/ -#line 1211 "ctangle.w" +#line 1208 "ctangle.w" static void scan_repl(eight_bits); /*:84*//*91:*/ -#line 1402 "ctangle.w" +#line 1399 "ctangle.w" static void scan_section(void); /*:91*//*99:*/ -#line 1479 "ctangle.w" +#line 1476 "ctangle.w" static void phase_one(void); /*:99*//*101:*/ -#line 1512 "ctangle.w" +#line 1509 "ctangle.w" static void skip_limbo(void); /*:101*/ @@ -487,10 +487,7 @@ snprintf(translit[i],translit_length,"X%02X",(unsigned int)(0200+i)); /*:58*//*63:*/ #line 773 "ctangle.w" -{ -int c; -for(c= 0;c<256;c++)ccode[c]= ignore; -} + ccode[' ']= ccode['\t']= ccode['\n']= ccode['\v']= ccode['\r']= ccode['\f'] = ccode['*']= new_section; ccode['@']= (eight_bits)'@';ccode['=']= string; @@ -506,7 +503,7 @@ ccode['<']= ccode['(']= section_name; ccode['\'']= ord; /*:63*//*78:*/ -#line 1106 "ctangle.w" +#line 1103 "ctangle.w" section_text[0]= ' '; /*:78*/ @@ -883,7 +880,7 @@ default:C_putc(cur_char);out_state= normal;break; } /*:55*//*64:*/ -#line 794 "ctangle.w" +#line 791 "ctangle.w" static eight_bits skip_ahead(void) @@ -901,7 +898,7 @@ if(c!=ignore||*(loc-1)=='>')return c; } /*:64*//*67:*/ -#line 833 "ctangle.w" +#line 830 "ctangle.w" static boolean skip_comment( boolean is_long_comment) @@ -935,7 +932,7 @@ else loc++; } /*:67*//*69:*/ -#line 874 "ctangle.w" +#line 871 "ctangle.w" static eight_bits get_next(void) @@ -950,7 +947,7 @@ else if(print_where&&!no_where){ sixteen_bits a; print_where= false; /*85:*/ -#line 1221 "ctangle.w" +#line 1218 "ctangle.w" { store_two_bytes(0150000); @@ -966,7 +963,7 @@ store_id(a); } /*:85*/ -#line 887 "ctangle.w" +#line 884 "ctangle.w" } else return(eight_bits)'\n'; @@ -979,7 +976,7 @@ else continue; } loc++; if(xisdigit(c)||c=='.')/*73:*/ -#line 959 "ctangle.w" +#line 956 "ctangle.w" { boolean hex_flag= false; id_first= loc-1; @@ -1013,13 +1010,13 @@ return constant; } /*:73*/ -#line 898 "ctangle.w" +#line 895 "ctangle.w" else if(c=='\''||c=='"' ||((c=='L'||c=='u'||c=='U')&&(*loc=='\''||*loc=='"')) ||((c=='u'&&*loc=='8')&&(*(loc+1)=='\''||*(loc+1)=='"'))) /*74:*/ -#line 996 "ctangle.w" +#line 993 "ctangle.w" { char delim= (char)c; id_first= section_text+1; @@ -1063,11 +1060,11 @@ return string; } /*:74*/ -#line 902 "ctangle.w" +#line 899 "ctangle.w" else if(isalpha((int)c)||isxalpha(c)||ishigh(c)) /*72:*/ -#line 950 "ctangle.w" +#line 947 "ctangle.w" { id_first= --loc; do @@ -1078,10 +1075,10 @@ id_loc= loc;return identifier; } /*:72*/ -#line 904 "ctangle.w" +#line 901 "ctangle.w" else if(c=='@')/*75:*/ -#line 1041 "ctangle.w" +#line 1038 "ctangle.w" switch(c= ccode[(eight_bits)*loc++]){ case ignore:continue; @@ -1096,11 +1093,11 @@ continue; case section_name: cur_section_name_char= *(loc-1); /*77:*/ -#line 1086 "ctangle.w" +#line 1083 "ctangle.w" { char*k= section_text; /*79:*/ -#line 1108 "ctangle.w" +#line 1105 "ctangle.w" while(true){ if(loc> limit&&get_line()==false){ @@ -1110,7 +1107,7 @@ loc= buffer+1;break; } c= (eight_bits)*loc; /*80:*/ -#line 1131 "ctangle.w" +#line 1128 "ctangle.w" if(c=='@'){ c= (eight_bits)*(loc+1); @@ -1129,7 +1126,7 @@ err_print("! Nesting of section names not allowed");break; } /*:80*/ -#line 1116 "ctangle.w" +#line 1113 "ctangle.w" loc++;if(k<section_text_end)k++; if(xisspace(c)){ @@ -1146,7 +1143,7 @@ printf("...");mark_harmless(); if(*k==' '&&k> section_text)k--; /*:79*/ -#line 1088 "ctangle.w" +#line 1085 "ctangle.w" if(k-section_text> 3&&strncmp(k-2,"...",3)==0) cur_section_name= section_lookup(section_text+1,k-3,true); @@ -1169,16 +1166,16 @@ else overflow("output files"); } /*:47*/ -#line 1096 "ctangle.w" +#line 1093 "ctangle.w" return section_name; } /*:77*/ -#line 1054 "ctangle.w" +#line 1051 "ctangle.w" case string:/*81:*/ -#line 1153 "ctangle.w" +#line 1150 "ctangle.w" id_first= loc++;*(limit+1)= '@';*(limit+2)= '>'; while(*loc!='@'||*(loc+1)!='>')loc++; @@ -1188,10 +1185,10 @@ id_loc= loc;loc+= 2; return string; /*:81*/ -#line 1055 "ctangle.w" +#line 1052 "ctangle.w" case ord:/*76:*/ -#line 1066 "ctangle.w" +#line 1063 "ctangle.w" id_first= loc; if(*loc=='\\') @@ -1213,13 +1210,13 @@ loc++; return ord; /*:76*/ -#line 1056 "ctangle.w" +#line 1053 "ctangle.w" default:return c; } /*:75*/ -#line 905 "ctangle.w" +#line 902 "ctangle.w" else if(xisspace(c)){ if(!preprocessing||loc> limit)continue; @@ -1229,7 +1226,7 @@ else return(eight_bits)' '; } else if(c=='#'&&loc==buffer+1)preprocessing= true; mistake:/*71:*/ -#line 927 "ctangle.w" +#line 924 "ctangle.w" switch(c){ case'+':if(*loc=='+')compress(plus_plus);break; @@ -1254,14 +1251,14 @@ case'!':if(*loc=='=')compress(non_eq);break; } /*:71*/ -#line 913 "ctangle.w" +#line 910 "ctangle.w" return c; } } /*:69*//*83:*/ -#line 1189 "ctangle.w" +#line 1186 "ctangle.w" static void scan_repl( @@ -1269,7 +1266,7 @@ eight_bits t) { sixteen_bits a; if(t==section_name)/*85:*/ -#line 1221 "ctangle.w" +#line 1218 "ctangle.w" { store_two_bytes(0150000); @@ -1285,11 +1282,11 @@ store_id(a); } /*:85*/ -#line 1195 "ctangle.w" +#line 1192 "ctangle.w" while(true)switch(a= get_next()){ /*86:*/ -#line 1235 "ctangle.w" +#line 1232 "ctangle.w" case identifier:store_id(a); if(*buffer=='#'&&( @@ -1302,7 +1299,7 @@ break; case section_name:if(t!=section_name)goto done; else{ /*87:*/ -#line 1276 "ctangle.w" +#line 1273 "ctangle.w" { char*try_loc= loc; while(*try_loc==' '&&try_loc<limit)try_loc++; @@ -1315,13 +1312,13 @@ if(*try_loc=='=')err_print("! Missing `@ ' before a named section"); } /*:87*/ -#line 1246 "ctangle.w" +#line 1243 "ctangle.w" a= cur_section_name-name_dir; app_repl((a/0400)+0250); app_repl(a%0400); /*85:*/ -#line 1221 "ctangle.w" +#line 1218 "ctangle.w" { store_two_bytes(0150000); @@ -1337,7 +1334,7 @@ store_id(a); } /*:85*/ -#line 1250 "ctangle.w" +#line 1247 "ctangle.w" } break; @@ -1349,7 +1346,7 @@ a= output_defs_flag; app_repl((a/0400)+0200); app_repl(a%0400); /*85:*/ -#line 1221 "ctangle.w" +#line 1218 "ctangle.w" { store_two_bytes(0150000); @@ -1365,13 +1362,13 @@ store_id(a); } /*:85*/ -#line 1260 "ctangle.w" +#line 1257 "ctangle.w" } break; case constant:case string: /*88:*/ -#line 1293 "ctangle.w" +#line 1290 "ctangle.w" app_repl(a); while(id_first<id_loc){ @@ -1387,12 +1384,12 @@ app_repl(*id_first++); app_repl(a); /*:88*/ -#line 1264 "ctangle.w" +#line 1261 "ctangle.w" break; case ord: /*89:*/ -#line 1311 "ctangle.w" +#line 1308 "ctangle.w" { int c= (int)((eight_bits)*id_first); if(c=='\\'){ @@ -1442,7 +1439,7 @@ app_repl(constant); } /*:89*/ -#line 1267 "ctangle.w" +#line 1264 "ctangle.w" break; case definition:case format_code:case begin_C:if(t!=section_name)goto done; @@ -1453,7 +1450,7 @@ err_print("! @d, @f and @c are ignored in C text");continue; case new_section:goto done; /*:86*/ -#line 1200 "ctangle.w" +#line 1197 "ctangle.w" case')':app_repl(a); if(t==macro)app_repl(' '); @@ -1466,7 +1463,7 @@ cur_text= text_ptr;(++text_ptr)->tok_start= tok_ptr; } /*:83*//*90:*/ -#line 1369 "ctangle.w" +#line 1366 "ctangle.w" static void scan_section(void) @@ -1481,7 +1478,7 @@ printf("*%d",(int)section_count);update_terminal(); next_control= ignore; while(true){ /*92:*/ -#line 1410 "ctangle.w" +#line 1407 "ctangle.w" while(next_control<definition) @@ -1490,11 +1487,11 @@ loc-= 2;next_control= get_next(); } /*:92*/ -#line 1383 "ctangle.w" +#line 1380 "ctangle.w" if(next_control==definition){ /*93:*/ -#line 1417 "ctangle.w" +#line 1414 "ctangle.w" while((next_control= get_next())=='\n'); if(next_control!=identifier){ @@ -1510,7 +1507,7 @@ scan_repl(macro); cur_text->text_link= macro; /*:93*/ -#line 1385 "ctangle.w" +#line 1382 "ctangle.w" continue; } @@ -1520,14 +1517,14 @@ p= name_dir;break; if(next_control==section_name){ p= cur_section_name; /*94:*/ -#line 1439 "ctangle.w" +#line 1436 "ctangle.w" while((next_control= get_next())=='+'); if(next_control!='='&&next_control!=eq_eq) continue; /*:94*/ -#line 1393 "ctangle.w" +#line 1390 "ctangle.w" break; } @@ -1535,20 +1532,20 @@ return; } no_where= print_where= false; /*95:*/ -#line 1444 "ctangle.w" +#line 1441 "ctangle.w" /*96:*/ -#line 1449 "ctangle.w" +#line 1446 "ctangle.w" store_two_bytes((sixteen_bits)(0150000+section_count)); /*:96*/ -#line 1445 "ctangle.w" +#line 1442 "ctangle.w" scan_repl(section_name); /*97:*/ -#line 1453 "ctangle.w" +#line 1450 "ctangle.w" if(p==name_dir||p==NULL){ last_unnamed->text_link= cur_text-text_info;last_unnamed= cur_text; @@ -1565,16 +1562,16 @@ cur_text->text_link= section_flag; /*:97*/ -#line 1447 "ctangle.w" +#line 1444 "ctangle.w" /*:95*/ -#line 1399 "ctangle.w" +#line 1396 "ctangle.w" } /*:90*//*98:*/ -#line 1468 "ctangle.w" +#line 1465 "ctangle.w" static void phase_one(void){ @@ -1587,7 +1584,7 @@ check_complete(); } /*:98*//*100:*/ -#line 1484 "ctangle.w" +#line 1481 "ctangle.w" static void skip_limbo(void) @@ -1601,7 +1598,7 @@ char c= *loc++; switch(ccode[(eight_bits)c]){ case new_section:return; case translit_code:/*102:*/ -#line 1514 "ctangle.w" +#line 1511 "ctangle.w" while(xisspace(*loc)&&loc<limit)loc++; loc+= 3; @@ -1626,7 +1623,7 @@ translit[i-0200][loc-beg]= '\0'; } /*:102*/ -#line 1496 "ctangle.w" +#line 1493 "ctangle.w" break; case format_code:case'@':break; case control_text:if(c=='q'||c=='Q'){ @@ -1644,7 +1641,7 @@ default:err_print("! Double @ should be used in limbo"); } /*:100*//*103:*/ -#line 1540 "ctangle.w" +#line 1537 "ctangle.w" void print_stats(void){ diff --git a/Build/source/texk/web2c/cwebdir/ctangle.w b/Build/source/texk/web2c/cwebdir/ctangle.w index c1d9cc9ed53..1e3c7d790cf 100644 --- a/Build/source/texk/web2c/cwebdir/ctangle.w +++ b/Build/source/texk/web2c/cwebdir/ctangle.w @@ -768,12 +768,9 @@ milestones. @d new_section 0312 /* control code for `\.{@@\ }' and `\.{@@*}' */ @<Private...@>= -static eight_bits ccode[256]; /* meaning of a char following \.{@@} */ +static eight_bits ccode[256]={ignore}; /* meaning of a char following \.{@@} */ -@ @<Set ini...@>= { - int c; /* must be |int| so the |for| loop will end */ - for (c=0; c<256; c++) ccode[c]=ignore; -} +@ @<Set ini...@>= ccode[' ']=ccode['\t']=ccode['\n']=ccode['\v']=ccode['\r']=ccode['\f'] =ccode['*']=new_section; ccode['@@']=(eight_bits)'@@'; ccode['=']=string; diff --git a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch index ce6982a30bf..d08f0c6b8d3 100644 --- a/Build/source/texk/web2c/cwebdir/ctwill-mini.ch +++ b/Build/source/texk/web2c/cwebdir/ctwill-mini.ch @@ -496,6 +496,14 @@ with |next_control| |!='|'| and ends with |next_control>=format_code|. Thus, it handles \CEE/ text with embedded comments. @z +Section 75. + +@x +@ @<Replace `\.{@@@@}' by `\.{@@}'@>= +@y +@r @ @<Replace `\.{@@@@}' by `\.{@@}'@>= +@z + Section 80. @x @@ -1906,7 +1914,7 @@ Section 268. @x @ A left-to-right radix sorting method is used, since this makes it easy to @y -@r @ A left-to-right radix sorting method is used, since this makes it easy to +@ A left-to-right radix sorting method is used, since this makes it easy to @-c@> @z diff --git a/Build/source/texk/web2c/cwebdir/cweave.w b/Build/source/texk/web2c/cwebdir/cweave.w index e9fb01ff570..2f664c153aa 100644 --- a/Build/source/texk/web2c/cwebdir/cweave.w +++ b/Build/source/texk/web2c/cwebdir/cweave.w @@ -564,12 +564,9 @@ scanning routines. representation by means of the table |ccode|. @<Private...@>= -static eight_bits ccode[256]; /* meaning of a char following \.{@@} */ +static eight_bits ccode[256]={ignore}; /* meaning of a char following \.{@@} */ -@ @<Set ini...@>= { - int c; /* must be |int| so the |for| loop will end */ - for (c=0; c<256; c++) ccode[c]=ignore; -} +@ @<Set ini...@>= ccode[' ']=ccode['\t']=ccode['\n']=ccode['\v']=ccode['\r']=ccode['\f'] =ccode['*']=new_section; ccode['@@']='@@'; /* `quoted' at sign */ @@ -4602,7 +4599,7 @@ list for character |c| begins at location |bucket[c]| and continues through the |blink| array. @<Private...@>= -static name_pointer bucket[256]; +static name_pointer bucket[256]={NULL}; static name_pointer next_name; /* successor of |cur_name| when sorting */ static name_pointer blink[max_names]; /* links in the buckets */ @@ -4610,14 +4607,12 @@ static name_pointer blink[max_names]; /* links in the buckets */ having a nonempty cross-reference list into the proper bucket. @<Do the first pass...@>= { -int c; -for (c=0; c<256; c++) bucket[c]=NULL; for (hash_ptr=hash; hash_ptr<=hash_end; hash_ptr++) { next_name=*hash_ptr; while (next_name) { cur_name=next_name; next_name=cur_name->link; if (cur_name->xref!=(void *)xmem) { - c=(cur_name->byte_start)[0]; + int c=(cur_name->byte_start)[0]; if (xisupper(c)) c=tolower(c); blink[cur_name-name_dir]=bucket[c]; bucket[c]=cur_name; } @@ -4751,11 +4746,8 @@ while (sort_ptr>scrap_info) { cur_name=next_name; next_name=blink[cur_name-name_dir]; cur_byte=cur_name->byte_start+cur_depth; if (cur_byte==(cur_name+1)->byte_start) c=0; /* hit end of the name */ - else { - c=*cur_byte; - if (xisupper(c)) c=tolower(c); - } - blink[cur_name-name_dir]=bucket[c]; bucket[c]=cur_name; + else if (xisupper(c=*cur_byte)) c=tolower(c); + blink[cur_name-name_dir]=bucket[c]; bucket[c]=cur_name; } while (next_name); --sort_ptr; unbucket(cur_depth+1); } |