Skip to content

Commit

Permalink
Move declaration of ClearError to stats.h
Browse files Browse the repository at this point in the history
ClearError is defined in stats.c, so the declaration goes in the
appropriate header.
The function ClearError conflates resetting multiple error states (of
the interpreter/executor and the scanner), so this will need to be
fixed.
  • Loading branch information
markuspf authored and fingolfin committed Nov 21, 2017
1 parent 7386d8f commit a0a3ba8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <src/vars.h> /* variables */

#include <src/bool.h>
#include <src/stats.h> /* for ClearError */

#include <assert.h>

Expand Down
7 changes: 0 additions & 7 deletions src/scanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,6 @@ extern void Match (
TypSymbolSet skipto );


/****************************************************************************
**
*F ClearError() . . . . . . . . . . . . . . reset execution and error flag
*/
extern void ClearError ( void );


/****************************************************************************
**
*F * * * * * * * * * * * open input/output functions * * * * * * * * * * * *
Expand Down
12 changes: 12 additions & 0 deletions src/stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ extern void PrintStat (
extern void (* PrintStatFuncs[256] ) ( Stat stat );


/****************************************************************************
**
*F ClearError() . . . . . . . . . . . . . . reset execution and error flag
*
* FIXME: This function accesses NrError which is state of the scanner, so
* scanner should have an API for this.
*
*/

extern void ClearError ( void );


/****************************************************************************
**
*F * * * * * * * * * * * * * initialize package * * * * * * * * * * * * * * *
Expand Down
1 change: 1 addition & 0 deletions src/streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

#include <src/streams.h> /* streams package */

#include <src/stats.h> /* for ClearError() */


#include <src/vars.h> /* STATE(BottomLVars) for execution contexts */
Expand Down

0 comments on commit a0a3ba8

Please sign in to comment.