Mercurial > libjeffpc
changeset 864:241c40daa948
int: clarify comment for p2roundup
It read like the code rounded the value up to the next power of 2 rather
than to the next multiple of a power of 2.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Sun, 28 Jan 2024 19:16:22 -0500 |
parents | bb22b8ea2242 |
children | 91a6a5244cce |
files | include/jeffpc/int.h |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/include/jeffpc/int.h Wed Sep 13 10:23:45 2023 -0400 +++ b/include/jeffpc/int.h Sun Jan 28 19:16:22 2024 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020,2022 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> + * Copyright (c) 2016-2020,2022,2024 Josef 'Jeff' Sipek <jeffpc@josefsipek.net> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -163,7 +163,7 @@ return !(val & (val - 1)); } -/* round val to the next multiple of power of 2 */ +/* round val to the next multiple of align (a power of 2) */ static inline uint64_t p2roundup(uint64_t val, uint64_t align) { if (align <= 1)