Skip to content

Commit

Permalink
main, refactor: pass parserDefinition instance to its finalize callba…
Browse files Browse the repository at this point in the history
…ck function

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Jan 21, 2016
1 parent 57391d5 commit 48c8185
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ extern void freeParserResources (void)
parserDefinition* const lang = LanguageTable [i];

if (lang->finalize)
(lang->finalize)((langType)i, (boolean)lang->initialized);
(lang->finalize)(lang, (boolean)lang->initialized);
if (lang->fileKind != &defaultFileKind)
{
eFree (lang->fileKind);
Expand Down Expand Up @@ -1198,7 +1198,7 @@ static rescanReason doNothing (parserDefinition *parser __unused__,

static void lazyInitialize (parserDefinition* parser)
{
Assert (0 <= parser->language && parser->language < (int) LanguageCount);
Assert (0 <= parser->id && parser->id < (int) LanguageCount);

parser->parser = doNothing;

Expand Down
2 changes: 1 addition & 1 deletion main/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ typedef void (*parserInitialize) (parserDefinition *parser);
whether the assoiciated initializer is invoked or not with the
second parameter: INITIALIZED. If it is true, the initializer
is called. */
typedef void (*parserFinalize) (langType language, boolean initialized);
typedef void (*parserFinalize) (parserDefinition *parser, boolean initialized);

typedef const char * (*selectLanguage) (FILE *);

Expand Down
2 changes: 1 addition & 1 deletion parsers/tex.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void initialize (parserDefinition *parser)
lastSubSubS = vStringNew();
}

static void finalize (const langType language __unused__,
static void finalize (parserDefinition *parser __unused__,
boolean initialized)
{
if (initialized)
Expand Down

0 comments on commit 48c8185

Please sign in to comment.