Skip to content

Commit

Permalink
main: add resetTagCorkState and copyTagExtraBit
Browse files Browse the repository at this point in the history
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
  • Loading branch information
masatake committed Dec 23, 2023
1 parent 4871bfc commit dd52763
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions main/entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,28 @@ extern bool isTagExtra (const tagEntryInfo *const tag)
return false;
}

extern void copyTagExtraBit (const tagEntryInfo *const src, tagEntryInfo *const dst)
{
unsigned int count = countXtags();
for (unsigned int i = count; i > 0; i--)
{
if (isTagExtraBitMarked (src, i - 1))
markTagExtraBit (dst, i - 1);
else
unmarkTagExtraBit (dst, i - 1);
}
}
extern void resetTagCorkState (tagEntryInfo *const tag)
{
tag->inCorkQueue = 0;
if (tag->extraDynamic)
{
tagEntryInfo original = *tag;
tag->extraDynamic = NULL;
copyTagExtraBit (&original, tag);
}
}

static void assignRoleFull (tagEntryInfo *const e, int roleIndex, bool assign)
{
if (roleIndex == ROLE_DEFINITION_INDEX)
Expand Down
3 changes: 3 additions & 0 deletions main/entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,13 @@ extern bool removeFromIntervalTabMaybe(int corkIndex);
extern void markTagExtraBit (tagEntryInfo *const tag, xtagType extra);
extern void unmarkTagExtraBit (tagEntryInfo *const tag, xtagType extra);
extern bool isTagExtraBitMarked (const tagEntryInfo *const tag, xtagType extra);
extern void copyTagExtraBit (const tagEntryInfo *const src, tagEntryInfo *const dst);

/* If any extra bit is on, return true. */
extern bool isTagExtra (const tagEntryInfo *const tag);

extern void resetTagCorkState (tagEntryInfo *const tag);

/* Functions for attaching parser specific fields
*
* Which function should I use?
Expand Down

0 comments on commit dd52763

Please sign in to comment.