refactor: add pure attribute to pure functions

This will allow compilers that support the pure attribute to make
further optimizations to functions.
This commit is contained in:
Dundar Göc
2022-04-11 18:29:48 +02:00
parent 9a35704333
commit 0fb571e3b5
8 changed files with 21 additions and 0 deletions

View File

@@ -883,6 +883,7 @@ theend:
/// diff will be used anyway.
///
int diff_internal(void)
FUNC_ATTR_PURE
{
return (diff_flags & DIFF_INTERNAL) != 0 && *p_dex == NUL;
}
@@ -2250,6 +2251,7 @@ bool diffopt_horizontal(void)
// Return true if 'diffopt' contains "hiddenoff".
bool diffopt_hiddenoff(void)
FUNC_ATTR_PURE
{
return (diff_flags & DIFF_HIDDEN_OFF) != 0;
}