fixed Emil damage

This commit is contained in:
anon 2023-08-12 22:35:41 +02:00
parent dc314f734d
commit 80137619e7
5 changed files with 41 additions and 41 deletions

View File

@ -436,7 +436,7 @@ build(void)
if (fflush(newrefs) == EOF) { if (fflush(newrefs) == EOF) {
/* rewind doesn't check for write failure */ /* rewind doesn't check for write failure */
cannotwrite(newreffile); cannotwrite(newreffile);
/* falseTREACHED */ /* NOTREACHED */
} }
/* create the inverted index if requested */ /* create the inverted index if requested */
@ -445,7 +445,7 @@ build(void)
if (fflush(postings) == EOF) { if (fflush(postings) == EOF) {
cannotwrite(temp1); cannotwrite(temp1);
/* falseTREACHED */ /* NOTREACHED */
} }
fstat(fileno(postings), &statstruct); fstat(fileno(postings), &statstruct);
fclose(postings); fclose(postings);
@ -499,11 +499,11 @@ seek_to_trailer(FILE *f)
{ {
if (fscanf(f, "%ld", &traileroffset) != 1) { if (fscanf(f, "%ld", &traileroffset) != 1) {
postfatal(PROGRAM_NAME ": cannot read trailer offset from file %s\n", reffile); postfatal(PROGRAM_NAME ": cannot read trailer offset from file %s\n", reffile);
/* falseTREACHED */ /* NOTREACHED */
} }
if (fseek(f, traileroffset, SEEK_SET) == -1) { if (fseek(f, traileroffset, SEEK_SET) == -1) {
postfatal(PROGRAM_NAME ": cannot seek to trailer in file %s\n", reffile); postfatal(PROGRAM_NAME ": cannot seek to trailer in file %s\n", reffile);
/* falseTREACHED */ /* NOTREACHED */
} }
} }
@ -586,7 +586,7 @@ putlist(char **names, int count)
if (fputs(names[i], newrefs) == EOF || if (fputs(names[i], newrefs) == EOF ||
putc('\n', newrefs) == EOF) { putc('\n', newrefs) == EOF) {
cannotwrite(newreffile); cannotwrite(newreffile);
/* falseTREACHED */ /* NOTREACHED */
} }
} }
} }
@ -716,7 +716,7 @@ movefile(char *new, char *old)
myperror(PROGRAM_NAME); myperror(PROGRAM_NAME);
postfatal(PROGRAM_NAME ": cannot rename file %s to file %s\n", postfatal(PROGRAM_NAME ": cannot rename file %s to file %s\n",
new, old); new, old);
/* falseTREACHED */ /* NOTREACHED */
} }
} }

View File

@ -220,7 +220,7 @@ putfilename(char *srcfile)
/* note: dbputc is not used to avoid lint complaint */ /* note: dbputc is not used to avoid lint complaint */
if (putc(NEWFILE, newrefs) == EOF) { if (putc(NEWFILE, newrefs) == EOF) {
cannotwrite(newreffile); cannotwrite(newreffile);
/* falseTREACHED */ /* NOTREACHED */
} }
++dboffset; ++dboffset;
if (invertedindex == true) { if (invertedindex == true) {
@ -450,7 +450,7 @@ putposting(char *term, int type)
} }
if (putc('\n', postings) == EOF) { if (putc('\n', postings) == EOF) {
cannotwrite(temp1); cannotwrite(temp1);
/* falseTREACHED */ /* NOTREACHED */
} }
++npostings; ++npostings;
} }

View File

@ -114,7 +114,7 @@ myexecvp(char *a, char **args)
perror(msg); /* display the reason */ perror(msg); /* display the reason */
askforreturn(); /* wait until the user sees the message */ askforreturn(); /* wait until the user sees the message */
myexit(1); /* exit the child */ myexit(1); /* exit the child */
/* falseTREACHED */ /* NOTREACHED */
return 0; return 0;
} }

View File

@ -926,7 +926,7 @@ putsource(int seemore, FILE *output)
if (*blockp != '\n' || getrefchar() != '\n' || if (*blockp != '\n' || getrefchar() != '\n' ||
(!isdigit(getrefchar()) && fileversion >= 12)) { (!isdigit(getrefchar()) && fileversion >= 12)) {
postfatal("Internal error: cannot get source line from database"); postfatal("Internal error: cannot get source line from database");
/* falseTREACHED */ /* NOTREACHED */
} }
/* until a double newline is found */ /* until a double newline is found */
do { do {

View File

@ -119,12 +119,12 @@ wsnl [ \t\r\v\f\n]|{comment}
%\{ { /* lex/yacc C declarations/definitions */ %\{ { /* lex/yacc C declarations/definitions */
global = true; global = true;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
%\} { %\} {
global = false; global = false;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
^%% { /* lex/yacc rules delimiter */ ^%% { /* lex/yacc rules delimiter */
braces = 0; braces = 0;
@ -161,7 +161,7 @@ wsnl [ \t\r\v\f\n]|{comment}
last = first; last = first;
my_yymore(); my_yymore();
return(FCNEND); return(FCNEND);
/* falseTREACHED */ /* NOTREACHED */
} }
} }
@ -170,11 +170,11 @@ wsnl [ \t\r\v\f\n]|{comment}
fcndef = true; fcndef = true;
token = FCNDEF; token = FCNDEF;
goto findident; goto findident;
/* falseTREACHED */ /* NOTREACHED */
} }
<SDL>ENDSTATE[ \t] { /* end of an sdl state, treat as end of a function */ <SDL>ENDSTATE[ \t] { /* end of an sdl state, treat as end of a function */
goto endstate; goto endstate;
/* falseTREACHED */ /* NOTREACHED */
} }
\{ { /* count unmatched left braces for fcn def detection */ \{ { /* count unmatched left braces for fcn def detection */
@ -193,7 +193,7 @@ wsnl [ \t\r\v\f\n]|{comment}
return(token); return(token);
} }
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
\#{ws}* { /* start a preprocessor line */ \#{ws}* { /* start a preprocessor line */
@ -201,7 +201,7 @@ wsnl [ \t\r\v\f\n]|{comment}
BEGIN(IN_PREPROC); BEGIN(IN_PREPROC);
yyleng = 1; /* get rid of the blanks, if any */ yyleng = 1; /* get rid of the blanks, if any */
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>endif([^a-zA-Z0-9_$\n].*)? { /* #endif */ <IN_PREPROC>endif([^a-zA-Z0-9_$\n].*)? { /* #endif */
/* delay treatment of #endif depending on whether an /* delay treatment of #endif depending on whether an
@ -210,7 +210,7 @@ wsnl [ \t\r\v\f\n]|{comment}
* after the #endif */ * after the #endif */
BEGIN(WAS_ENDIF); BEGIN(WAS_ENDIF);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<WAS_ENDIF>\n{wsnl}*#{ws}*if(ndef|def)?{ws}+ { <WAS_ENDIF>\n{wsnl}*#{ws}*if(ndef|def)?{ws}+ {
/* attempt to correct erroneous brace count caused by: /* attempt to correct erroneous brace count caused by:
@ -225,14 +225,14 @@ wsnl [ \t\r\v\f\n]|{comment}
/* the current #if must not have an #else or #elif */ /* the current #if must not have an #else or #elif */
if (elseelif == true) { if (elseelif == true) {
goto endif; goto endif;
/* falseTREACHED */ /* NOTREACHED */
} }
pseudoelif = true; pseudoelif = true;
BEGIN(INITIAL); BEGIN(INITIAL);
yyless(1); /* rescan all but the line ending */ yyless(1); /* rescan all but the line ending */
yy_set_bol(1); yy_set_bol(1);
goto eol; goto eol;
/* falseTREACHED */ /* NOTREACHED */
} }
<WAS_ENDIF>\n{wsnl}* { /* an #endif with no #if right after it */ <WAS_ENDIF>\n{wsnl}* { /* an #endif with no #if right after it */
endif: endif:
@ -246,7 +246,7 @@ wsnl [ \t\r\v\f\n]|{comment}
yyless(1); yyless(1);
yy_set_bol(1); yy_set_bol(1);
goto eol; goto eol;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>ifndef{ws}+ | <IN_PREPROC>ifndef{ws}+ |
@ -256,7 +256,7 @@ wsnl [ \t\r\v\f\n]|{comment}
if (pseudoelif == true) { if (pseudoelif == true) {
pseudoelif = false; pseudoelif = false;
goto elif; goto elif;
/* falseTREACHED */ /* NOTREACHED */
} }
/* make sure there is room for the current brace count */ /* make sure there is room for the current brace count */
if (iflevel == miflevel) { if (iflevel == miflevel) {
@ -269,7 +269,7 @@ wsnl [ \t\r\v\f\n]|{comment}
maxifbraces[iflevel++] = 0; maxifbraces[iflevel++] = 0;
BEGIN(INITIAL); BEGIN(INITIAL);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>else({ws}.*)? { /* #else --- eat up whole line */ <IN_PREPROC>else({ws}.*)? { /* #else --- eat up whole line */
elseelif = true; elseelif = true;
@ -284,7 +284,7 @@ wsnl [ \t\r\v\f\n]|{comment}
} }
BEGIN(INITIAL); BEGIN(INITIAL);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>elif{ws}+ { /* #elif */ <IN_PREPROC>elif{ws}+ { /* #elif */
/* elseelif = true; --- HBB I doubt this is correct */ /* elseelif = true; --- HBB I doubt this is correct */
@ -300,7 +300,7 @@ wsnl [ \t\r\v\f\n]|{comment}
} }
BEGIN(INITIAL); BEGIN(INITIAL);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>include{ws}*\"[^"\n]+\" | <IN_PREPROC>include{ws}*\"[^"\n]+\" |
@ -322,7 +322,7 @@ wsnl [ \t\r\v\f\n]|{comment}
} }
BEGIN(INITIAL); BEGIN(INITIAL);
return(INCLUDE); return(INCLUDE);
/* falseTREACHED */ /* NOTREACHED */
} }
\} { \} {
@ -351,13 +351,13 @@ wsnl [ \t\r\v\f\n]|{comment}
} }
} }
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
\( { /* count unmatched left parentheses for function templates */ \( { /* count unmatched left parentheses for function templates */
++parens; ++parens;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
\) { \) {
if (--parens <= 0) { if (--parens <= 0) {
@ -369,7 +369,7 @@ wsnl [ \t\r\v\f\n]|{comment}
template = false; template = false;
} }
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
= { /* if a global definition initializer */ = { /* if a global definition initializer */
if (!my_yytext) if (!my_yytext)
@ -379,7 +379,7 @@ wsnl [ \t\r\v\f\n]|{comment}
initializer = true; initializer = true;
} }
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
: { /* a if global structure field */ : { /* a if global structure field */
if (!my_yytext) if (!my_yytext)
@ -388,7 +388,7 @@ wsnl [ \t\r\v\f\n]|{comment}
structfield = true; structfield = true;
} }
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
\, { \, {
if (braces == initializerbraces) { if (braces == initializerbraces) {
@ -397,7 +397,7 @@ wsnl [ \t\r\v\f\n]|{comment}
} }
structfield = false; structfield = false;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
; { /* if the enum/struct/union was not a definition */ ; { /* if the enum/struct/union was not a definition */
if (braces == 0) { if (braces == 0) {
@ -415,7 +415,7 @@ wsnl [ \t\r\v\f\n]|{comment}
structfield = false; structfield = false;
initializer = false; initializer = false;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>define{ws}+{identifier} { <IN_PREPROC>define{ws}+{identifier} {
@ -438,19 +438,19 @@ wsnl [ \t\r\v\f\n]|{comment}
last = my_yyleng; last = my_yyleng;
BEGIN(INITIAL); BEGIN(INITIAL);
goto definition; goto definition;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>\n { /* unknown preprocessor line */ <IN_PREPROC>\n { /* unknown preprocessor line */
BEGIN(INITIAL); BEGIN(INITIAL);
++myylineno; ++myylineno;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<IN_PREPROC>. | <IN_PREPROC>. |
<IN_PREPROC>{identifier} { /* unknown preprocessor line */ <IN_PREPROC>{identifier} { /* unknown preprocessor line */
BEGIN(INITIAL); BEGIN(INITIAL);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
class{wsnl}+{identifier}({wsnl}|{identifier}|[():])*\{ { /* class definition */ class{wsnl}+{identifier}({wsnl}|{identifier}|[():])*\{ { /* class definition */
@ -459,7 +459,7 @@ class{wsnl}+{identifier}({wsnl}|{identifier}|[():])*\{ { /* class definition */
yyless(5); /* eat up 'class', and re-scan */ yyless(5); /* eat up 'class', and re-scan */
yy_set_bol(0); yy_set_bol(0);
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
("enum"|"struct"|"union") { ("enum"|"struct"|"union") {
@ -501,7 +501,7 @@ if{wsnl}*\( { /* ignore 'if' */
BEGIN(WAS_IDENTIFIER); BEGIN(WAS_IDENTIFIER);
ident_start = first; ident_start = first;
goto more; goto more;
/* falseTREACHED */ /* NOTREACHED */
} }
<WAS_IDENTIFIER>{ <WAS_IDENTIFIER>{
@ -522,16 +522,16 @@ if{wsnl}*\( { /* ignore 'if' */
fcndef = true; fcndef = true;
token = FCNDEF; token = FCNDEF;
goto fcn; goto fcn;
/* falseTREACHED */ /* NOTREACHED */
} }
goto fcncal; goto fcncal;
/* falseTREACHED */ /* NOTREACHED */
} }
{ws}*\(([*&[\]=,.]|{identifier}|{number}|{wsnl})* { /* function call */ {ws}*\(([*&[\]=,.]|{identifier}|{number}|{wsnl})* { /* function call */
fcncal: if (fcndef == true || ppdefine == true || rules == true) { fcncal: if (fcndef == true || ppdefine == true || rules == true) {
token = FCNCALL; token = FCNCALL;
goto fcn; goto fcn;
/* falseTREACHED */ /* NOTREACHED */
} }
if (template == false) { if (template == false) {
templateparens = parens; templateparens = parens;