Skip to content

Commit

Permalink
utils: Add doc-comments for xadd, xmul
Browse files Browse the repository at this point in the history
Signed-off-by: Simon McVittie <smcv@collabora.com>
  • Loading branch information
smcv committed Oct 16, 2024
1 parent ff33964 commit c1bfc72
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,10 @@ mount_strerror (int errsv)
}
}

/*
* Return a + b if it would not overflow.
* Die with an "out of memory" error if it would.
*/
static size_t
xadd (size_t a, size_t b)
{
Expand All @@ -961,6 +965,10 @@ xadd (size_t a, size_t b)
return result;
}

/*
* Return a * b if it would not overflow.
* Die with an "out of memory" error if it would.
*/
static size_t
xmul (size_t a, size_t b)
{
Expand Down

0 comments on commit c1bfc72

Please sign in to comment.