Changeset ebb1489 in mainline for uspace/lib/c/include/align.h
- Timestamp:
- 2024-10-13T08:23:40Z (2 months ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/align.h
r2a0c827c rebb1489 41 41 * @param a Size of alignment, must be power of 2. 42 42 */ 43 #define ALIGN_DOWN(s, a) ((s) & ~(( a) - 1))43 #define ALIGN_DOWN(s, a) ((s) & ~((typeof(s))(a) - 1)) 44 44 45 45 /** Align to the nearest higher address which is a power of two. … … 48 48 * @param a Size of alignment, must be power of 2. 49 49 */ 50 #define ALIGN_UP(s, a) (( long)((s) + ((a) - 1)) & ~((long) (a) - 1))50 #define ALIGN_UP(s, a) ((((s) + ((a) - 1)) & ~((typeof(s))(a) - 1))) 51 51 52 52 /** Round up to the nearest higher boundary.
Note:
See TracChangeset
for help on using the changeset viewer.